// Copyright 2000-2009, DataCom\OTA, Inc.
        
// Setup
design_on=new Image(99,37);
design_on.src="/images/menu/design_on.gif";
design_off=new Image(99,37);
design_off.src="/images/menu/design_off.gif";

portfolio_on=new Image(99,37);
portfolio_on.src="/images/menu/portfolio_on.gif";
portfolio_off=new Image(99,37);
portfolio_off.src="/images/menu/portfolio_off.gif";

signs_on=new Image(99,37);
signs_on.src="/images/menu/signs_on.gif";
signs_off=new Image(99,37);
signs_off.src="/images/menu/signs_off.gif";

styles_on=new Image(99,37);
styles_on.src="/images/menu/styles_on.gif";
styles_off=new Image(99,37);
styles_off.src="/images/menu/styles_off.gif";

indexdesign_on=new Image(163,115);
indexdesign_on.src="/images/indexDesign_on.jpg";
indexdesign_off=new Image(163,115);
indexdesign_off.src="/images/indexDesign_off.jpg";

indexportfolio_on=new Image(164,115);
indexportfolio_on.src="/images/indexPortfolio_on.jpg";
indexportfolio_off=new Image(164,115);
indexportfolio_off.src="/images/indexPortfolio_off.jpg";

indexsigns_on=new Image(164,115);
indexsigns_on.src="/images/indexSigns_on.jpg";
indexsigns_off=new Image(164,115);
indexsigns_off.src="/images/indexSigns_off.jpg";

indexstyles_on=new Image(165,115);
indexstyles_on.src="/images/indexStyles_on.jpg";
indexstyles_off=new Image(165,115);
indexstyles_off.src="/images/indexStyles_off.jpg";


//Set Cookie for Current Page
function scPage(cName) {
	document.cookie = "cPage" + "=" + cName+";path=/;";
}

//Gray Out Current Page
function grayOut(imgName) {
	document[imgName].src=eval(imgName + "_on.src");
}

//Set masthea for currrent page
function bil(bgName) {
	document.getElementById('masthead').style.backgroundImage="url(/images/"+bgName+"MH.jpg)";
}

// Roll Over Buttons
function turnOn(imgName) {
	if(document.cookie.split("=")[1]!=document[imgName].name) {
		document[imgName].src=eval(imgName + "_on.src");
		if(document.cookie.split("=")[1]=="index") { document["index" + imgName].src=eval("index" + imgName + "_on.src"); }
	}
}

function turnOff(imgName) {
	if(document.cookie.split("=")[1]!=document[imgName].name) {
		document[imgName].src=eval(imgName + "_off.src");
		if(document.cookie.split("=")[1]=="index") { document["index" + imgName].src=eval("index" + imgName + "_off.src"); }
	}
}

//Open Files
function openFile(theFile) {
    window.open (theFile);
}

function openFileA(theFile, theWindow, theBar, theSize, theWidth, theHeight) {
    window.open (theFile, theWindow,"status=no,location=no,toolbars="+theBar+",menubar="+theBar+",directories=no,scrollbars=no,resizable="+theSize+",width="+theWidth+",height="+theHeight);
}


function postFile(strURL) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystring());
	document.getElementById("formLayer").innerHTML = "<p><br/>Sending . . . </p>";
}

function getquerystring() {
    var form = document.forms['adasCForm'];
    var yn = form.Name.value;
    var co = form.Company.value;
    var ad = form.Address.value;
    var ci = form.City.value;
    var st = form.State.value;
    var zp = form.Zip.value;
    var op = form.officePhone.value;
    var cp = form.cellPhone.value;
    var fx = form.Fax.value;
    var em = form.Email.value;
	var cm = "";
	for (i=0; i<form.contactMethod.length; i++)
		if (form.contactMethod[i].checked) {
			var cm = form.contactMethod[i].value;
		}
    var qc = form.Comments.value;
    qstr = 'Name=' + escape(yn) + '&Company=' + escape(co) + '&Address=' + escape(ad) + '&City=' + escape(ci) + '&State=' + escape(st) + '&Zip=' + escape(zp) + '&officePhone=' + escape(op) + '&cellPhone=' + escape(cp) + '&Fax=' + escape(fx) + '&Email=' + escape(em) + '&contactMethod=' + escape(cm) + '&Comments=' + escape(qc);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str){
    document.getElementById("formLayer").innerHTML = str;
}

