function preloadImg(){
	MM_preloadImages('../images/nav_brochures_over.gif','../images/nav_logos_over.gif','../images/nav_webdesign_over.gif','../images/nav_desktopapps_over.gif');
}

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_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_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];}
}

// JavaScript Document
function OpenWin2(obj){
		var linkObj = obj;
		var nWidth = 400;
		var nHeight = 250;
		var nTop = (screen.height - nHeight) / 2;
		var nLeft = (screen.width - nWidth) / 2;
		var sPref = 'toolbar=no,menubar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no,copyhistory=no,width=' + nWidth + ',height=' + nHeight + ',screenX=' + nLeft + ',screenY=' + nTop + ',top=' + nTop + ',left=' + nLeft;
		
		var URL ;
		URL = obj;
		viewDetails = window.open(URL,'Mandatory',sPref);									
}

function OpenWin(obj, title, nWidth, nHeight){
		var nTop = (screen.height - nHeight) / 2;
		var nLeft = (screen.width - nWidth) / 2;
		var sPref = 'toolbar=no,menubar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=' + nWidth + ',height=' + nHeight + ',screenX=' + nLeft + ',screenY=' + nTop + ',top=' + nTop + ',left=' + nLeft;
		viewDetails = window.open(obj, title, sPref);									
}

function validateForm(form) {
	//Loop through the elements on the form and...
	for (i = 0; i < form.elements.length; i++) {
		//...check if any of them have been left blank AND are mandatory
		if ((form.elements[i].value == "") && (form.elements[i].getAttribute("mandatoryField") != "false") && (form.elements[i].id != "otherInfo")) {
			//If there are any blank fields, alert the user and prevent the form from submitting
			alert("Please enter " + form.elements[i].getAttribute("fieldDescription") + ".");

			//Set the focus to the problematic input field
			form.elements[i].focus();

			//Break out of the function and prevent submission of the form
			return (false);
		}
	}

	//None of the above "if" statments have prematurely ended the function (i.e. returned false)
	//then all the fields have been validated, so return true to the form and allow it to be
	//submitted
	return (true);
}
// enter key activation
function netscapeKeyPress(e) {
    if (e.which == 13) {
			EnterBtn();
		    return;
		 }
		 
	else 
		 {
   			return true;
		 }		 
}

function microsoftKeyPress() {
    if (window.event.keyCode == 13) {
			EnterBtn();
		    return;
			}
	else {
   			return true;
		 }
}

if (navigator.appName == 'Netscape') {
    window.captureEvents(Event.KEYPRESS);
    window.onKeyPress = netscapeKeyPress;
}

// form validation
function Form_Validator(affiliate_logon)
{
  // check if login field is blank
  if (affiliate_logon.UserID.value == "")
  {
  alert("Please enter your login");
  affiliate_logon.UserID.focus();
  return (false);
  }

  // check if password field is blank
  if (affiliate_logon.Pin.value == "")
  {
  alert("Please enter your password.");
  affiliate_logon.Pin.focus();
  return (false);
  }
}