/**
 * navigation rollovers for the primary layout
 */
function navRollover(item){
	if(item && item != null){
		//background image by class name, see inc/common.styles.css
		document.getElementById("nav").className = "navRo_" + item;
	
	} else {
		// set it back to no background image
		document.getElementById("nav").className = "navRo";
	}
}

/**
 * submit form when a checkbox is clicked
 */
function getResults(){
	document.filterForm.submit();
}

// For use within normal web clients 
var isiPad = navigator.userAgent.match(/iPad/i) != null;

// For use within iPad developer UIWebView
// Thanks to Andrew Hedges!
var ua = navigator.userAgent;
var isiPad = /iPad/i.test(ua) || /iPhone OS 3_1_2/i.test(ua) || /iPhone OS 3_2_2/i.test(ua);

/**
 * set a cookie if user doesn't have Required Flash Plugin
 */
if(pluginlist.indexOf("Flash") == -1){
	document.cookie = createCookie("hasFlashPlugin", "false", 30);
} else {
	document.cookie = createCookie("hasFlashPlugin", "true", 30);
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function submitAndContinueTo(nextCategory){
	document.getElementById("nextCategory").value = nextCategory;
	if(document.getElementById("updateRfpForm")) document.getElementById("updateRfpForm").submit();
	else document.forms["updateRfpForm"].submit();
}

/*
 * submits venue form and skips the "proceed to whatever" step
 * goes instead to the dest location
 */
function submitVenueForm(dest){
	document.getElementById("returnPage").value = dest;
	document.forms["updateRfpForm"].submit();
}
