if (document.images) {
	contactoff = new Image();
    contactoff.src = "/images/subnav/contact_off.gif";
	contacton = new Image();
    contacton.src = "/images/subnav/contact_on.gif";
	faqsoff = new Image();
    faqsoff.src = "/images/subnav/faqs_off.gif";
	faqson = new Image();
    faqson.src = "/images/subnav/faqs_on.gif";
	tellafriendoff = new Image();
    tellafriendoff.src = "/images/subnav/tellafriend_off.gif";
	tellafriendon = new Image();
    tellafriendon.src = "/images/subnav/tellafriend_on.gif";
}

function img_act(imgName) {
	if (document.images){
    	imgOn = eval(imgName + "on.src");
        document [imgName].src = imgOn;
    }
}

function img_end(imgName) {
	if (document.images){
    	imgOn = eval(imgName + "off.src");
        document [imgName].src = imgOn;
    }
}

function popWindow(page, width, height){
	window.open(page,null,"height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
}

function SubmitForm(mode){
	switch (mode){
		
		case "preview":
			document.forms['items'].target = "_blank";
			document.forms['items'].action = "/admin/preview.php"+document.location.search;
			var bUsePostFld = document.createElement("input");
			bUsePostFld.type = "hidden";
			bUsePostFld.name = "bUsePost";
			bUsePostFld.value = "1";
			document.forms['items'].appendChild(bUsePostFld);
			break;

		case "save":
			document.forms['items'].target = "_self";
			document.forms['items'].action = "/admin/admin_module.php"+document.location.search;
			var bSaveFld = document.createElement("input");
			bSaveFld.type = "hidden";
			bSaveFld.name = "bSave";
			bSaveFld.value = "1";
			document.forms['items'].appendChild(bSaveFld);
			break;
	}
	document.forms['items'].submit();
}

function spinUp(formname,elementname,unit,idx){
	var inputBox = document.forms[formname].elements[elementname+idx];
	var myValue = parseFloat(inputBox.value);
	if (isNaN(myValue))
		myValue = 0;
	myValue += parseFloat(unit);
	inputBox.value = myValue.toString();	
}

function spinDown(formname,elementname,unit,idx){
	var inputBox = document.forms[formname].elements[elementname+idx];
	var myValue = parseFloat(inputBox.value);
	if (isNaN(myValue))
		myValue = 0;
	if (myValue > 0){
		myValue -= parseFloat(unit);		
	}
	inputBox.value = myValue.toString();	
}




