


// runs on pageload
var bExtraPreLoadCommands = false;
function RunOnLoad()
{
	FixExternalLinks();
	//preloadimages();

	// look for the bExtraOnLoadCommands flag and run extra functions if they are present
	if (bExtraPreLoadCommands)
	{
		ExtraOnLoadCommands();
	}
}



// used for portfolio sample popups
function MakePopUp(sImageName, sPortName, iWidth, iHeight) 
{ 
	iWidth2  = iWidth + 60;
	iHeight2 = iHeight + 80;
	displayWindow = window.open("port_closeup.php?theImageName="+sImageName+"&thePortName="+sPortName+"&theWidth="+iWidth+"&theHeight="+iHeight, sImageName, "toolbar=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,top=20,left=20,width=" + iWidth2 + ",height=" + iHeight2);
}



var fieldstocheck = new Array();
fieldnames = new Array();



function checkform(thefunction)
{
	var formHidSubscribe = "not found";
	var formHidUnSubscribe = "not found";
	var formHidList2 = "not found";
	var theForm = document.subscribeform;

	// get the Item Name value
	for (i=0; i<theForm.elements.length; i++)
	{
		// get the subscribe hidden field value
		if (theForm.elements[i].name == 'subscribe')
		{
			formHidSubscribe = theForm.elements[i];
		}

		// get the unsubscribe hidden field value
		if (theForm.elements[i].name == 'unsubscribe')
		{
			formHidUnSubscribe = theForm.elements[i];
		}

		// get the list[2] hidden field value
		if (theForm.elements[i].name == 'list[2]')
		{
			formHidList2 = theForm.elements[i];
		}

	}

	for (i=0;i<fieldstocheck.length;i++)
	{
    		if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "")
		{
		      alert("Please enter your "+fieldnames[i]);
		      eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
		      return false;
		}
	}

	if (thefunction == 'unsubscribe')
	{
		theForm.action = 'http://www.builtbyicon.com/lists/?p=unsubscribe&id=2';
		formHidSubscribe.value = "0";
		formHidUnSubscribe.value = "1";
		formHidList2.value = "signoff";
	}
	else
	{
		theForm.action = 'http://www.builtbyicon.com/lists/?p=subscribe&id=2';
		formHidSubscribe.value = "1";
		formHidUnSubscribe.value = "0";
		formHidList2.value = "signup";
	}

	return true;
}



function addFieldToCheck(value,name)
{
	fieldstocheck[fieldstocheck.length] = value;
	fieldnames[fieldnames.length] = name;
}



function compareEmail()
{
	return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}


function printPage()
{
	if (window.print)
	{
		window.print();  
	}
	else
	{
		// Create OLE Object
		var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	
		// Place Object on page
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
	
		// if intOLEparam is not defined, set it
		if ( ( ! intOLEparam ) || ( intOLEparam < -1 )  || ( intOLEparam > 1 ) )
		{
			intOLEparam = 1;
		}

		// Execute Object
		WebBrowser1.ExecWB( intOLEcmd, intOLEparam );
	
		// Destroy Object
		WebBrowser1.outerHTML = "";
	}
} 



function QuestionMark(sCode)
{
	displayWindow = window.open("wizard_questionmark.php?code="+sCode, "MoreInformation", "toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,top=20,left=20,width=350,height=200");	
}



