function execBodyParams(){
	h = document.body.clientHeight;
	w = document.body.clientWidth;
	//document.getElementById("tbl_Main").style.height = h-180;
	//alert(h);
}
function screenTest(){
	w = screen.width;
	h = screen.height;
	
	if (w < 1024){
		alert("Your screen resolution of "+w+" x "+h+" is too low to view this site. Please increase your resolution and try again.");
		document.location = "invalid.htm";
	}
//START



//CS1.1

var exclude=1;
var agt=navigator.userAgent.toLowerCase();
var win=0;var mac=0;var lin=1;
if(agt.indexOf('win')!=-1){win=1;lin=0;}
if(agt.indexOf('mac')!=-1){mac=1;lin=0;}
var lnx=0;if(lin){lnx=1;}
var ice=0;
var ie=0;var ie4=0;var ie5=0;var ie6=0;var com=0;var dcm;
var op5=0;var op6=0;var op7=0;
var ns4=0;var ns6=0;var ns7=0;var mz7=0;var kde=0;var saf=0;
if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){
	var thisKDE=agt;
	var splitKDE=thisKDE.split("konqueror/");
	var aKDE=splitKDE[1].split("; ");
	var KDEn=parseFloat(aKDE[0]);
	if(KDEn>=2.2){
		kde=1;
		ns6=1;
		exclude=0;
		}
	}
else if(agt.indexOf('webtv')!=-1){exclude=1;}
else if(typeof window.opera!="undefined"){
	exclude=0;
	if(/opera[\/ ][5]/.test(agt)){op5=1;}
	if(/opera[\/ ][6]/.test(agt)){op6=1;}
	if(/opera[\/ ][7-9]/.test(agt)){op7=1;}
	}
else if(typeof document.all!="undefined"&&!kde){
	exclude=0;
	ie=1;
	if(typeof document.getElementById!="undefined"){
		ie5=1;
		if(agt.indexOf("msie 7")!=-1){
			ie7=1;
			dcm=document.compatMode;
			if(dcm!="BackCompat"){com=1;}
			}
		}
	else{ie4=1;}
	}
else if(typeof document.getElementById!="undefined"){
	exclude=0;
	if(agt.indexOf("netscape/6")!=-1||agt.indexOf("netscape6")!=-1){ns6=1;}
	else if(agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1){ns6=1;ns7=1;}
	else if(agt.indexOf("gecko")!=-1){ns6=1;mz7=1;}
	if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined" && typeof document.all=="undefined" && typeof navigator.taintEnabled=="undefined")){mz7=0;ns6=1;saf=1;}
	}
else if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)){
	exclude=0;
	ns4=1;
	if(typeof navigator.mimeTypes['*']=="undefined"){
		exclude=1;
		ns4=0;
		}
	}
if(agt.indexOf('escape')!=-1){exclude=1;ns4=0;}
if(typeof navigator.__ice_version!="undefined"){exclude=1;ie4=0;}

//if (ie == 1 && ie7 !== 1){
	
	//alert("Please upgrade your browser to Internet Explorer 7 before proceeding.");
		//document.location = "invalid.htm";
	
//}


// END
}

function usrSetHeader(key){
	headers = new Array( )
	headers["pinfo"] = "Personal Info"
	headers["finfo"] = "FBC Account Info"
	headers["frm_po"] = "Purchase Order"
	headers["ChangePass"] = "Change Password"
	headers["frm_ph"] = "Purchase History"
	headers["invarch"] = "Archived Invoices"
	if(headers[key]){
		parent.window.document.getElementById('usrIHeader').innerHTML = headers[key]
	}
}

function bookAddSvc(){	
	var aSvc = document.getElementById("atrts");
	var sSvc = document.getElementById("strts");
	
	if(aSvc.selectedIndex < 0){
		alert('Please select a service to add.');
	} else {
	
	var addedSvc = document.createElement("option");
	
	var oldSvcText = aSvc.options[aSvc.selectedIndex].text;
	var oldSvcVal = aSvc.options[aSvc.selectedIndex].value;
	
	try {
		aSvc.options.remove(aSvc.selectedIndex);
	} catch(e) {
	 try {
		 aSvc.options[aSvc.selectedIndex] = null;
	 } catch (e) {
		 alert('Unable to add service!');
	 }
	}
	
	addedSvc.text = oldSvcText;
	addedSvc.value = oldSvcVal;
	sSvc.options.add(addedSvc);
	}
}
function bookRemSvc(){
	var sSvc = document.getElementById("atrts");
	var aSvc = document.getElementById("strts");
	
	if(aSvc.selectedIndex < 0){
		alert('Please select an added service to remove.');
	} else {
	
	var addedSvc = document.createElement("option");
	
	var oldSvcText = aSvc.options[aSvc.selectedIndex].text;
	var oldSvcVal = aSvc.options[aSvc.selectedIndex].value;
	
	try {
		aSvc.options.remove(aSvc.selectedIndex);
	} catch(e) {
	 try {
		 aSvc.options[aSvc.selectedIndex] = null;
	 } catch (e) {
		 alert('Unable to add service!');
	 }
	}
	
	addedSvc.text = oldSvcText;
	addedSvc.value = oldSvcVal;
	sSvc.options.add(addedSvc);
	}
}
function bookShowSvc(){
	var aSvc = document.getElementById("atrts");
	
	if(aSvc.selectedIndex < 0){
		alert('Please select a service from the list.');
	} else {
	
	var ItemID = aSvc.options[aSvc.selectedIndex].value;
	window.location.href='./index.php?sV='+ItemID+'&sCats=3&Submit=Search&search=1';
	}
}
function book_frmBookSubmit() {
	
	var sSvc = document.getElementById("strts");
	var notes = document.getElementById("details").value;
	var appTime = document.getElementById("book_appTime").value;

	var selVals = "";
	
	if(sSvc.length == 0){
		alert("Please select a service before submitting.");
	} else {
	
	for (i=0;i<sSvc.length;i++){
		selVals += sSvc.options[i].value + ",";
	}
	var ra = Math.floor(Math.random( ) * (10000+1));
	var T1 = setTimeout('book_dLink.slideup();ajaxpage(\'book/dailyDetails.php?'+ra+'\',\'dailyDetails\');ajaxpage(\'book/loadPending.php?'+ra+'\',\'book_pendingP\');location.href=\'#view_pending\'',3000);
	ajaxpage('book/execBookApp.php?vals='+selVals+'&notes='+notes+'&appTime='+appTime,'book_detailsFrm');
	}
}
//screenTest();

function customSearch() {
		var sv = document.getElementById("sCats").value;
		if(sv == "google"){
			document.getElementById("q").value = document.getElementById("sV").value;
			document.getElementById("cse-search-box").submit();
		} else {
			document.getElementById("fsearch").submit();	
		}
}