function IsFormComplete(FormName)
{
var x       = 0
var FormOk  = true

while ((x < document.forms[FormName].elements.length) && (FormOk))
   {
     if ((document.forms[FormName].elements[x].value == '') && ((x < 3) || (x > 5)) && (x !=  8) ) 
     { 
       //        alert('Oops.  It looks like the field '+document.forms[FormName].elements[x].name+ ' is blank or invalid.  \nLet\'s try try that again.')
 
	alert('Oops.  It looks like one or more required fields are blank or invalid.\nPlease try again.')
        document.forms[FormName].elements[x].focus()
        FormOk = false 
     }
     x ++
   }
return FormOk
}

function IsGalleryFormComplete(FormName) {
	var x       = 0
	var FormOk  = true

	while ((x < document.forms[FormName].elements.length) && (FormOk)) {
		if (document.forms[FormName].elements[x].value == '')  { 
 			alert('Oops.  It looks like one or more required fields are blank or invalid.\nPlease try again.')
			document.forms[FormName].elements[x].focus()
			FormOk = false 
		}
		x ++
	}
	return FormOk
}

//affiliate functions
function getAffRecentOrders(aff_id) {
	//alert(aff_id)
	document.formAffRecentOrders.aff.value=aff_id;
        document.formAffRecentOrders.pg.value='ste_affacctord';
	document.formAffRecentOrders.submit();
}
function getAffAcctInfo(aff_id) {
	//alert(aff_id)
	document.formAffAcctInfo.aff.value=aff_id;
        document.formAffAcctInfo.pg.value='ste_affacctstat';
	document.formAffAcctInfo.submit();
}
function updateAffAcctInfo(aff_id) {
	//alert(aff_id)
	document.formUpdateAffAcctInfo.aff.value=aff_id;
        document.formUpdateAffAcctInfo.pg.value='ste_affacctupd';
	document.formUpdateAffAcctInfo.submit();
}
function showAffLink(aff_id) {
	//alert(aff_id)
	document.formShowAffLink.aff.value=aff_id;
        document.formShowAffLink.pg.value='ste_affacctlink';
	document.formShowAffLink.submit();
}
function showAffButtons(aff_id) {
	//alert(aff_id)
	document.formShowAffLink.aff.value=aff_id;
       document.formShowAffLink.pg.value='ste_aff_banners';
	document.formShowAffLink.submit();
}
function affAcctLogout() {
	//document.formShowAffLink.aff.value=aff_id;
        document.formShowAffLink.pg.value='ste_aff_main';
	document.formShowAffLink.submit();
}

function PagePopup(popupURL) {
      if (window.popup) {
	       window.popup.location=popupURL;
	       window.popup.focus();
	} else {
		var popup=window.open(popupURL,"popup",'top=7,screenY=7,left=7,screenX=7,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=615,height=440');
	       if (navigator.appName.substring(0,8)=="Netscape" || navigator.appName=="Microsoft Internet Explorer") {
		       popup.location=popupURL;
		       popup.opener=self;
	       }
		       popup.focus();
	       }
}

function imgPopup(filename) {
	popupURL = "/cgi-bin/imgPopup.cgi?fn="+filename;
      if (window.popup) {
	       window.popup.location=popupURL;
	       window.popup.focus();
	} else {
		var popup=window.open(popupURL,"popup",'top=7,screenY=7,left=7,screenX=7,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=615,height=440');
	       if (navigator.appName.substring(0,8)=="Netscape" || navigator.appName=="Microsoft Internet Explorer") {
		       popup.location=popupURL;
		       popup.opener=self;
	       }
		       popup.focus();
	       }
}

function smPagePopup(popupURL) {
      if (window.popup) {
	       window.popup.location=popupURL;
	       window.popup.focus();
	} else {
		var popup=window.open(popupURL,"popup",'top=7,screenY=7,left=7,screenX=7,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=430,height=390');
	       if (navigator.appName.substring(0,8)=="Netscape" || navigator.appName=="Microsoft Internet Explorer") {
		       popup.location=popupURL;
		       popup.opener=self;
	       }
		       popup.focus();
	       }
}
