function validateURL( s_url )
{
     var regexp = /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
     return regexp.test(s_url);
}

function createSystemUserName( el_domain )
{
    var el_system_name = document.getElementById('account_system_user');
    
    var arr = new Array();
    arr = el_domain.value.split(".");
    el_system_name.value = arr[arr.length - 2] + "." + arr[arr.length - 1];
}
function echeck(str) 
{
    var at="@"
    var dot="."
    var lat=str.indexOf(at)
    var lstr=str.length
    var ldot=str.indexOf(dot)
    if (str.indexOf(at)==-1){
       return false
    }

    if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
       return false
    }

    if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
        return false
    }

     if (str.indexOf(at,(lat+1))!=-1){
        return false
     }

     if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
        return false
     }

     if (str.indexOf(dot,(lat+2))==-1){
        return false
     }
    
     if (str.indexOf(" ")!=-1){
        return false
     }

      return true                    
}

function contact_us( type ) {
    var from = "";
    if( typeof( type ) != 'undefined' ) {
        from = type;
    }
    var w = window.open( "http://www.whatsmypracticeworth.com/dock/practice_data_help.cfm?type=contact_us&from=" + from, "window_practice_data_help", "menubar=no,width=800,height=500,toolbar=no,resizable=no,scrollbars=no" );

}
function privacy_policy() {
    var w = window.open( "http://www.whatsmypracticeworth.com/dock/practice_data_help.cfm?type=privacy_policy", "window_practice_data_help", "menubar=no,width=800,height=500,toolbar=no,resizable=no,scrollbars=no" );

}

function download_license() {
    window.open( "http://www.whatsmypracticeworth.com/dock/media/wmpw_license_agreement.pdf" );
    //alert( 'download code here ' );
}

function open_help_window() {
    window.open( "http://www.whatsmypracticeworth.com/dock/practice_data_help.cfm", "window_practice_data_help", "menubar=no,width=700,height=500,toolbar=no,resizable=yes" );
}
function validate_upload(type) {
return;
    var from = "";
    if( typeof( type ) != 'undefined' ) {
        from = type;
    }
    var w = window.open( "http://www.whatsmypracticeworth.com/dock/practice_data_help.cfm?type=check_upload&from=" + from, "window_practice_data_help", "menubar=no,width=700,height=500,toolbar=no,resizable=no" );
}

function validate_upload2(type) {
    var from = "";
    if( typeof( type ) != 'undefined' ) {
        from = type;
    }
    var w = window.open( "http://www.whatsmypracticeworth.com/dock/practice_data_help.cfm?type=check_upload&from=" + from, "window_practice_data_help", "menubar=no,width=700,height=500,toolbar=no,resizable=no" );
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}



