<!--
//NAV SCRIPTS
var imagePath = "/media/images/common/";


function swapNav(elm){
	var obj = document.getElementById(elm);
	obj.src = imagePath+elm+"_over.jpg";
}

function swapNavBack(elm){
	var obj = document.getElementById(elm);
	obj.src = imagePath+elm+".jpg";
}

function setNav(elm){
	var obj = document.getElementById("nav_"+elm);
	obj.src = imagePath+"nav_"+elm+"_over.jpg";
}

//FORM VERIFICATION
function formCheck(formobj){
	var fieldRequired = Array("firstname","lastname","email");
	var fieldDescription = Array("First Name","Last Name","E-mail");
	var alertMsg = "Please complete the following fields:\n";
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 | obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}
	
	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}




	//check for cookie for downloads
	function downloadCheck(file){
		if(getCookie('DOWNLOAD_REGISTER') == null){
			downloadPopup(file);
		}else{
			document.location.replace(file);
		}
	}
	
	var expdate = new Date ();
	expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000*365));
	
	function sendToFile(file){
		if(getCookie('GMRDownloads') == null)
			setCookie('GMRDownloads','YES',expdate);
		window.opener.location.replace(file);
		window.close();
	}
	
	//set cookie
	function setCookie(name, value,expires) {
		var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") ;
		document.cookie = curCookie;
	}
	
	//get cookie
	function getCookie(name) {
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
	
		if (begin == -1) {
			begin = dc.indexOf(prefix);
			if (begin != 0)
				return null;
		} else
			begin += 2;
	
		var end = document.cookie.indexOf(";", begin);
		
		if (end == -1)
			end = dc.length;
	
		return unescape(dc.substring(begin + prefix.length, end));
	}
	

function formPopup(file) {
	window.open("/includes/download_popup.php", "video","width=395,height=380,scrollbars=no,menubar=no,resizable=no");
}
function downloadPopup(file) {
	window.open("/pages/download_popup.jsf?file="+file, "_downloads","width=395,height=380,scrollbars=no,menubar=no,resizable=yes");
}

// -->		
