var isDOM=document.getElementById?1:0;
var isIE=document.all?1:0;
var isNS4=(navigator.appName=='Netscape'&&!isDOM)?1:0;
var isMOZ=(navigator.appName=='Netscape'&&isDOM)?1:0;
var isIE4=(isIE&&!isDOM)?1:0;
var isWin=(navigator.platform.indexOf('Win')!=-1)?1:0;
var isDyn=(isDOM||isIE4||isNS4);

String.prototype.LTrim=new Function("return this.replace(/^\\s+/,'')")
String.prototype.RTrim=new Function("return this.replace(/\\s+$/,'')")
String.prototype.Trim=new Function("return this.replace(/^\\s+|\\s+$/g,'')")

function LTrim(str) {
 for (var i=0; str.charAt(i)<=" "; i++);
 return str.substring(i,str.length);
}

function RTrim(str) {
 for (var i=str.length-1; str.charAt(i)<=" "; i--);
 return str.substring(0,i+1);
}

function Trim(str) {
 return LTrim(RTrim(str));
}

function opencertdetails() {
	thewindow = window.open('http://www.claredi.com/public/certdetails.php?username=bretthacker', 
		'windowname', config='height=400,width=450,' +
		'toolbar=no,menubar=no,' +
		'scrollbars=yes,resizable=yes,' +
		'location=no,directories=no,status=yes');
}

function checkcontact() {
	var of=document.newform;
	if ((of.Fname.value=='') || (of.Fname.value=='Enter First Name')) {
		alert('You must enter a First Name');
		of.Fname.focus();
		return(false);
	}
	if ((of.Lname.value=='') || (of.Lname.value=='Enter Last Name')) {
		alert('You must enter a Last Name');
		of.Lname.focus();
		return(false);
	}
	if (of.Business.value=='') {
		alert('You must enter a Company Name');
		of.Business.focus();
		return(false);
	}
	if (of.Address1.value=='') {
		alert('You must enter an address');
		of.Address1.focus();
		return(false);
	}
	if (of.City.value=='') {
		alert('You must enter a City Name');
		of.City.focus();
		return(false);
	}
	if (of.State.value=='') {
		alert('You must enter a State');
		of.State.focus();
		return(false);
	}
	if (of.ZIP.value=='') {
		alert('You must enter a ZIP Code');
		of.ZIP.focus();
		return(false);
	}
	if (of.Phone.value=='') {
		alert('You must enter a phone number where you can be reached');
		of.Phone.focus();
		return(false);
	}
	if (of.Email.value=='') {
		alert('You must enter an email address');
		of.Email.focus();
		return(false);
	}
	of.submit();
}

function printpage() {
	printwindow = window.open('/printable.asp?a=' + escape(lFileName) + '&t=' + escape(docTitle) + '&i=' + escape(docImage), 
		'printwindow', config='height=480,width=640,' +
		'toolbar=yes,menubar=yes,' +
		'scrollbars=yes,resizable=yes,' +
		'location=no,directories=no,status=yes');
}

function openlogin() {
	lwindow = window.open('https://www.medremit.com',
		'_blank', config='left=0,top=0,' + 
		'width=' + screen.availWidth + ',' +
		'height=' + screen.availHeight + ',' +
		'toolbar=yes,menubar=yes,' +
		'scrollbars=yes,resizable=yes,' +
		'location=yes,directories=yes,status=yes');
}

function opencontact() {
	cwindow = window.open('/contact.asp','printwindow',
		config='height=690,width=415,' +
		'toolbar=no,menubar=no,' +
		'scrollbars=no,resizable=yes,' +
		'location=no,directories=no,status=no');
}
