brandString = '';frameString = '';promoFrame = new Object();promoForm = new Object();brandField = new Object();adInfo = new array();function togglePromotional(brandID,frameID,clearID){				adInfo = brandID.split(',');		//alert(adInfo[0] + ' : ' + adInfo[1]);		thePromo = new Object();	thePromo = document.getElementById('promo');		winXY = new Array();	winXY = alertSize();		if (frameID == '#getvariable#'){		frameID = initstring;		scriptImage = new Image();		scriptImage.src = 'http://www.procurement.travel/promos/wyndham-events.php?brandID=' + adInfo[0] + '&adSize=' + adInfo[1] + '';	}			frameString = 'eframe' + frameID;			promoFrame = document.getElementById(frameString);					if (thePromo.style.visibility != 'visible'){		//alert(brandID + ', ' + frameID + ', ' + clearID);		brandField = promoFrame.contentWindow.document.forms[0].brandCode;					brandField.value = brandID;			brandString = brandID;		thePromo.style.zindex = 109;				thePromo.style.left = '0px';		wiggleRoom = (winXY[1] - thePromo.scrollHeight);					if (wiggleRoom < 190){		wiggleRoom = 190		}		if (window.innerHeight){scrolled = window.pageYOffset}else if (document.documentElement && document.documentElement.scrollTop){scrolled = document.documentElement.scrollTop}else if (document.body){scrolled = document.body.scrollTop}						thePromo.style.top =   ((wiggleRoom / 2) + scrolled) + 'px';				thePromo.style.visibility = 'visible';						//alert(brandField.value);			}else{			if (clearID){				thePromo.style.left = '-600px';		thePromo.style.top = '-1000px';		thePromo.style.visibility = 'hidden';		thePromo.style.zindex = -1;		frameDoc = new Object();		frameDoc = promoFrame.contentWindow.document;			frameDoc.location.href = 'http://www.procurement.travel/promos/wyndhamform.php?init=' + frameID;		}	}		//document.getElementById('overlay').style.visibility = 'visible';	}function validateForm2(theForm,formIndex){	if (!formIndex){	formIndex = 0;	}			goodForm = 1;							if (goodForm){		if(validateEmail2(theForm.email.value)){		goodForm = 1;		}else{		goodForm = 0;		}	}				if (goodForm){		if (checkSubForm(theForm)){		goodForm = 1;		}else{		goodForm = 0;		}	}			if (goodForm){	return true;	}else{	return false;	}}	function validateEmail(address,whomail){	if (address.length > 60){		if (!whomail){		alert("The sender's email address contains too many characters. Please choose a sending email address with fewer characters.  Thank You.");		}else{		alert("One of the email addresses you are sending to contains too many characters. Please choose a recipient email address with fewer characters.  Thank You.");		}		return false;	}pattern = /^[\._'\-\w]+@[_'\-\w]+\.([\._'\-\w]+\.)?([a-z]{2,6})$/i;result = address.match(pattern);	if (result){		return true;	}else{			if (!whomail){		alert("The sender's email address appears to be INVALID. Please check your entry for errors and try again.");		}else{		alert("One or more of the recipient email addresses appears to be INVALID. Please check your entries for errors and try again.");			}			return false;		}}function validateEmail2(address){		if (address.length > 60){	alert("The email address you entered contains too many characters. Please choose an email address with fewer characters.  Thank You.");	return false;	}	pattern = /^[\._'\-\w]+@[_'\-\w]+\.([\._'\-\w]+\.)?([a-z]{2,6})$/i;result = address.match(pattern);	if (result){			return true;			}else{		alert("The email address you entered is NOT valid, please check your entry for errors and try again.");	return false;		}}		function getRadioValue(theRadioField) {			for (index=0; index < theRadioField.length; index++) {				if (theRadioField[index].checked) {					return theRadioField[index].value;					break;				}			}		}function checkSubForm(theFormObj){fnamevalue = new Object();fnamevalue = theFormObj.elements["fname"].value;lnamevalue = new Object();lnamevalue = theFormObj.elements["lname"].value;companyname = new Object();companyname = theFormObj.elements["cname"].value;titlevalue = new Object();titlevalue = theFormObj.elements["title"].value;phonevalue = new Object();phonevalue = theFormObj.elements["phone"].value;monthly_room_nights_value = new Object();monthly_room_nights_value = theFormObj.elements["monthly_room_nights"].value;number_travelers_value = new Object();number_travelers_value = theFormObj.elements["number_travelers"].value;uses_travel_agency_value = new Object();uses_travel_agency_value = getRadioValue(theFormObj.uses_travel_agency); travel_agency_value = new Object();travel_agency_value = theFormObj.elements["travel_agency"].value;//brandvalue = new Object();//brandvalue = thisForm.elements["brandCode"].value;if (!fnamevalue){alert("Please provide your first name.");return false;}if (!lnamevalue){alert("Please provide your last name.");return false;}if (!companyname){alert("Please provide the name of your company.");return false;}if (!titlevalue){alert("Please provide your title.");return false;}if (!phonevalue){alert("Please enter your phone number.");return false;}if (!monthly_room_nights_value){alert("Please enter the approximate number of hotel room nights used per month.");return false;}pattern = /^[0-9]+$/i;result = monthly_room_nights_value.match(pattern);if (!result){alert("The value you entered for monthly room nights must be a number.  Please use only digits for this field.  Thank you.");return false;}if (!number_travelers_value){alert("Please enter the number of corporate travelers in your organization.");return false;}pattern = /^[0-9]+$/i;result = number_travelers_value.match(pattern);if (!result){alert("The value you entered for the number of travelers must be a number.  Please use only digits for this field.  Thank you.");return false;}if (!uses_travel_agency_value){	alert("Please indicate whether or not you use a travel agency.");	return false;	}else{	if (uses_travel_agency_value == '1'){			if (!travel_agency_value){		alert("Please enter the name of the travel agency you use.");		return false;		}				pattern = /^['\-a-zA-Z0-9\s]+$/;				result = travel_agency_value.match(pattern);				if (!result){				alert("The travel agency name you entered does not appear to be valid. Please check your entry and try again.  Thank you.");		return false;				}				if (travel_agency_value.length < 2){		alert("The travel agency name you entered appears to be too short. Please check your entry and try again.  Thank you.");		return false;				}			}}return true;}function toggleDiv(divID, radioValue){theDivObj = new Object();theDivObj = promoFrame.contentWindow.document.getElementById(divID);currentDivState = theDivObj.style.display;theDivObj.style.display = radioValue ? 'block' : 'none';}