function newWindow(popup) {
	popupWindow = window.open(popup,'popWin','width=640,height=480,top=40,left=40,status=no,menubar=no,scrollbars=no,toolbar=no,resizable=no')
	popupWindow.focus()
}
function popupNews(popup) {
	popupWindow = window.open(popup,'popWin','width=495,height=300,top=40,left=40,status=no,menubar=no,scrollbars=yes,toolbar=no,resizable=no')
	popupWindow.focus()
}
function popupparam(popup, x, y) {
	popupWindow = window.open(popup,'popWin','width='+x+',height='+y+',top=40,left=40,status=no,menubar=no,scrollbars=yes,toolbar=no,resizable=no')
	popupWindow.focus()
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function emptyField(textObj) {
	if (textObj.value.length==0) return true;
	for (var i=0; i<textObj.value.length; i++)  {
			var ch = textObj.value.charAt(i);
			if (ch != ' ' && ch !='\t') return false;
	}
	return true;
}


function validateDemoRequest(f1) {
	if (emptyField(f1.firstname)) {
			alert("Please complete the First Name field.");
			f1.firstname.focus();
			f1.firstname.select();
	}
	else if (emptyField(f1.lastname)) {
			alert("Please complete the Last Name field.");
			f1.lastname.focus();
			f1.lastname.select();
	}
	else if (emptyField(f1.email)) {
			alert("Please complete the Email field.");
			f1.email.focus();
			f1.email.select();
	}
	else if (emptyField(f1.phone)) {
			alert("Please complete the Phone Number field.");
			f1.phone.focus();
			f1.phone.select();
	}
	else if (emptyField(f1.company)) {
			alert("Please complete the Company field.");
			f1.company.focus();
			f1.company.select();
	}
	else if (emptyField(f1.position)) {
			alert("Please complete the Position field.");
			f1.position.focus();
			f1.position.select();
	}
	else return true;
	return false;
}


function validateNews(f1) {
	if (emptyField(f1.name)) {
			alert("Please complete the name field.");
			f1.name.focus();
			f1.name.select();
	}
	else if (emptyField(f1.email)) {
			alert("Please complete the email field.");
			f1.email.focus();
			f1.email.select();
	}
	else return true;
	return false;
}