
<!--
<!--
today=new Date();
// Build an array initializer

function isnArray() {
        argnr=isnArray.arguments.length
        for (var i=0;i<argnr;i++) {
                this[i+1] = isnArray.arguments[i];
        }
}
// And months and day arrays
var isnMonths=new isnArray("January","February","March","April","May","June","July","August","September","October","November","December");
var isnDays= new isnArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
isnDays[0]="Sunday";
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
// -->
 /*
  CSS Browser Selector v0.3.3 (Sep 09, 2009)
  Rafael Lima (http://rafael.adm.br)
  http://rafael.adm.br/css_browser_selector
  License: http://creativecommons.org/licenses/by/2.5/
  Contributors: http://rafael.adm.br/css_browser_selector#contributors
  */
  function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:/opera(\s|\/)(\d+)/.test(ua)?'opera opera'+RegExp.$2:is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);


function CheckSearchSO() {

    var inputs = document.getElementsByName('dnn$dnnGCSEARCH$q');
    if (inputs.length == 1) {

        // CHECK FOR "SEARCH" SEARCH TERM
        if (inputs[0].value == 'search') {
            alert('Please enter a search term.'); 
            return false;
        }

        // CHECK FOR BLANK SEARCH TERM
        var a = inputs[0].value;
        var b = '';
        var i = 0;
        for (i=0;i<a.length;i++) {
            if (a.charAt(i) != ' ') {b = b + a.charAt(i);}
        }
        if (b == '') {
            alert('Please enter a search term.'); 
            return false;
        }   
    
    }
}


function SubmitContactForm() {

    if (ValidateForm()) {

        var frm = document.forms["Form"]    
        var URL = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
        
        URL = URL + '&oid=00D30000000ndwp';
        URL = URL + '&retURL=http://www.diagnosisone.com/ContactUs/ContactUs_ty.aspx';
        
        URL = URL + '&first_name=' + frm.first_name.value;
        URL = URL + '&last_name=' + frm.last_name.value;
        URL = URL + '&company=' + frm.company.value;
        URL = URL + '&phone=' + frm.phone1.value + frm.phone2.value + frm.phone3.value + frm.phone4.value;
        URL = URL + '&email=' + frm.email.value;
        URL = URL + '&description=' + frm.description.value;       
        URL = URL + '&debug=' + frm.debug.value;
        URL = URL + '&debugEmail=' + frm.debugEmail.value;
        
        //alert(URL);
        location.href = URL;
        
    }
    
}

function ValidateForm() {

	var alertMsg = '';
	var y = 0;	
	var obj = '';
	var val = '';
	var bgColorInvalid='#FFBF00';
	var bgColorValid='#FFF995';
	
	// Validate First Name		
	obj = document.getElementById('first_name');
	
	val = obj.value.replace(/find/g,'replace');
    if ((val.toLowerCase() == 'first') || (val.length == 0)){ 
        obj.style.backgroundColor = bgColorInvalid;		
        if (y==0) {
            alertMsg = 'The following fields are required: \n\n';
            obj.focus();
            y=1;
        }
        alertMsg = alertMsg + '"' + obj.title + '"\n' 
    }else{
        obj.style.backgroundColor = bgColorValid;	
    }
	
	// Validate Last Name		
	obj = document.getElementById('last_name');
	
	val = obj.value.replace(/find/g,'replace');
    if ((val.toLowerCase() == 'last') || (val.length == 0)){ 
        obj.style.backgroundColor = bgColorInvalid;		
        if (y==0) {
            alertMsg = 'The following fields are required: \n\n';
            obj.focus();
            y=1;
        }
        alertMsg = alertMsg + '"' + obj.title + '"\n' 
    }else{
        obj.style.backgroundColor = bgColorValid;	
    }
	
	// Validate E-mail
	obj = document.getElementById('email');
	
	val = obj.value.replace(/find/g,'replace');
    if (val.length == 0){ 
        obj.style.backgroundColor = bgColorInvalid;		
        if (y==0) {
            alertMsg = 'The following fields are required: \n\n';
            obj.focus();
            y=1;
        }
        alertMsg = alertMsg + '"' + obj.title + '"\n' 
    }else{
        obj.style.backgroundColor = bgColorValid;	
    }
    
    
    
	if (alertMsg.length == 0) {
	
	    // Validate bad E-mail
	    obj = document.getElementById('email');
    	
	    val = obj.value;
        if (window.RegExp) {
            var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
            var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
            var reg1 = new RegExp(reg1str);
            var reg2 = new RegExp(reg2str);
            if (!reg1.test(val) && reg2.test(val) || val == ''){
                obj.style.backgroundColor = bgColorValid;	
            }else{
                if (y==0) {				
                    alertMsg = 'Your information could not be submited for the following reason(s): \n\n';
                    obj.focus();
                    y = 1;
                } 
                obj.style.backgroundColor = bgColorInvalid;	
                alertMsg = alertMsg + '"' + obj.title + '" is not a valid email address.\n' 
            }
        } else {
            if(val.indexOf("@") >= 0 || val == ''){
                obj.style.backgroundColor = 'white';	
            }else{
                if (y==0) {				
                    alertMsg = 'Your information could not be submited for the following reason(s): \n\n';
                    obj.focus();
                    y = 1;
                } 
                obj.style.backgroundColor = bgColorInvalid;	
                alertMsg = alertMsg + '"' + obj.title + '" is not a valid email address.\n' 
            }
        }	
    
    }  
    
    
    
    
    if (alertMsg.length) {
        alert(alertMsg);
        return false;
    }
    else {
        return true;
    }

}

function ToggleField(fld, ttl, bol) {

    if (bol) { // entering field
        if (document.getElementById(fld).value == ttl)
            document.getElementById(fld).value = ''
    }
    else { // leaving field
        if (document.getElementById(fld).value == '')
            document.getElementById(fld).value = ttl        
    }       
        
}
function GotoField(evt, cnt, fld, nextField, allowAlpha) {

    var code;
    if (window.event) 
        code = evt.keyCode;
    else 
        code = evt.which;
        
    // Do not do below validations if they are hitting keys 
    // like the arrow keys, F-Keys, etc. 
    var strValidCodes = '|8|9|13|16|17|18|19|20|27|33|34|35|36|37|38|39|40|45|46|144|112|113|114|115|116|117|118|119|120|121|122|123|144|145|';
    var cont = false;
    
    if ((strValidCodes.indexOf('|' + code + '|')) == -1)
        cont = true;

    if (cont) {
        
        // Restrict numeric values if needed    
        if (!allowAlpha) {
            var str = '0123456789';
            var newStr = '';
            for (var i=0;i<fld.value.length;i++) {
                if (str.indexOf(fld.value.charAt(i)) > -1)
                    newStr = newStr + '' + fld.value.charAt(i);
            }
            fld.value = newStr;
        }
        
        // Check field count
        if (cnt > 0 && nextField) {
            if (fld.value.length >= cnt)   
                document.getElementById(nextField).focus();
        }
        
    }
    
}
