var menuitems = new Object(); menuitems['aboutus'] = new Object(); menuitems['aboutus']['marketssegments.php'] = 'MARKETS & SEGMENTS'; menuitems['aboutus']['thefactory.php'] = 'THE FACTORY'; menuitems['aboutus']['theproducts.php'] = 'NEW PRODUCTS'; menuitems['aboutus']['qualitystandardapprovals.php'] = 'QUALITY STANDARD & APPROVALS'; menuitems['aboutus']['vacancies.php'] = 'VACANCIES'; menuitems['aboutus']['contactus.php'] = 'CONTACT US'; menuitems['application'] = new Object(); menuitems['application']['general_contracting.php'] = 'GENERAL CONTRACTING'; menuitems['application']['defence.php'] = 'DEFENCE'; menuitems['application']['rail.php'] = 'RAIL'; menuitems['application']['machineryoem.php'] = 'MACHINERY & OEM'; menuitems['application']['data.php'] = 'DATA'; menuitems['application']['utilityservices.php'] = 'UTILITY SERVICES'; menuitems['application']['marine.php'] = 'MARINE'; menuitems['application']['tailoredsolutions.php'] = 'TAILORED SOLUTIONS'; menuitems['metallicsystems'] = new Object(); menuitems['metallicsystems']['applicationguides.php&type=metallic'] = 'SELECTION GUIDE'; menuitems['metallicsystems']['selectionprocess.php&type=metallic'] = 'CONDUIT LIST'; menuitems['nonmetallicsystems'] = new Object(); menuitems['nonmetallicsystems']['applicationguides.php&type=nonmetallic'] = 'SELECTION GUIDE'; menuitems['nonmetallicsystems']['selectionprocess.php&type=nonmetallic'] = 'CONDUIT LIST'; menuitems['nonmetallicsystems']['fpaanimation.php'] = 'FPA ANIMATION'; menuitems['news'] = new Object(); menuitems['export'] = new Object(); menuitems['accessories'] = new Object(); menuitems['accessories']['tools.php'] = 'TOOLS'; menuitems['accessories']['accessories2.php'] = 'ACCESSORIES'; menuitems['accessories']['contractorpack.php'] = 'CONTRACTOR PACK'; menuitems['technicalguidance'] = new Object(); menuitems['technicalguidance']['chemicalresistance.php'] = 'CHEMICAL RESISTANCE'; menuitems['technicalguidance']['threaddata.php'] = 'THREAD DATA'; menuitems['technicalguidance']['lowfirehazard.php'] = 'LOW FIRE HAZARD'; menuitems['technicalguidance']['ipratings.php'] = 'IP RATINGS'; menuitems['energy'] = new Object(); menuitems['energy']['ftsrange.php'] = 'FTS RANGE'; menuitems['energy']['productselection.php'] = 'PRODUCT SELECTION'; menuitems['energy']['technical.php'] = 'TECHNICAL'; temp = ""; function prod_select(id){ img = document.getElementById("check"+id); if(img.src.indexOf("check-off.gif") > 0){ img.src = img.src.replace("check-off.gif","check-on.gif"); document.prodform.elements["con"+id].value = "1"; }else{ img.src = img.src.replace("check-on.gif","check-off.gif"); document.prodform.elements["con"+id].value = ""; } } function show_sub_menu(menu,pos,o_right){ layer = document.getElementById('submenu'); layer.innerHTML = " "; var menucolor = ""; for(items in menuitems[menu]){ if(items.indexOf("&") > 0){ apage = items.substr(0,items.indexOf("&")); }else{ apage = items; } //alert(thispage+": "+apage); if(thispage == apage){ menucolor = "style='color:#ff0000'"; }else{ menucolor = ""; } if(layer.innerHTML == ""){ layer.innerHTML = ""+menuitems[menu][items]+""; }else{ layer.innerHTML += " // "+menuitems[menu][items]+""; } } if(o_right){ layer.style.right = pos+'px'; layer.style.left = ""; layer.style.textAlign = "right"; }else{ layer.style.left = pos+'px'; layer.style.right = ""; layer.style.textAlign = "left"; } } function clear_sub_menu(){ layer = document.getElementById('submenu'); layer.innerHTML = " "; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i 0){ if(myelements[i].value != ""){ selected = true; } } } } //flist = document.getElementById('f_list'); if(selected == false){ //if(flist.value == ""){ alert("You haven't selected any conduits"); return false; //}else{ //return true; //} }else{ //alert("You haven't selected any conduits"); return true; } } function add(formname,part,page,paction){ qtyel = document.getElementById(part+"qty"); var qty = qtyel.value; if(qty == "" || isNaN(qty)){ alert("Please enter your quantity for this conduit"); }else{ document.forms[formname].action = page+"&paction="+paction; document.forms[formname].submit(); } } function doscroll(coordinate){ window.scrollTo(0,coordinate); } function store_ycoord(){ ycoord = document.getElementById('ycoord'); if(ycoord){ var ScrollTop = document.body.scrollTop; if (ScrollTop == 0) { if (window.pageYOffset){ ScrollTop = window.pageYOffset; }else{ ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0; } } ycoord.value = ScrollTop; } } function closegraph(){ var graph = document.getElementById("graph2"); graph.style.display = "none"; } function opengraph(){ var graph = document.getElementById("graph2"); graph.style.display = "block"; } function select_system(sysid){ document.sel2.sub_select.value = sysid; document.sel2.type.value = 'metallic' document.sel2.submit(); } function fitting_add(){ document.sel2.sub_select.value = '' document.sel2.type.value = 'nonmetallic'; //alert(document.sel2.type.value); document.sel2.submit(); } function back_to_conduit(type,conduit){ document.sel2.action = "?page=selectionprocess.php&type="+type+"&selectedconduit="+conduit; document.sel2.submit(); } function accessory_add(parameters){ document.accessory.action = parameters; var quantity = 0; for(i=0;i -1){ if(document.accessory.elements[i].value != "" || document.accessory.elements[i].value.isNaN){ quantity = quantity + parseInt(document.accessory.elements[i].value); } } } if(quantity == 0){ alert("No accessory has been selected"); }else{ document.accessory.submit(); } } function contract_pack_add(pack_id){ thisselect = document.getElementById(pack_id+'conpackitem'); thisqty = document.getElementById(pack_id+'quantity'); if(thisqty.value == "" || thisqty.isNaN){ thisqty.value = "1"; } document.conpacks.conpackid.value = thisselect.value; document.conpacks.conpackqty.value = thisqty.value; document.conpacks.submit(); } function tool_add(url){ myEl = document.toolform.elements; mygood = false; for(i=0;i -1){ if(bElements[i].checked == false){ bElements[i].checked = true; }else{ bElements[i].checked = false; } } } } function viewbigimage(imagename,width,height){ window.open("content/bigimage.php?image="+imagename,"bigimage","width="+width+", height="+height); } function win_open(url){ window.open(url,"terms","width=600,height=600,scrollbars=yes"); } function check_terms(){ if(document.checkout.terms.checked == false){ alert("You must agree to our terms and conditions before you can place your enquiry"); return false; }else{ return true; } } function quick_search(){ if(document.quicksearch.area.value != ""){ document.quicksearch.action = "?page=applicationguides.php&action=quicksearch"; document.quicksearch.submit(); }else if(document.quicksearch.chem1.value != ""){ document.quicksearch.action = "?page=chemicalresistance.php&action=chem"; document.quicksearch.submit(); } } function check_search(){ if(document.quicksearch.prodid.value != "product code" && document.quicksearch.prodid.value != ""){ document.quicksearch.action = "?page=search.php"; return true } return false; } function clear_searchtext(){ if(document.quicksearch.prodid.value == "product code"){ document.quicksearch.prodid.value = ""; } } function restore_searchtext(){ if(document.quicksearch.prodid.value == ""){ document.quicksearch.prodid.value = "product code"; } } // JavaScript Document