<!--

// NAMES THE MAIN WINDOW SO IFRAME LINKS CAN CALL THIS WINDOW
name = 'mymainwindow';

// MISC FUNCTIONS
function submitInquiry() {
	var z = document.inquiry;

	if (z.name.value == "") { 
		alert('Please enter your name.'); 
		z.name.focus(); 
		return false; 
	}

	if (z.phone.value == "") { 
		alert('Please enter your phone.'); 
		z.phone.focus(); 
		return false; 
	}
	
	if (!z.email.value.match(/^\S+@\S+\.\S+$/)) {
		alert('Please enter a valid email address.');
		z.email.select();
		z.email.focus();
		return false;
	}

	z.submit();
}

function submitEventReminder() {
	var f = document.remind_me;

	if (f.name.value == "") { 
		alert('Please enter your name.'); 
		f.name.focus(); 
		return false; 
	}
	
	if (!f.email.value.match(/^\S+@\S+\.\S+$/)) {
		alert('Please enter a valid email address.');
		f.email.select();
		f.email.focus();
		return false;
	}

	f.submit();
}


function submitArtSubmission() {
	var a = document.art_submission;

	if (a.FirstName.value == "") { 
		alert('Please enter your first name.'); 
		a.FirstName.focus(); 
		return false; 
	}

	if (a.LastName.value == "") { 
		alert('Please enter your last name.'); 
		a.LastName.focus(); 
		return false; 
	}

	if (!a.Email.value.match(/^\S+@\S+\.\S+$/)) {
		alert('Please enter a valid email address.');
		a.Email.select();
		a.Email.focus();
		return false;
	}

	if (a.userfile.value == "") { 
		alert('Please upload your file.'); 
		a.userfile.focus(); 
		return false; 
	}
	
	alert('Please wait while we upload your file - this may take anywhere from a few seconds to a couple of minutes depending on your connection speed!  Thank you.'); 
	a.submit();
	
}



function openWindow(filename,windowname,properties) {
	mywindow = window.open(filename,windowname,properties);
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i = 0; i < changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;

function preloadImages() { if (document.images) { preloadFlag = true; } }

function goto_URL(object) {
	if(object.options[object.selectedIndex].value) {
		window.location.href = "http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?" + object.options[object.selectedIndex].value;
	} else { }
}



function automatic2() {
	thenumber = document.theform_webcams.webcam_dropdown.selectedIndex;
	changeto = document.theform_webcams.webcam_dropdown.options[thenumber].value;

	if (changeto == "gonowhere") {
		// do nothing
	} else if (changeto == "url_1") {
		openWindow('http://www.flagstaffchamber.com/link_track.php?id=14&url=http://www.flagstaffchamber.com/webcam_1.html','one','width=270,height=240,scrollbars=0,status=0,resizeable=0,menubar=0,toolbar=0,locationbar=0,location=0,personalbar=0');
	} else if (changeto == "url_2") {
		openWindow('http://www.flagstaffchamber.com/link_track.php?id=15&url=http://www.flagstaffchamber.com/webcam_2.html','two','width=293,height=275,scrollbars=0,status=0,resizeable=0,menubar=0,toolbar=0,locationbar=0,location=0,personalbar=0');
	} else if (changeto == "url_3") {
		openWindow('http://www.flagstaffchamber.com/link_track.php?id=16&url=http://www.flagstaffchamber.com/webcam_3.html','three','width=266,height=290,scrollbars=0,status=0,resizeable=0,menubar=0,toolbar=0,locationbar=0,location=0,personalbar=0');
	} else if (changeto == "url_4") {
		openWindow('http://www.flagstaffchamber.com/link_track.php?id=17&url=http://www.flagstaffchamber.com/webcam_4.html','four','width=635,height=475,scrollbars=0,status=0,resizeable=0,menubar=0,toolbar=0,locationbar=0,location=0,personalbar=0');
	} else {
		window.open(changeto,target="_blank");
	}

}


function automatic3() {
	thenumber = document.theform_moving.moving_dropdown.selectedIndex;
	changeto = document.theform_moving.moving_dropdown.options[thenumber].value;

	if (changeto == "gonowhere") {
		// do nothing
	} else if (changeto == "Apartments") {
		changeto = 'apartments.php';
		window.open(changeto,target="_self");
	} else if (changeto == "Banks") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=352&Title=Financial+Related&AdKeyword=Financial+Related';
		window.open(changeto,target="_self");
	} else if (changeto == "Child_Care") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=196&Title=Child+Care+-+Day+Care++and++Pre-School&AdKeyword=Child+Care+-+Day+Care++and++Pre-School';
		window.open(changeto,target="_self");
	} else if (changeto == "Churches") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=90&Title=Churches&AdKeyword=Churches';
		window.open(changeto,target="_self");
	} else if (changeto == "Country_Clubs") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=98&Title=Country+Clubs&AdKeyword=Country+Clubs';
		window.open(changeto,target="_self");
	} else if (changeto == "Custom_Homes") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?SubCategoryID=145&CategoryID=358&Title=Custom+Homes&AdKeyword=Custom+Homes';
		window.open(changeto,target="_self");
	} else if (changeto == "Disabled_Services") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=223&Title=Disabled+Services&AdKeyword=Disabled+Services';
		window.open(changeto,target="_self");
	} else if (changeto == "Employment_Services") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=350&Title=Employment&AdKeyword=Employment';
		window.open(changeto,target="_self");
	} else if (changeto == "Health_Care") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=355&Title=Health++and++Medical+Related&AdKeyword=Health++and++Medical+Related';
		window.open(changeto,target="_self");
	} else if (changeto == "Home_Appraisals") {
		changeto = 'home_appraisals.php';
		window.open(changeto,target="_self");
	} else if (changeto == "Home_Builders") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?SubCategoryID=144&CategoryID=358&Title=Builders&AdKeyword=Builders';
		window.open(changeto,target="_self");
	} else if (changeto == "Home_Improvement") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?SubCategoryID=148&CategoryID=358&Title=Improvement+%26+Maintenance&AdKeyword=Improvement+%26+Maintenance';
		window.open(changeto,target="_self");
	} else if (changeto == "Hospitals") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?SubCategoryID=118&CategoryID=355&Title=Hospitals&AdKeyword=Hospitals';
		window.open(changeto,target="_self");
	} else if (changeto == "Investors_Brokers") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?SubCategoryID=105&CategoryID=352&Title=Investments+%26+Brokers&AdKeyword=Investments+%26+Brokers';
		window.open(changeto,target="_self");
	} else if (changeto == "Manufactured_Housing") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?SubCategoryID=152&CategoryID=358&Title=Manufactured+Housing&AdKeyword=Manufactured+Housing';
		window.open(changeto,target="_self");
	} else if (changeto == "Mortgages_Loans") {
		changeto = 'mortgages.php';
		window.open(changeto,target="_self");
	} else if (changeto == "Moving_Companies") {
		changeto = 'moving.php';
		window.open(changeto,target="_self");
	} else if (changeto == "Parenting_Resources") {
			changeto = 'http://flagstaffazcoc.weblinkconnect.com/cwt/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=385&Title=Parent+Resources&AdKeyword=Parent+Resources';
			window.open(changeto,target="_self");
	} else if (changeto == "Nurseries") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=219&Title=Nurseries%2c+Plants++and++Garden+Supplies&AdKeyword=Nurseries%2c+Plants++and++Garden+Supplies';
		window.open(changeto,target="_self");
	} else if (changeto == "Housing_Realtors") {
		changeto = 'realtors.php';
		window.open(changeto,target="_self");
	} else if (changeto == "Retirement_Facilities") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?SubCategoryID=135&CategoryID=355&Title=Retirement+%26+Life+Care+Facilities&AdKeyword=Retirement+%26+Life+Care+Facilities';
		window.open(changeto,target="_self");
	} else if (changeto == "Schools") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=349&Title=Education&AdKeyword=Education';
		window.open(changeto,target="_self");
	} else if (changeto == "Title_Companies") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=121&Title=Title+Companies&AdKeyword=Title+Companies';
		window.open(changeto,target="_self");
	} else if (changeto == "Utilities") {
		changeto = 'http://flagstaffazcoc.weblinkconnect.com/CWT/EXTERNAL/WCPAGES/WCDIRECTORY/Directory.aspx?CategoryID=39&Title=Utilities&AdKeyword=Utilities';
		window.open(changeto,target="_self");
	} else {
		changeto = 'index.php';
		window.open(changeto,target="_self");
	}

}


function automatic4() {
	thenumber = document.theform_wedding.selectName.selectedIndex;
	changeto = document.theform_wedding.selectName.options[thenumber].value;
	
	if (changeto == "gonowhere") {
		// do nothing
	} else {
		window.open(changeto,target="_self");
	}
}

function backtonorm() {
	var uagent = navigator.userAgent;
	if(uagent.indexOf('Mac',0) > -1) { window.scroll(0,0); }
}

// -->