function getDom(){
/*
This function gets the domain name from the url,
if there is one, and then sets the style sheet reference accordingly
*/
//Only do the whole thing if there is in fact a domain name involved:
var fullUrl=window.location.href;
if(fullUrl.indexOf("www")>=0){
var fullDom=window.location.href.split("www.")[1];
var thisDom=fullDom.split("/")[0];
var newDom="www."+thisDom;
var cssPath=newDom+"/main.css";
document.forms[0].fld_p229_1.value=newDom;
var str="";
if(document.styleSheets=="[object]"){
   str="defined";
}
else{
   str="not defined";
}
//First Check that the style sheet has been defined before changing it
if(str=="defined"){
   document.styleSheets[0].href=cssPath;
}
}
else{
document.forms[0].fld_p229_1.value='www.backpack.co.za';//Default domain
}
}
var fldstr='';

function url(){

for(var i=1;i<17;i++){

if((i==13)||(i==14)){

var radioVal='';

var thisRadio=eval('document.forms[0].p'+i);

if(thisRadio[0].checked)radioVal='on';

fldstr+='&'+radioVal;

} 

else{

var thisFld=eval('document.forms[0].p'+i);

fldstr+='&'+thisFld.value;

}

}
var parms="pSygnType&"+fldstr+'&'+document.forms[0].code.value+'&'+document.forms[0].sitelabel.value+'&'+document.forms[0].unitname.value;
parms+="&"+document.forms[0].maxpersons.value+"&"+document.forms[0].enqtype.value;
document.forms[0].trigger.value="sub_answer,"+parms;
document.forms[0].submit();
}

function mainNav(navParm){
//Fuction to interpretively navigate within pSygn env
document.forms[0].trigger.value=navParm;
document.forms[0].submit();
}

function changeBG(ID,bgCol,col){
//Function to change background colours
var thisTD;
thisTD=eval("document.all." + ID);
thisTD.style.backgroundColor=bgCol;
thisTD.style.color=col;
}



