var editmode=""

submittedFlag=false
function submitForm(obj){
	if(!submittedFlag){
		while (obj.tagName!="FORM"){
			obj=obj.parentNode
		}
		obj.submit()
	}
	submittedFlag=true
}

function adjustPageElements(){
document.getElementById("mainareatable").width=document.getElementById("navbartd").width
//document.getElementById("PageContent").width=document.getElementById("navbartd").width-5
//document.getElementById("CategoryDescription").width=document.getElementById("navbartd").width

}
function openlicense(){
	window.open("images/catalog/cylinders/Alco100_UL.pdf","Cylinder_License","addressbar=no,scrollbars=yes,top=5,left=5,width=790,height=430,resize=yes")
}
function openNewlicence(){
	window.open("images/catalog/cylinders/Alco60_UL.pdf","Cylinder_60L_Licence","addressbar=no,scrollbars=yes,top=5,left=5,width=790,height=430,resize=yes")
}

function hideElement(element_id){
   if (document.getElementById && document.getElementById(element_id) && document.getElementById(element_id).style)
   {
  document.getElementById(element_id).style.visibility="hidden";
   document.getElementById(element_id).style.display="none"
   };
}
function showElement(element_id){
   if (document.getElementById && document.getElementById(element_id) && document.getElementById(element_id).style)
   {
  document.getElementById(element_id).style.visibility="visible";
   document.getElementById(element_id).style.display=""
   };
}
function hideShipping(){
	for (n in document.forms[0]){
	curID=new String(n)
		if (curID.length>8){
				if (curID.indexOf("Shipping",0)!=-1 ){							
				hideElement(n + "Row")	
				document.forms[0][n].disabled = true
				//if (document.forms[0][n].value.length==0){
					//document.forms[0][n].value=document.forms[0][curID.substr(8,curID.length-8)].value
				//}
			}
		}
	}
	hideElement("SAtitleRow")
}
function showShipping(){
	for (n in document.forms[0]){
	curID=new String(n)
		if (curID.length>8){
			if (curID.indexOf("Shipping",0)!=-1 ){		
			showElement(n + "Row")		
			document.forms[0][n].disabled = false
			}
		}
	}
	showElement("SAtitleRow")
}
function flipState(){
	if (document.forms[0].use_for_billing.checked){
		hideShipping()
	}else{
		showShipping()	
	}
}

function toggleSide(refObj){
	obj=refObj
		while (obj.tagName !="TR"){
		obj=obj.parentNode
		}
	 if(obj.firstChild.className=="sideNav"){
	 toggleClass="selected"
	 }else{
	 toggleClass=""
	 }
	 if (obj.status!="active"){
	 obj.firstChild.className="sideNav"+toggleClass
	 obj.firstChild.nextSibling.className="sideNavTip"+toggleClass
	 }
}

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function flashbanner_DoFSCommand(command, args) {
	var flashbannerObj = isInternetExplorer ? document.all.flashbanner : document.flashbanner;
	//
	
	switch (command){
		case "getBanners":	
			roundAdXML="<root>" + document.getElementById("roundAd").innerHTML + "</root>"
			flashbannerObj.SetVariable("_root.adXML",roundAdXML)
			flashbannerObj.TCallLabel("_root", "setBanner")
		break;
	}
	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<sc' + 'ript language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub flashbanner_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call flashbanner_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</scr' + 'ipt\>\n');
}

function setCheckedValue(radioObjName, newValue) {
    var radioObj=document.getElementsByName(radioObjName)
    if (!radioObj)
        return;
    var radioLength = radioObj.length;
    if (radioLength == undefined) {
        radioObj.checked = (radioObj.value == newValue.toString());
        return;
    }
    for (var i = 0; i < radioLength; i++) {
        radioObj[i].checked = false;
        if (radioObj[i].value == newValue.toString()) {
            radioObj[i].checked = true;
        }
    }
}
