
<!--

var submitted = 0;
var isMouseDown = false;
var tempX = 0;
var tempY = 0;
var topZ = 99;
var t='';
var U = '';
var T = '';
var FormOffsetLeft = '';
var FormOffsetTop= '';
var BrowserSupportMsg = '';
var divTag = '';
var todaydate = '';
var thefilesize = '';

var thedivSiteMessageCreated='false';	
var thedivSiteFormDivCreated = 'false';

//var thedivVIDViewerCreated='false';	

var digits = "0123456789";
var phoneNumberDelimiters = "()-x ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;

var currentTime = new Date();
var month = currentTime.getMonth()+1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var theDate = month + "/" + day + "/" + year;

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};

BrowserDetect.init();
var theBrowser_name = BrowserDetect.browser;
var theBrowser_version = BrowserDetect.version;
var theOS_name = BrowserDetect.OS;

function aclick(mystr){
	if (mystr=="home") location.href="/";
	if (mystr=="button") OneClick('1');
	if (mystr=="image") OneClick('1');
	if (mystr=="download") OneClick('1');
	if (mystr=="link") OneClick('1');	
	if (mystr=="ShowForm") Show_Form();
	return;
}

function alertkey(e) { 
	if( !e ) { 
		if( window.event ) { 
		e = window.event; 
		} else { 
		return; 
		} 
	} 
	if( typeof( e.which ) == 'number' ) { 
		e = e.which; 
				} else if( typeof( e.keyCode ) == 'number' ) { 
					e = e.keyCode; 
				} else if( typeof( e.charCode ) == 'number' ) { 
					e = e.charCode; 
				} else { 
				return; 
			} 
		if (e=='13') return false;
} 


function createRequestObject()
{
	testBrowserSupport();
	if (theBrowser_name == "Explorer" && BrowserSupportMsg == "IE") {	

	var request_;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer")
	{
		try {
			request_ = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				request_ = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				window.alert('could not create IE request object:  ' + e.description);
			}
		}
	}
	}
	else
	{
 		try {
			request_ = new XMLHttpRequest();
			request_.overrideMimeType('text/xml');
		}	catch (e) {
				window.alert('could not create Non-IE request object:  ' + e.description);
		}			
	}
	return request_;
}

function clearFieldMessage() {
	document.getElementById('Formfieldmessage').innerHTML=("Complete the form to continue");
}

function clearField(input,def_value) {
    if (input.value == (def_value)) input.value="";
    //if (input.value != (def_value)) input.value=def_value;
	var g=input.title;
	document.getElementById('Formfieldmessage').innerHTML=(g);
}

function CloseMyDiv(divID){
	document.getElementById(divID).style.visibility = 'hidden';
	document.getElementById(divID).style.display = 'none';
}

function checkField(input) {
	input.value=j_trim(input.value);
	document.getElementById(input).value=input.value;
}

function checkEnter(e){
	var characterCode;
	if(e && e.which){
		e = e;
		characterCode = e.which; 
	}
	else{
		e = event;
		characterCode = e.keyCode;
	}
	if(characterCode == 13){ 
	  	FirstNameField=document.getElementById('firstname-req').value;
		if (FirstNameField=="") window.alert('Please complete the form to continue');
		event.cancelBubble = true;
		event.returnValue = false;
		return false;
	} else {
		return true;
	}
}

function checkEmail(x) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x)) {isitvalid = true;}
else {isitvalid = false;}
return isitvalid;
}

function checkPhone(myphone){
	if (checkInternationalPhone(myphone.value)==false){
		window.alert("Please Enter a Valid Phone Number:\n\nTelephone number requires a minimum of 10 digits.\nUse x (lower case) to designate an extension.\n\nExample: (555) 555-1212 x123\n\n")
		document.getElementById(myphone.id).value="";
	}
}

function checkInternationalPhone(strPhone){
	//window.alert(strPhone);
	var bracket=3;
	strPhone=trim(strPhone);
	if(strPhone.indexOf("+")>1){return false;}
	if(strPhone.indexOf("-")!=-1)bracket=bracket+1;
	if(strPhone.indexOf("(")!=-1 && strPhone.indexOf("(")>bracket) {return false;}
	var brchr=strPhone.indexOf("(");
 	//window.alert(strPhone);
	if(strPhone.indexOf("(")!=-1 && strPhone.charAt(brchr+4)!=")") {return false;}
	if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1) {return false;}
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	if(s.indexOf("x")!=-1 && s.charAt(11)!="x") {return false;}
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function DisplayMyDiv(divID,toppos,leftpos){
	MyDivOnTop(divID);
	document.getElementById(divID).style.top = toppos;
	document.getElementById(divID).style.left = leftpos;
	document.getElementById(divID).style.display = 'block';
	document.getElementById(divID).style.visibility = 'visible';
}

function displayfootermessage(){
	//document.getElementById('footer').innerHTML = '<center><br>*If your selection does not open, you may click <a href="includes/download.php">here to download</a> a copy.<br></center>';
	document.getElementById('footer').style.width = '100%';
	document.getElementById('footer').style.display = 'block';
}

function displaydownloadmessage(){
	//document.getElementById('footer').innerHTML = '<center><br>*If your selection does not open, you may click <a href="includes/download.php">here to download</a> a copy.<br></center>';
	document.getElementById('downloadlink').style.width = '100%';
	document.getElementById('downloadlink').style.display = 'block';
}


function displayprivacymessage(privacymessage){
	document.getElementById('privacy').innerHTML = '<center><br>'+privacymessage+'<br></center>';
	document.getElementById('privacy').style.width = '100%';
	document.getElementById('privacy').style.display = 'block';
}


function displaytheprivacymessage(privacymessage){
	document.getElementById('privacy').innerHTML = '<center><br>'+privacymessage+'<br></center>';
	document.getElementById('privacy').style.width = '100%';
	document.getElementById('privacy').style.display = 'block';
}

var aryClassElements = new Array();
function EnableForm() {
    aryClassElements.length = 0;
    getElementsByClassName( 'FormInput', document.body );
    for ( var i = 0; i < aryClassElements.length; i++ ) {
        aryClassElements[i].disabled = 0;
    }

}

function enablepage(){
	document.getElementById('image_offer').style.display = 'block';
	document.getElementById('activebuttons').style.display = 'block';
	if (privacymessage !=''){
		displaytheprivacymessage(Base64.decode(privacymessage));
	}
}


function GetTheForm(){
	var formstr=Base64.decode(theform);
	if (thedivSiteFormDivCreated=='true') {
		document.body.removeChild(document.getElementById('theform'));
		thedivSiteFormDivCreated='false';
	}
	thecreateFormDiv(formstr);
 	EnableForm();
	//ShowAtPosition('image_offer','divFormPopUp');
	ShowAtPosition(formposition,'divFormPopUp');
	clearFieldMessage();
}

function getElementsByClassName( strClassName, obj ) {
    if ( obj.className == strClassName ) {
        aryClassElements[aryClassElements.length] = obj;
    }
    for ( var i = 0; i < obj.childNodes.length; i++ ){
        getElementsByClassName( strClassName, obj.childNodes[i] );
	}
}

function getelementwidth(myelement){
	theelementwidth=document.getElementById(myelement).style.width;
	window.alert(theelementwidth);
return theelementwidth;
}

function getElementPosition(elemID){
	var offsetTrail = document.getElementById(elemID);
	if (FormOffsetLeft != '') {var offsetLeft=FormOffsetLeft;} else {var offsetLeft = 85;}
	if (FormOffsetTop != '') {var offsetTop=FormOffsetTop;} else {var offsetTop = 25;}
	while (offsetTrail){
		offsetLeft += offsetTrail.offsetLeft;
		offsetTop += offsetTrail.offsetTop;
		offsetTrail = offsetTrail.offsetParent;
	}
	if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
	offsetLeft += document.body.leftMargin;
	offsetTop += document.body.topMargin;
	}
return {left:offsetLeft,top:offsetTop};
}

function getCookie(thecookiename) {
   m_site_cookie = readCookie(thecookiename);
   return;
}

function HideMyDiv(divID){
	document.getElementById(divID).style.visibility = 'hidden';
	document.getElementById(divID).style.display = 'none';
	if (t != '') clearTimeout(t);
}


function HideMyMessageDiv(divID){
	if (thedivSiteMessageCreated=='true') {document.body.removeChild(document.getElementById('MSGdiv1'));thedivSiteMessageCreated='false';}
}

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++) {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
return true;
}

function j_trim(str){
	var a=0;var b=str.length;while (a<=b){
	/*remove preceeding characters*/	
		for(i=str.length; i>=0; i--) while(str.charAt(0) == (".") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == (" ") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("	") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("'") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("\"") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("\\") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("\/") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("&") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("$") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("[") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("]") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("(") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == (")") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("!") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("@") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("%") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("^") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("*") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("`") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("+") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("=") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("|") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == (":") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == (";") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == (",") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("?") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("-") ) {str = str.substring(1);}
		for(i=str.length; i>=0; i--) while(str.charAt(0) == ("#") ) {str = str.substring(1);}
		/*remove trailing characters*/
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "." ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == " " ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "	" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "'" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "\"" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "\\" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "\/" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "&" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "$" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "]" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "[" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "(" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == ")" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "!" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "@" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "%" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "^" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "*" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "`" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "+" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "=" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "|" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == ":" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == ";" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "," ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "?" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "-" ){str = str.substring(0,str.length-1);}
		for(i=str.length; i>=0; i--) while(str.charAt(str.length-1) == "#" ){str = str.substring(0,str.length-1);}
		
	str=str.replace(/>/g, "");
  		while(str.match(">")) {
  			y= str.indexOf(">")
  			if ((y) > -1) str=(str.substr(y+1));
  		}

	str=str.replace(/</g, "");
  		while(str.match("<")) {
  			y= str.indexOf("<")
  			if ((y) > -1) str=(str.substr(y+1));
  		}

	str=str.replace(/=/g, "");
  		while(str.match("=")) {
  			y= str.indexOf("=")
  			if ((y) > -1) str=(str.substr(y+1));
  		}

	str=str.replace(/{/g, "");
  		while(str.match("{")) {
  			y= str.indexOf("{")
  			if ((y) > -1) str=(str.substr(y+1));
  		}

	str=str.replace(/}/g, "");
  		while(str.match("}")) {
  			y= str.indexOf("}")
  			if ((y) > -1) str=(str.substr(y+1));
  		}

	str=str.replace(/--'/g, "");
  		while(str.match("--'")) {
  			y= str.indexOf("--'")
  			if ((y) > -1) str=(str.substr(y+1));
  		}

	a=a+1;}
	str=ProperCase(str);
  return str;
}

function myStateSelect(str) {
	var x1=document.getElementById(str);
	var stateLength=document.Registration_Form.thestate.length-1;
	if ((x1.selectedIndex) ==1) {
		document.Registration_Form.thestate.disabled=0;document.Registration_Form.thestate.selectedIndex=1;document.Registration_Form.thestate.focus();return;
	}
	if ((x1.selectedIndex) ==2) {
		document.Registration_Form.thestate.disabled=0;document.Registration_Form.thestate.selectedIndex=53;document.Registration_Form.thestate.focus();return;
	} else {
		document.Registration_Form.thestate.disabled=1;document.Registration_Form.thestate.selectedIndex=stateLength;return;
	}
//else {document.Registration_Form.thestate.disabled=1;document.Registration_Form.thestate.selectedIndex=67;return;}
}

function myStateSelectCheck(str) {
	var x1=document.getElementById(str);
	if ((x1.selectedIndex) <=1) {window.alert("Please select a State");document.Registration_Form.thestate.focus();document.Registration_Form.country.selectedIndex=0;}
	if ((x1.selectedIndex) ==53) {window.alert("Please select a Candian Province");document.Registration_Form.thestate.focus();document.Registration_Form.country.selectedIndex=2;} 
	//if ((x1.selectedIndex) <=52) {document.Registration_Form.country.selectedIndex=1;} 
	//if ((x1.selectedIndex) >=53) {document.Registration_Form.country.selectedIndex=2;} 
	// if ((x1.selectedIndex) ==67) {window.alert("Please select a Country");document.Registration_Form.country.selectedIndex=0;}
}

function MoveMyDiv(divID, mouseX, mouseY){
	if (isMouseDown){
		var xChange = 0;
		var yChange = 0;
		if (tempX != 0)	{
			xChange = mouseX - tempX;
		}
		if (tempY != 0)	{
			yChange = mouseY - tempY;
		}
		tempX = mouseX;
		tempY = mouseY;
		var valTop = parseInt(document.getElementById(divID).style.top.substr(0,document.getElementById(divID).style.top.indexOf('px'))) + yChange;
		var valLeft = parseInt(document.getElementById(divID).style.left.substr(0,document.getElementById(divID).style.left.indexOf('px'))) + xChange;
		document.getElementById(divID).style.top = valTop + 'px';
		document.getElementById(divID).style.left = valLeft + 'px';
	}
}

function MyDivOnTop(divID){
	topZ += 1;
	document.getElementById(divID).style.zIndex = topZ;
}

function moreinfo_check(input) {
	if ((input.toLowerCase()) == "on") {theconfirmvalue="Yes";return theconfirmvalue;} else {theconfirmvalue="No Thanks";return theconfirmvalue;}
}

function additionalinfo_check(input) {
	if ((input.toLowerCase()) != "yes") {theconfirmvalue="No Thanks";return theconfirmvalue;} else {theconfirmvalue="Yes";return theconfirmvalue;}
}


function OneClick(str) {
	submitted++;
	v=setTimeout("reset_count()", 1*1000 ); 
	if (submitted < 2) {
	   if (m_site_cookie || str == 0) {
		 show_message(str);
	   } else {
		 GetTheForm();
	   }
   	}
}

function ProperCase(str) {return str.toLowerCase().replace(/^(.)|\s(.)/g,function($1) {return $1.toUpperCase();});}

function reset_count() {
	submitted = 0;
	return;
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function resetField(input,def_value) {
	input.value=j_trim(input.value);
	if ((input.value.toUpperCase()) == (def_value.toUpperCase())) input.value=(def_value);
    if (input.value == "") input.value=(def_value);
}

function resetFieldNoTrim(input,def_value) {
	if ((input.value.toUpperCase()) == (def_value.toUpperCase())) input.value=(def_value);
    if (input.value == "") input.value=(def_value);
}

function removeOptions2(theSel){
	while(theSel.options.length > 0)
	theSel.options[theSel.options.length-1] = null;
	theSel.options[theSel.length] = new Option('', '');
	return;
}

function removeOptions(theSel){
	for(i=theSel.length; i>=0; i--){
		theSel.options[i] = null;
	}
	return;
}

function ReturnEmailTestResponse(inputID, request){
}

function SiteMessage_PopUp() {
	theSiteMessageViewer = '';
	theSiteMessageViewer=theSiteMessageViewer+'<div id="divMessagePopUp" style="position:absolute;z-index:3;display:none;visibility:hidden;border-left:3px solid black;border-right:3px solid black;border-bottom:2px solid black;width:340px;font-size:18px;">';
	theSiteMessageViewer=theSiteMessageViewer+'            <div id="divFormPopUpStyle" onmousedown="MyDivOnTop(\'divMessagePopUp\');startMove()" onmouseup="stopMove()" onmouseout="stopMove()" onmousemove="MoveMyDiv(\'divMessagePopUp\',event.clientX,event.clientY)">';
	theSiteMessageViewer=theSiteMessageViewer+'              <button type="button" onclick="HideMyDiv(\'divMessagePopUp\')" title="Close">X</button>';
	theSiteMessageViewer=theSiteMessageViewer+'            </div>';
	theSiteMessageViewer=theSiteMessageViewer+'            <div id="divMessage" style="height:100%;font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:bold;padding-left:10px;padding-right:10px;">';
	theSiteMessageViewer=theSiteMessageViewer+'			  <br>';
	theSiteMessageViewer=theSiteMessageViewer+'			  <center>Your selection is being retrieved....</center>';
	if (thefilesize != ''){
		theSiteMessageViewer=theSiteMessageViewer+'			  Download size: '+thefilesize;	
		theSiteMessageViewer=theSiteMessageViewer+'			  <br>';
	}
	theSiteMessageViewer=theSiteMessageViewer+'			  <br>';
	theSiteMessageViewer=theSiteMessageViewer+'			  <br>';
	theSiteMessageViewer=theSiteMessageViewer+'            </div>';
	theSiteMessageViewer=theSiteMessageViewer+'            <div id="divFormPopUpStyleMessageBottom" style="position:absolute; bottom:0; left:0; width:100%; vertical-align:top;text-align:center;">';
	theSiteMessageViewer=theSiteMessageViewer+'            </div>';
	theSiteMessageViewer=theSiteMessageViewer+'</div>';
	thecreateMessageViewerDiv(theSiteMessageViewer);
}

function startMove(){
	isMouseDown = true;
	tempX = 0;
	tempY = 0;
}

function stopMove(){
	isMouseDown = false;
	tempX = 0;
	tempY = 0;
}

function show_message(str) {
	SiteMessage_PopUp();
	u=setTimeout("HideMyMessageDiv('divMessagePopUp');",6*1000);
	if (str == 1 || str == 0) t=setTimeout("show_pdf();",5*1000);
	ShowAtPosition('image_offer','divMessagePopUp');
	//displaydownloadmessage();
	//displayfootermessage();
}

function ShowAtPosition(a,z){
	x=getElementPosition(a).top+'px';
	y=getElementPosition(a).left+'px';
	DisplayMyDiv(z,x,y);
}

function show_pdf(){
	//if (thefile) theDisplayPDFViewer(thefile);
	if (thefile) location.href='/microsite/includes/download.php?scr='+thefile+'&cid='+Base64.encode(thecookiename);
}

function ShowFormMessage(input) {
	var g=input.title;
	document.getElementById('Formfieldmessage').innerHTML=(g);
}

function ShowFormConfirmMessage(input) {
	var g=input;
	document.getElementById('Formfieldmessage').innerHTML=(g);
}

function SwitchConfirmValue(input) {
    if (input.value == "Yes") {document.getElementById(input).value = "No Thanks";return;}
    if (input.value == "No Thanks") {document.getElementById(input).value = "Yes";return;}
}

function setmyOptionValue(input) {
	if (document.getElementById(input.id).checked==1) {
		document.getElementById(input.id).value="Yes";
	} else {
		document.getElementById(input.id).value="No";
	}
}

function setmyconfirmOptionValue(str) {
	if (document.getElementById(str.id).checked==1) {
		document.getElementById(str.id).value="Yes";
	} else {
		document.getElementById(str.id).value="No, Thanks";
	}
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++) {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
return returnString;
}

function setCanada(theSel){
	var canada=document.getElementById(theSel);
	removeOptions2(canada);
	canada.options[canada.length-1] = new Option('Select your Province', 'Select your Province');
	canada.options[canada.length] = new Option('Alberta', 'AB');
	canada.options[canada.length] = new Option('British Columbia', 'BC');
	canada.options[canada.length] = new Option('Manitoba', 'MB');
	canada.options[canada.length] = new Option('New Brunswick', 'NB');
	canada.options[canada.length] = new Option('Newfoundland', 'NL');
	canada.options[canada.length] = new Option('Northwest Territories', 'NT');
	canada.options[canada.length] = new Option('Nova Scotia', 'NS');
	canada.options[canada.length] = new Option('Nunavut', 'NU');	
	canada.options[canada.length] = new Option('Ontario', 'ON');		
	canada.options[canada.length] = new Option('Prince Edward Island', 'PE');			
	canada.options[canada.length] = new Option('Quebec', 'QC');		
	canada.options[canada.length] = new Option('Saskatchewan', 'SK');		
	canada.options[canada.length] = new Option('Yukon', 'YT');	
	//canada.options[canada.length] = new Option('Outside of US/Canada', 'intl');		
return;
}

function setIntl(theSel){
	var international=document.getElementById(theSel);
	removeOptions2(international);
	international.options[international.length-1] = new Option('Outside of US/Canada', 'intl');		
return;
}


function setUS(theSel){
	var us=document.getElementById(theSel);
	removeOptions2(us);
	us.options[us.length-1] = new Option('Select your State', 'Select your State');
	us.options[us.length] = new Option('Alabama', 'AL');
	us.options[us.length] = new Option('Alaska', 'AK');
	us.options[us.length] = new Option('Arizona', 'AZ');
	us.options[us.length] = new Option('Arkansas', 'AR');
	us.options[us.length] = new Option('California', 'CA');
	us.options[us.length] = new Option('Colorado', 'CO');
	us.options[us.length] = new Option('Connecticut', 'CT');
	us.options[us.length] = new Option('Delaware', 'DE');
	us.options[us.length] = new Option('District of Columbia', 'DC');
	us.options[us.length] = new Option('Florida', 'FL');
	us.options[us.length] = new Option('Georgia', 'GA');
	us.options[us.length] = new Option('Hawaii', 'HI');
	us.options[us.length] = new Option('Idaho', 'ID');
	us.options[us.length] = new Option('Illinois', 'IL');
	us.options[us.length] = new Option('Indiana', 'IN');
	us.options[us.length] = new Option('Iowa', 'IA');
	us.options[us.length] = new Option('Kansas', 'KS');
	us.options[us.length] = new Option('Kentucky', 'KY');
	us.options[us.length] = new Option('Louisiana', 'LA');
	us.options[us.length] = new Option('Maine', 'ME');
	us.options[us.length] = new Option('Maryland', 'MD');
	us.options[us.length] = new Option('Massachusetts', 'MA');
	us.options[us.length] = new Option('Michigan', 'MI');
	us.options[us.length] = new Option('Minnesota', 'MN');
	us.options[us.length] = new Option('Mississippi', 'MS');
	us.options[us.length] = new Option('Missouri', 'MO');
	us.options[us.length] = new Option('Montana', 'MT');
	us.options[us.length] = new Option('Nebraska', 'NE');
	us.options[us.length] = new Option('Nevada', 'NV');
	us.options[us.length] = new Option('New Hampshire', 'NH');
	us.options[us.length] = new Option('New Jersey', 'NJ');
	us.options[us.length] = new Option('New Mexico', 'NM');
	us.options[us.length] = new Option('New York', 'NY');
	us.options[us.length] = new Option('North Carolina', 'NC');
	us.options[us.length] = new Option('North Dakota', 'ND');
	us.options[us.length] = new Option('Ohio', 'OH');
	us.options[us.length] = new Option('Oklahoma', 'OK');
	us.options[us.length] = new Option('Oregon', 'OR');
	us.options[us.length] = new Option('Pennsylvania', 'PA');
	us.options[us.length] = new Option('Rhode Island', 'RI');
	us.options[us.length] = new Option('South Carolina', 'SC');
	us.options[us.length] = new Option('South Dakota', 'SD');
	us.options[us.length] = new Option('Tennessee', 'TN');
	us.options[us.length] = new Option('Texas', 'TX');
	us.options[us.length] = new Option('Utah', 'UT');
	us.options[us.length] = new Option('Vermont', 'VT');
	us.options[us.length] = new Option('Virginia', 'VA');
	us.options[us.length] = new Option('Washington', 'WA');
	us.options[us.length] = new Option('West Virginia', 'WV');
	us.options[us.length] = new Option('Wisconsin', 'WI');
	us.options[us.length] = new Option('Wyoming', 'WY');
	//us.options[us.length] = new Option('Outside of US/Canada', 'intl');
return;
}

function trim(s){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++) {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
return returnString;
}


function TestEmail(inputID, email_address){
}


function testBrowserSupport(){
	if (window.XMLHttpRequest) {
		varreq = new XMLHttpRequest();
		BrowserSupportMsg = "notIE";
	} 
	if (window.ActiveXObject) {
		varreq = new ActiveXObject("Microsoft.XMLHTTP");
		BrowserSupportMsg = "IE";
	}
	return BrowserSupportMsg;
}

function theStateSelectCheck(str) {
 var x1=document.getElementById(str);
 var stateLength=document.Registration_Form.state.length-1;
 var countryLength=document.Registration_Form.country.length-1;
 //if ((x1.selectedIndex) ==1) {window.alert("Please select a State");document.Registration_Form.state.focus();document.Registration_Form.country.selectedIndex=1;}
 //if ((x1.selectedIndex) ==2) {window.alert("Please select a Candian Province");document.Registration_Form.state.focus();document.Registration_Form.country.selectedIndex=2;} 
 if ((x1.selectedIndex) == 0) {
	 document.Registration_Form.country.selectedIndex=0;
	 document.Registration_Form.country.focus();
	 document.Registration_Form.state.disabled=1;
	 return;
 } 
 if ((x1.selectedIndex) == stateLength) {
	 document.Registration_Form.country.selectedIndex=countryLength;
	 document.Registration_Form.country.focus();
	 document.Registration_Form.state.disabled=1;
	 return;
 } 
//if ((x1.selectedIndex) <=59) {document.Registration_Form.country.selectedIndex=1;} 
 //if ((x1.selectedIndex) >=60) {document.Registration_Form.country.selectedIndex=2;} 
// if ((x1.selectedIndex) ==67) {window.alert("Please select a Country");document.Registration_Form.country.selectedIndex=0;}
}

function theStateSelectChange(str) {
 var x1=document.getElementById(str);
 var stateLength=document.Registration_Form.state.length-1;
 if ((x1.selectedIndex) ==1) {
	 document.getElementById('state-req').title='Select your State';
	 document.Registration_Form.state.disabled=0;
	 setUS('state-req');
	 document.Registration_Form.state.selectedIndex=0;
	 return;
 }
 if ((x1.selectedIndex) ==2) {
	 document.getElementById('state-req').title='Select your Province';
	 document.Registration_Form.state.disabled=0;
	 setCanada('state-req');
	 document.Registration_Form.state.selectedIndex=0;
	 return;
 } else {
	 setIntl('state-req');
	 document.Registration_Form.state.selectedIndex=0;
	 document.Registration_Form.state.disabled=1;
	 return;
 }
//else {document.Registration_Form.state.selectedIndex=0;document.Registration_Form.state.disabled=1;return;}
//else {document.Registration_Form.thestate.disabled=1;document.Registration_Form.thestate.selectedIndex=67;return;}
}

function thecreateFormDiv(str) {
	if (thedivSiteFormDivCreated !='true') {
	thedivSiteFormDivCreated='true';	
	divTag = document.createElement("div");
	divTag.id = "theform";
	divTag.setAttribute("align","center");
	divTag.style.margin = "0px auto";
	//window.alert("innerhtml");  
	//divTag.innerHTML = "my my";
	divTag.innerHTML = str;
	//window.alert("appendchild");
	document.body.appendChild(divTag);
	}
return;	
}

function thecreateMessageViewerDiv(str) {
	if (thedivSiteMessageCreated !='true') {
	thedivSiteMessageCreated='true';	
	divTag = document.createElement("div");
	divTag.id = "MSGdiv1";
	divTag.setAttribute("align","center");
	divTag.style.margin = "0px auto";
	divTag.innerHTML = str;
	document.body.appendChild(divTag);
	}
}

function ValidateRegistrationForm_Sjodin(form_id) {
	h=document.getElementById('formsubmissionid-req').value;
	l=form_id.elements.length;
	fnamelength=0;
	lnamelength=0;
	companylength=0;
	titlelength=0;
	for(i=0; i<l; i++) {
		isitvalid=true;
		if ((form_id.elements[i].type) != "hidden") {
			var k = form_id.elements[i].name.toLowerCase();
			var x = form_id.elements[i].value.toLowerCase();
			var y = form_id.elements[i].id.toLowerCase();
			var z = form_id.elements[i].title.toLowerCase();
			var c = form_id.elements[i].type.toLowerCase();
		
			if ((k) == "firstname") {var m = form_id.elements[i].value.toLowerCase();}
			if ((k) == "lastname") {var n = form_id.elements[i].value.toLowerCase();}
			if ((k) == "company") {var a = form_id.elements[i].value.toLowerCase();}
			if ((k) == "title") {var b = form_id.elements[i].value.toLowerCase();}

			if ((m) && (n)){

				if ((m) == (n)) {
					window.alert("The value entered for First Name is the same as the value entered for the Last Name, please revise");
					form_id.elements[i].focus();
					isitvalid = false;
					return isitvalid;
				}

				fnamelength=m.length;
				lnamelength=n.length;
		
				if ((fnamelength < 2) && (lnamelength < 2)){
					window.alert("Please enter your complete last name");
					form_id.elements[i].focus();
					isitvalid = false;
					return isitvalid;
				}
			}

			if ((a)){
				companylength=a.length;
				if (companylength){
					if ((companylength < 2)){
						window.alert("Please enter your complete company name");
						form_id.elements[i].focus();
						isitvalid = false;
						return isitvalid;
					}
				}
			}
		
		 	if ((b)){
				titlelength=b.length;
				if (titlelength){
					if ( (titlelength < 2) ){
						window.alert("Please enter your full title");
						form_id.elements[i].focus();
						isitvalid = false;
						return isitvalid;
					}
				}
			}
		
			if ((y) == 'state' || (y) == 'thestate') form_id.elements[i].disabled=0;

			if ((y) != (k)) {
		
				if ((x) == (z) || (x) == '') {
		   			window.alert('Please '+ (ProperCase(z)));
					form_id.elements[i].focus();
					isitvalid = false;
					return isitvalid;
				}
				
				if ((c) == "select-multiple") {
					var themultiselectedArray = new Array();
					var selObj = document.getElementById(y);
					var selseed;
					var selcount = 0;
					for (selseed=0; selseed<selObj.options.length; selseed++) {
					  	if (selObj.options[selseed].selected) {
	      					themultiselectedArray[selcount] = selObj.options[selseed].value;
							selObj.options[selseed].selected = false;
	      					selcount++;
	    				}
	  				}
					var themultiselectedvalueid=y.replace("-sel", "");
					document.getElementById((themultiselectedvalueid)).disabled=0;
					document.getElementById((themultiselectedvalueid)).value = themultiselectedArray;
					x=document.getElementById((themultiselectedvalueid)).value;
				}
								
			} else {
				
				if ((x) == (z)) {
						//var yy = x.indexOf("select");
						if ( ((c) == "select-one") || ((c) == "select-multiple")){
				 		//if ((yy) != -1) {
							cc=document.getElementById(k);
							removeOptions2(cc);
						} else {
							form_id.elements[i].value="";
						}
					//}
				}
				
				if ((c) == "select-multiple") {
					var themultiselectedArray = new Array();
					var selObj = document.getElementById(y);
					var selseed;
					var selcount = 0;
					for (selseed=0; ((selseed) < (selObj.options.length)); selseed++) {
					  	if (selObj.options[selseed].selected) {
	      					themultiselectedArray[selcount] = selObj.options[selseed].value;
							selObj.options[selseed].selected = false;
	      					selcount++;
	    				}
	  				}
					var themultiselectedvalueid=y.replace("-sel", "");
					document.getElementById((themultiselectedvalueid)).disabled=0;
					document.getElementById((themultiselectedvalueid)).value = themultiselectedArray;
					x=document.getElementById((themultiselectedvalueid)).value;
				}
				
			}
		
			if ( ((k) == "phone") || ((k) == "telephone") ) {
		   		if (checkInternationalPhone(form_id.elements[i].value)==false){
					window.alert("Please Enter a Valid Phone Number:\n\nTelephone number requires a minimum of 10 digits.\nUse x (lower case) to designate an extension.\n\nExample: (555) 555-1212 x123\n\n")
					//form_id.elements[i].value=""
					form_id.elements[i].focus();
					isitvalid = false;					
					return isitvalid;
				}
		   }
			if ((k) == "email") checkEmail(x);
			if (isitvalid == false) {alert("The email address you entered appears to be invalid.  Please verify.");form_id.elements[i].focus();return isitvalid;}
			if ( ( (c) == "checkbox") &&  ( ((k) != "confirm" ) || ((k) != "confirm-req" ) )) {
				//theconfirmvalue=additionalinfo_check(x);
				//form_id.elements[i].checked=true;				
				//form_id.elements[i].value=theconfirmvalue;
			}
			if (((k) != "confirm" ) || ((c) != "select-multiple" ) || ((k) != "confirm-req" )) {
				g=ProperCase(x);
				t=ProperCase(z);
				if ( (g) != (t) ){
					var mySplitResult = t.split(" ");
					r=mySplitResult.length;
					for(s=0; ((s)<(r)); s++) {
						var a1 = mySplitResult[s];
						var b1 = g.indexOf(a1);
						var a2=a1.toUpperCase();
						if ((b1) != -1) {window.alert("The value "+a2+" is not permitted in this field. Please Revise. ERROR NO.#7001-1140-22403:FIELD Violation");form_id.elements[i].focus();isitvalid=false;return isitvalid;}
					}
				}
			}
			if ( ((k) == "confirm") || ((k) == "confirm-req")) {
				HideMyDiv('divFormPopUp');
				theconfirmvalue=moreinfo_check(x);
				form_id.elements[i].checked=true;
				form_id.elements[i].value=theconfirmvalue;
			}
		}
	}

	if (isitvalid == true) {document.getElementById('formsubmissionid-req').disabled=0;document.getElementById('formsubmissionid-req').value = document.getElementById('IP').value;}
	x=document.getElementById('formsubmissionid-req').value;
	if ((x) == (h)) isitvalid=false;
	return isitvalid;
}

/**
*
*  Base64 encode / decode
*  http://www.webtoolkit.info/
*
**/
var Base64 = {
	// private property
	_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
	// public method for encoding
	encode : function (input) {
		var output = "";
		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
		var i = 0;
		input = Base64._utf8_encode(input);
		while (i < input.length) {
			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);
			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;
 
			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else if (isNaN(chr3)) {
				enc4 = 64;
			}
 
			output = output +
			this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
			this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
 
		}
 
		return output;
	},
 
	// public method for decoding
	decode : function (input) {
		var output = "";
		var chr1, chr2, chr3;
		var enc1, enc2, enc3, enc4;
		var i = 0;
 
		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
 
		while (i < input.length) {
 
			enc1 = this._keyStr.indexOf(input.charAt(i++));
			enc2 = this._keyStr.indexOf(input.charAt(i++));
			enc3 = this._keyStr.indexOf(input.charAt(i++));
			enc4 = this._keyStr.indexOf(input.charAt(i++));
 
			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;
 
			output = output + String.fromCharCode(chr1);
 
			if (enc3 != 64) {
				output = output + String.fromCharCode(chr2);
			}
			if (enc4 != 64) {
				output = output + String.fromCharCode(chr3);
			}
 
		}
 
		output = Base64._utf8_decode(output);
 
		return output;
 
	},
 
	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	},
 
	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
 
		while ( i < utftext.length ) {
 
			c = utftext.charCodeAt(i);
 
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
 
		}
 
		return string;
	}
 
}

-->
