
function swapDiv(id) {
	document.images["tab"+prevId].src = "images/tab_"+ arrTabs[prevId] +"_off.gif";
	document.getElementById("div"+prevId).style.display = "none";
	document.images["tab"+id].src = "images/tab_"+ arrTabs[id] +"_on.gif";
	document.getElementById("div"+id).style.display = "inline";	
	prevId = id;
}
function swapContactDiv(id) {
	document.images["tab"+prevId].src = "images/tab_"+ arrContactTabs[prevId] +"_off.gif";
	document.getElementById("div"+prevId).style.display = "none";
	document.images["tab"+id].src = "images/tab_"+ arrContactTabs[id] +"_on.gif";
	document.getElementById("div"+id).style.display = "inline";	
	prevId = id;
}
function jumpPage(newLoc) {
	newPage = newLoc.options[newLoc.selectedIndex].value
		if (newPage != "") {
			window.location = newPage
		}
}	

function openWin(URL) {
newWindow=window.open(URL,"window","width=400,height=310,status=no,scrollbars=auto,resizable=no,location=0,menubar=0,toolbar=no");
newWindow.focus();
}

function showDiv(id){
	document.getElementById(id).style.display = "block";
}

function hideDiv(id){
	document.getElementById(id).style.display = "none";
}


function page(){
  if (document.Links.Link_select.options[document.Links.Link_select.selectedIndex].value != "none") { 
	URL = document.Links.Link_select.options[document.Links.Link_select.selectedIndex].value;        
	newWindow=window.open(URL,"window","width=600,height=375,status=yes,scrollbars=yes,resizable=yes,location=1,menubar=1,toolbar=yes");
	newWindow.focus();
   }           
}

function roll_on(obj)
{
	obj.className = "divOn";
}

function roll_off(obj)
{
	if(obj.innerHTML.indexOf("subscribe.aspx\"") == -1)
		obj.className = "divOff";	
	else
		obj.className = "subscribeDiv";
}

function roll_on_div(id)
{
	var obj = document.getElementById(id);
	obj.className = "floatOn";
}

function roll_off_div(id)
{
	var obj = document.getElementById(id);
	obj.className = "floatingDiv";
}

function readParam(p_name)
{
	var query = window.location.search.substring(1);
	var params = query.split('&');	
	var found = "";
	for (var i=0; i<params.length; i++) {
		var key_val = params[i].split('=');
		if(key_val[0] == p_name){
			found = key_val[1];
			break;
		}
	}
	return found;
}

function openImage(path, width, height)
{
	var left = (screen.width/2) - (width/2);
	var top  = (screen.height/2) - (height/2);
	var name = path.split(".")[0].split("/")[1];
	
	window.open("../logos.aspx?img="+path+"&width="+width+"&height="+height, name, "height="+(height+50)+",width="+(width+50)+",left="+left+",top="+top+",resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars=yes");
}

function searchValid(form_Name)
{
	var f_obj = document.getElementById(form_Name);
	var regex1 = "[^\\w\\s\\[\\^\\$\\.\\|\\?\\*\\+\\(\\)!@#$%&\\{\\}\\]:\\;/`~\\-\\=,]";
	
	var regex_obj = new RegExp(regex1, "i");
	if(regex_obj.test(f_obj.query.value))
	{
		alert("Please do not use and of the following characters:\n\n< > ' \"");
		return false;
	}
	
}

function chkRefer () {
		var ref = window.document.referrer;
			if (ref == "") {
				return;
			}
			else if (ref.toLowerCase().indexOf(".google.c")>0) {
				setPicCode("EF00444");
				return;
			}
			else if (ref.toLowerCase().indexOf(".yahoo.c")>0) {
				setPicCode("EF00445");
				return;
			} 
			else if (ref.toLowerCase().indexOf(".msn.c")>0) {
				setPicCode("EF00446");
				return;
			}
			else if(ref.toLowerCase().indexOf(".adpemploymentreport.c")==-1){
				setPicCode("EF00447");
				return;
			}
}

function setPicCode (pic) {
	 	
		setCookie("ADPNER=PICCode=" + pic +"&Overwrite=N",20, "ADPEmploymentReport.com");			
}	

		function setCookie(cookie,nDays,domain) {
		 var today = new Date();
		 var expire = new Date();
		 if (nDays==null || nDays==0) nDays=1;
		 expire.setTime(today.getTime() + 3600000*24*nDays);
		 document.cookie = cookie
						 + ";expires="+expire.toGMTString()
						 + ";domain="+domain;
}

