var path=location.pathname.substr(0,4);var isIE5=navigator.userAgent.toUpperCase().indexOf("MSIE 5")!==-1;var targetElementID="container";var targetElementStyleOffset=30;var ulang="en",curLang;var topie6=0;var uShipTo="";var isIE6=false;if(jQuery.browser.msie===true&&jQuery.browser.version.substr(0,1)<=6){isIE6=true;}
var isPunchout=false;var punchoutChecked=false;var punchoutGreeting=false;if(typeof jQuery!=="undefined"){jQuery(document).ready(loadtools);jQuery.ajaxSetup({cache:false});}
(function(a,b){if(/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))b()})(navigator.userAgent||navigator.vendor||window.opera,mobileRedirect);function mobileRedirect()
{var siteCookie=getCookie("AlfaMobile");if(siteCookie=="")
{setCookie("AlfaMobile","yes",7);siteCookie="yes";}
if(siteCookie=="yes")
{var url=window.location.href;var redirectUrl="";redirectUrl=url.match(/^(http|https):\/\/([a-zA-Z:0-9\.]*)\/([a-zA-Z]{2})\//);if(redirectUrl==null)
{window.location=url+"en/mo160w.pgm";}
window.location=redirectUrl[0]+'mo160w.pgm';}}
function loadtools(){if(punchoutGreeting)
{var greetingdata='<div id="greetingText"><span lang="Y" key="">'
+'Welcome, you have successfully "punched out" to the Supplier WebSite Alfa Aesar - <a href="http://www.alfa.com">http://www.alfa.com</a>.'
+'</span></div><div id="greetingButton">';greetingdata+='<a href="javascript: disablePopup();"><img src="/'+curLang+'/images/OK.gif" /></a></div>';jQuery('#popupBox').addClass('punchoutGreeting');loadPopup(greetingdata);}
punchoutDisplay();getlanguage();getsearchtype();checkLogon();checkCtry();jQuery(window).resize(function(){adjustHeight();contentheight();});jQuery(window).load(function(){adjustHeight();});contentheight();jQuery("div.menu9 a[ref^=tab]").click(function(event){var that=this;event.preventDefault();setActiveTab(jQuery(that).attr("ref"))?(window.location=that.href):false;});makeTabActive();setFooterYear();jQuery("#popupBoxClose").click(function(){disablePopup();backgroundoverlayhide();});jQuery("#punchoutPopupBoxClose").click(function(){disablePopupPunchout();backgroundoverlayhide();});if(jQuery("#titletag").html()!==null){document.title=jQuery("#titletag").html()+" - Alfa Aesar - A Johnson Matthey Company";}
jQuery(".menu9 > ul > li").hover(function(){var that=this;var id;if((jQuery.browser.msie===true&&jQuery.browser.version.substr(0,1)==="7")||jQuery.browser.opera===true){id="#"+jQuery(that).attr("id");var widest=0;jQuery(id+" > ul").css({display:"block","vertical-align":"bottom","white-space":"nowrap",width:"auto",position:"absolute"});jQuery(id+" > ul > li > a").each(function(){var thisWidth=jQuery(this).width();widest=(thisWidth>widest?thisWidth:widest);});jQuery(id+" > ul > li  > a").each(function(){jQuery(this).width(widest+"px").css("padding-right","16px");});}
if(jQuery.browser.msie===true&&jQuery.browser.version.substr(0,1)<=6){id="#"+jQuery(that).attr("id");jQuery(id+" > ul > li  > a").each(function(){jQuery(this).width("205px").css("padding-right","16px");});jQuery(id+" > ul").width("205px");}},function(){var that=this;var id="#"+jQuery(that).attr("id");jQuery(id+" > ul").css({display:"none"});});jQuery('#productSearchForm').submit(function()
{return headerBarSearch();});if(ulang=='')ulang='en';jQuery.get("/"+ulang+"/gs140w.pgm",{task:"getShipTo"},function(rtnDta){uShipTo=rtnDta.toString();if(uShipTo==="CN"||uShipTo==="ZH"){jQuery("#searchtype [value=CAS]").attr("selected","selected");}},"text");}
function getlanguage()
{ulang=window.location.href;ulang=ulang.replace("http://","");ulang=ulang.replace("https://","");var pos=ulang.indexOf("/");ulang=ulang.substr(pos+1,ulang.length-pos);pos=ulang.indexOf("/");ulang=ulang.substr(0,pos);if(ulang=='')ulang='en';}
function setAltTitleAttr(containerID)
{if(typeof containerID==="undefined")
{jQuery("img").each(function(){btnimgalttxt("img",jQuery(this).attr("alttxt"));});jQuery("input").each(function(){if(jQuery(this).attr("type")==="image"){btnimgalttxt("input",jQuery(this).attr("alttxt"));}});}
else
{jQuery(containerID+" img").each(function(){btnimgalttxt("img",jQuery(this).attr("alttxt"),containerID);});jQuery(containerID+" input").each(function(){if(jQuery(this).attr("type")==="image"){btnimgalttxt("input",jQuery(this).attr("alttxt"),containerID);}});}}
function setFooterYear()
{var mydate=new Date();var year=mydate.getFullYear();jQuery('#copyyear').html(year);}
function min3Chars(){jQuery("span.MSDSmsg, span.msg").css('display','none');if(jQuery("#PSvalue").val().length===0&&jQuery("table#prodsearch input[name=chinesechars]").attr("checked")===true){jQuery("span[key=at_least_one_character]").css("display","");return false;}else if(jQuery("#PSvalue").val().length===0&&jQuery("table#prodsearch input[name=chinesechars]").attr("checked")===false&&jQuery("#PSvalue_mlt").val().length===0){return false;}else if(jQuery("#PSvalue").val().length<3&&jQuery("table#prodsearch input[name=chinesechars]").attr("checked")===false&&jQuery("#PSvalue_mlt").val().length===0){jQuery("span[key=at_least_three_characters]").css("display","");return false;}
return true;}
function min6Chars(){if(jQuery("#product").val().length<6&&jQuery("#docsrchtyp option:selected").val()==="MSDS"){return false;}
return true;}
function productSearch()
{if(jQuery('#value').val().length>=3||(jQuery('#value').val().length>=1&&jQuery("form#productSearchForm input[name=chinesechars]").attr("checked")===true)){if(jQuery("#searchtype").val()==="CAS"){}
jQuery('#productSearchForm').submit();}else if(jQuery('#value').val().length===0&&jQuery("form#productSearchForm input[name=chinesechars]").attr("checked")===true){var language=jQuery('#languageBox select').val();window.location="/"+language+"/GO160W.pgm?errmsg=min1chars";}else{var language=jQuery('#languageBox select').val();window.location="/"+language+"/GO160W.pgm?errmsg=min3chars";}}
function advancedSearch(){var language=jQuery('#languageBox select').val();if(jQuery('#value').val().length>=3){jQuery('#productSearchForm').submit();}else if(jQuery('#value').val().length===0){window.location="/"+language+"/GO160W.pgm";}else{window.location="/"+language+"/GO160W.pgm?errmsg=min3chars";}}
function headerBarSearch()
{var headerBarValid=true;if(jQuery('#value').val().length>=3||(jQuery('#value').val().length>=1&&jQuery("form#productSearchForm input[name=chinesechars]").attr("checked")===true)){if(jQuery("#searchtype").val()==="CAS"){}
headerBarValid=true;}else if(jQuery('#value').val().length===0&&jQuery("form#productSearchForm input[name=chinesechars]").attr("checked")===true){var language=jQuery('#languageBox select').val();window.location="/"+language+"/GO160W.pgm?errmsg=min1chars";headerBarValid=false;}else{var language=jQuery('#languageBox select').val();window.location="/"+language+"/GO160W.pgm?errmsg=min3chars";headerBarValid=false;}
return headerBarValid;}
function switchLanguage(newLang){var lang=new String(newLang.options[newLang.selectedIndex].value);var page=location.pathname;var parm=location.search;var pgmName=page.substr(4);var redir;if(pgmName==''){pgmName='gh100w.pgm';}
if(lang==''){lang='en';}
redir='/'+lang+'/'+pgmName+parm;parent.location=redir;}
function adjustHeight()
{if(document.getElementById){var targetElement=document.getElementById(targetElementID),documentHeight,totalOffset;if(targetElement&&document.documentElement.offsetHeight&&targetElement.offsetHeight&&targetElement.offsetTop){documentHeight=document.documentElement.offsetHeight;if(targetElement.offsetHeight<documentHeight-targetElement.offsetTop){if(isIE5){totalOffset=targetElement.offsetTop;}else{totalOffset=targetElement.offsetTop+targetElementStyleOffset;}
targetElement.style.height=String(documentHeight-totalOffset)+'px';}}}}
function makeTabActive(defaultTabName)
{var tabName=getActiveTab();if((tabName==='')||(tabName===' ')){tabName=(defaultTabName)?defaultTabName:"tab1";}
if(tabName!=="tab0"){jQuery("#"+tabName).attr('id','nav1');if(tabName==="tab8")
{jQuery("#titleBar").css("background-color","#599610");}}}
function setActiveTab(tabName)
{var menu="menu";var days=365;return setCookie(menu,tabName,days)?false:true;}
function getActiveTab()
{var menu="menu";var tabName;tabName=getCookie(menu);return tabName;}
function getCookie(c_name)
{if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!==-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end===-1){c_end=document.cookie.length;}
return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function setCookie(NameOfCookie,value,expiredays)
{var ExpireDate=new Date();ExpireDate.setTime(ExpireDate.getTime()+(expiredays*24*3600*1000));document.cookie=NameOfCookie+"="+escape(value)+
((expiredays===null)?"":"; expires="+ExpireDate.toGMTString())+"; path=/";}
function formHandler(form)
{var URL=document.form.site.options[document.form.site.selectedIndex].value;window.location.href=URL;}
function getAddressFields(ID){var aPath=path+'gs150w.pgm';jQuery.get(aPath,function(data){jQuery("#addressTable").replaceWith(data);adjustHeight();contentheight();if(ulang=='')ulang='en';if(typeof ID!=="undefined"){tran_SwitchLang(ulang,'#'+ID);}},"html");}
function checkLogon(){var unameVal=jQuery("#uname").val();var upassVal=jQuery("#upass").val();if(ulang=='')ulang='en';aPath="/"+ulang+"/gs140w.pgm";jQuery.ajax({url:aPath,cache:false,dataType:"json",type:"GET",data:"uname="+encodeURI(unameVal)+"&upass="+encodeURI(upassVal),success:function(data){var responseObj=data;jQuery("#userLogin").html(responseObj.html);if(typeof tran_SwitchLang==="function"){tran_SwitchLang(curLang,"#userLogin");}
if(typeof punchoutDisplay==="function"){punchoutDisplay();}}});}
function newLogon(){var unameVal=jQuery("#uname").val();var upassVal=jQuery("#upass").val();var unameVal=encodeURIComponent(unameVal);var upassVal=encodeURIComponent(upassVal);if(ulang=='')ulang='en';aPath="/"+ulang+"/gs140w.pgm";jQuery.ajax({url:aPath,cache:false,dataType:"json",type:"GET",data:"uname="+unameVal+"&upass="+upassVal,success:function(data){var responseObj=data;var loc=window.location.href.toLowerCase();if(responseObj.gotoURL=='undefined'||responseObj.gotoURL=='UNDEFINED'){responseObj.gotoURL="";}
if(responseObj.success==true&&responseObj.gotoURL!=''){window.location.href=responseObj.gotoURL.substr(responseObj.gotoURL.indexOf('/',10));return;}
if(typeof responseObj.success!=="undefined"&&responseObj.success==="cemcat"){window.location="/"+ulang+"/gr110w.pgm?task=cemcat&email="+responseObj.email;}else{if(responseObj.success===false){window.location.href="/"+ulang+"/gr100w.pgm?e=y";}else{jQuery("#userLogin").html(responseObj.html);if(typeof responseObj.lang!=="undefined"&&responseObj.lang!=""){curLang=responseObj.lang;}else{curLang="en";}
tran_SwitchLang(curLang,"#userLogin");if(loc.match("gr100w.pgm")!==null){window.location.href="/"+curLang+"/gh100w.pgm";}else{reloadAfterLogin(curLang);}}}}});}
function newSession()
{if(ulang=='')ulang='en';var path="/"+ulang+"/go180w.pgm";jQuery.ajax({url:path,cache:false,data:"task=getcartitems",success:function(items){if(items==="0")
{logoff();}
else
{var htmldata='<span lang="Y" key="logout_cart_message">'
+'Your shopping cart will be cleared when you log out. Would you like to continue logging out? Click Cancel to go back and save your cart.</span>'
+'<br /><br /><center>';htmldata+='<a href="javascript: logoff(); disablePopup();"><img src="/'+curLang+'/images/Yes.gif" /></a>';htmldata+='&nbsp;<a href="javascript: disablePopup();"><img src="/'+curLang+'/images/Cancel.gif" /></a></center>';loadPopup(htmldata);tran_SwitchLang(curLang,"#popupBox");}}});}
function logoff(){if(ulang=='')ulang='en';var aPath="/"+ulang+"/gs140w.pgm";jQuery.ajax({url:aPath,cache:false,dataType:"json",type:"GET",data:"task=new",success:function(data){var responseObj=data;jQuery("#userLogin").html(responseObj.html);tran_SwitchLang(curLang,"#userLogin");getAddressFields();reloadpage();}});}
function reloadpage(){var url=window.location.href.toLowerCase();if(ulang=='')ulang='en';if(url.indexOf("gl160w")>0||url.indexOf("go180w")>0||url.indexOf("go170w")>0||url.indexOf("go200w")>0||url.indexOf("gp100w")>0||url.indexOf("gp120w")>0||url.indexOf("go190w")>0||url.indexOf("gb120w")>0||url.indexOf("gb100w")>0||url.indexOf("gd150w")>0||url.indexOf("gn120aj")>0||url.indexOf("gp110w")>0||url.indexOf("gl110ah")>0){window.location.reload();}
else if(url.indexOf("gp140w")>0)
{window.location.href=url;}
else if(url.indexOf("gr")>0&&url.indexOf("gr110w")<=0)
{window.location.href="/"+ulang+"/GR100W.pgm";}
else
{getcartitems();getbulkitems();}}
function reloadAfterLogin(lang){if(ulang=='')ulang='en';if(ulang!==lang)
{var url=window.location.href.toLowerCase();var langLoc=url.indexOf("/"+ulang+"/");if(langLoc>0){url=url.replace("/"+ulang+"/","/"+lang+"/");}
window.location.href=url;}else{reloadpage();}}
function buildSelectList()
{jQuery("#wkCheckList").val("");for(var i=0,ii=document.getElementsByTagName('input').length;i<ii;i++){if(document.getElementsByTagName('input')[i].type==='checkbox')
if(document.getElementsByTagName('input')[i].checked===true)
jQuery("#wkCheckList").val(jQuery("#wkCheckList").val()+document.getElementsByTagName('input')[i].id+",");}}
function checkForm(pgm){if(jQuery("#submit").attr("disabled")===true){return;}
jQuery("#submit").attr("disabled","disabled");jQuery("body").css("cursor","wait");if(typeof pgm==="undefined"){pgm="";}
jQuery(".submitmsg").html("");formIsValid=true;if(jQuery("#vfirst").val()===''){formIsValid=false;jQuery("#vfirst").addClass("error");}
else jQuery("#vfirst").removeClass("error");if(jQuery("#vlast").val()===''){formIsValid=false;jQuery("#vlast").addClass("error");}
else jQuery("#vlast").removeClass("error");if(jQuery("#vcomp").val()===''){formIsValid=false;jQuery("#vcomp").addClass("error");}
else jQuery("#vcomp").removeClass("error");if(jQuery("#vaddr1").val()===''){formIsValid=false;jQuery("#vaddr1").addClass("error");}
else jQuery("#vaddr1").removeClass("error");if(jQuery("#vcity").val()===''){formIsValid=false;jQuery("#vcity").addClass("error");}
else jQuery("#vcity").removeClass("error");if(jQuery("#vzip").val()===''){formIsValid=false;jQuery("#vzip").addClass("error");}
else jQuery("#vzip").removeClass("error");if(jQuery("#vcountry").val()===''){formIsValid=false;jQuery("#vcountry").addClass("error");}
else jQuery("#vcountry").removeClass("error");if(jQuery("#vphone").val()===''){formIsValid=false;jQuery("#vphone").addClass("error");}
else jQuery("#vphone").removeClass("error");if(jQuery("#vemail").val()===''){formIsValid=false;jQuery("#vemail").addClass("error");}
else jQuery("#vemail").removeClass("error");if(jQuery("#plsfl").val()==undefined){jQuery("#plsfl").val('');}
if(jQuery("#plsrc").val()==undefined){jQuery("#plsrc").val('');}
if(formIsValid)
{var d="task=send"+"&vfirst="+jQuery("#vfirst").val()+"&vlast="+jQuery("#vlast").val()+"&vtitle="+jQuery("#vtitle").val()+"&vcomp="+jQuery("#vcomp").val()+"&vaddr1="+jQuery("#vaddr1").val()+"&vaddr2="+jQuery("#vaddr2").val()+"&vcity="+jQuery("#vcity").val()+"&vcounty="+jQuery("#vcounty").val()+"&vstate="+jQuery("#vstate").val()+"&vzip="+jQuery("#vzip").val()+"&vcountry="+jQuery("#vcountry").val()+"&vphone="+jQuery("#vphone").val()+"&vfax="+jQuery("#vfax").val()+"&vemail="+jQuery("#vemail").val()+"&vcomments="+jQuery("#vcomments").val()+"&wkCheckList="+jQuery("#wkCheckList").val()+"&plsfl="+jQuery("#plsfl").val()+"&plsrc="+jQuery("#plsrc").val();jQuery.ajax({url:pgm,type:"GET",cache:false,data:encodeURI(d),success:function(msg){jQuery(".submitmsg").html(msg);tran_SwitchLang(curLang,".submitmsg");jQuery("#submit").attr("disabled","")
jQuery("body").css("cursor","auto");},error:function(){jQuery("#submit").attr("disabled","");jQuery("body").css("cursor","auto");}});formIsValid=false;}
else
{jQuery("body").css("cursor","auto");}
return formIsValid;}
function disablePopup(){jQuery("#popupBox").fadeOut("slow");jQuery("popupBox").removeClass("punchoutGreeting");}
function loadPopup(htmldata,width,height,timeout){if(typeof width!=="undefined"){if(width>0){jQuery("#popupBox").css("width",width);}}else{jQuery("#popupBox").css("width","");}
if(typeof height!=="undefined"){if(height>0){jQuery("#popupBox").css("height",height);}}else{jQuery("#popupBox").css("height","");}
jQuery('#minipopupcontent').html(htmldata);tran_SwitchLang(curLang,"#minipopupcontent");if(jQuery.browser.msie===true&&jQuery.browser.version.substr(0,1)==6){jQuery("#popupBoxClose, #popheader").css({"display":"inline"});jQuery("#popupBox").css({position:"absolute"});}
var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=jQuery("#popupBox").height();var popupWidth=jQuery("#popupBox").width();jQuery("#popheader").css({"width":popupWidth+"px","display":"block"});jQuery("#popupBox").css({"top":windowHeight/2-popupHeight/2,"left":windowWidth/2-popupWidth/2});if(jQuery.browser.msie===true&&jQuery.browser.version.substr(0,1)==6){var topnew=0;topie6=jQuery("#popupBox").css("top");topie6=topie6.replace(/px/,"");topie6=topie6-1+1;jQuery(window).scroll(function(){topnew=document.documentElement.scrollTop+topie6;jQuery("#popupBox").css({"top":topnew+"px"});});}
jQuery("#popupBox").fadeIn("slow");if(timeout!==undefined){timer=window.setTimeout("disablePopup();",timeout);}}
function capitalizeDrop(id,cls)
{var selector="";if(typeof cls==="undefined")
{selector="#"+id;}
else
{selector="."+cls;}
jQuery(selector+' option').each(function()
{value=jQuery(this).html();jQuery(this).html(capitalizeMe(value));});}
function capitalizeMe(val){newVal='';val=val.toLowerCase();val=val.split(' ');for(var c=0,cc=val.length;c<cc;c++){newVal+=val[c].substring(0,1).toUpperCase()+
val[c].substring(1,val[c].length)+' ';}
return newVal;}
function btnimgalttxt(btnimgtype,classname,containerID){var selector="";if(typeof containerID==="undefined")
{selector=btnimgtype+'[alttxt="'+classname+'"]';}
else
{selector=containerID+' '+btnimgtype+'[alttxt="'+classname+'"]';}
var spansel="span."+classname;jQuery(selector).attr("alt",jQuery(spansel).html()).attr("title",jQuery(spansel).html());}
function contentheight()
{if(document.getElementById("content")!==null)
{var contenth=document.getElementById("content").offsetHeight+5;var containerh=document.getElementById("container").offsetHeight;var height=jQuery(window).height();var containertop=document.getElementById("container").offsetTop;if((containerh+containertop)<height)
{if(contenth>containerh)
{document.getElementById("container").style.height=contenth+"px";}}
else
{document.getElementById("container").style.height="";}}}
function backgroundoverlay(options){var f_opacity;var f_contentwidth;var f_contentheight;if(typeof options.element!=="string"){options.element="body";}
if(typeof options.opacity!=="number"){options.opacity=0;}
if(typeof options.background!=="boolean"){options.background=false;}
if(typeof options.left!=="number"){options.left=0;}
if(typeof options.top!=="number"){options.top=0;}
if(typeof options.width!=="number"){options.width=0;}
if(typeof options.size!=="string"){options.size=options.element;}
if(typeof options.zindex!=="number"){options.zindex=100;}
f_opacity=0;if(options.opacity>0){f_opacity=options.opacity/100;}
f_contentwidth=jQuery(options.size).width()+"px";f_contentheight=jQuery(options.size).height()+"px";if(options.width>0){f_contentwidth=options.width+"px";}
if(options.element==="body"||options.size==="body"){f_contentheight=(jQuery("#wrap").height()+35)+"px";}
if(options.background===true){jQuery("body").append("<div id=\"iframebackground\"></div>");jQuery("#iframebackground").css({position:"absolute",top:"0px",left:"0px","background-color":"#000000","z-index":"101",display:"block",width:f_contentwidth,height:f_contentheight,opacity:f_opacity,filter:"alpha(opacity="+options.opacity+")"});}
if(options.element!=="body"){jQuery(options.element).css({"z-index":"105"});}
jQuery("body").append("<iframe id=\"iframeoverlay\" src=\"javascript:void(0);\" frameborder=\"0\" scrolling=\"no\"></iframe>");jQuery("#iframeoverlay").css({position:"absolute",top:options.top,left:options.left,"z-index":options.zindex,display:"block",width:f_contentwidth,height:f_contentheight,filter:"mask()"});if(jQuery.browser.msie===true){}}
function findPos(obj)
{var curleft=0,curtop=0;if(obj.offsetParent)
{do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}
while(obj==obj.offsetParent);return{left:curleft,top:curtop};}}
function backgroundoverlayhide(options)
{if(typeof options!=="undefined")
{if(typeof options.element==="string")
{jQuery(options.element).css({"z-index":""});}}
jQuery("#iframeoverlay, #iframebackground").remove();}
function translateDropdowns()
{jQuery(".dropdown").each(function(){var dropname=jQuery(this).attr("name");var dropval=jQuery(this).attr("value");var droptxt=jQuery(this).html();jQuery('select[name="'+dropname+'"] option[value="'+dropval+'"]').text(droptxt);});}
function limitText(field,maxlimit)
{if(field.value.length>maxlimit)
field.value=field.value.substring(0,maxlimit);}
function stripTags(thisValue){var regexHTML=/<\S[^>]*>/g;var regexEnt=/&[^\s]*;/;thisValue=thisValue.replace(regexHTML,"");thisValue=thisValue.replace(regexEnt,"");return thisValue;}
function punchoutDisplay()
{if(ulang=='')ulang='en';if(punchoutChecked==false)
{jQuery.ajax({url:"/en/go247w.pgm",cache:false,success:function(response){if(response=="Y")isPunchout=true;punchoutChecked=true;}});}
if(isPunchout)
{jQuery('.tabMA').css('visibility','hidden');jQuery('#loggedIn a').css('visibility','hidden');jQuery('[id^="fav"], .add_to_favourites').hide();jQuery('#savecart').closest('td').css('visibility','hidden');jQuery('#savediv').css('visibility','hidden');}}
function checkCtry(){if(ulang=='')ulang='en';aPath="/"+ulang+"/gs342w.pgm";jQuery.ajax({url:aPath,cache:false,dataType:"html",type:"GET",success:function(html){jQuery("#countryBox").html(html);}});}
function switchCtry(){var ctryCode=jQuery("#selectCtry :selected").val();if(ulang=='')ulang='en';aPath="/"+ulang+"/gs342w.pgm";jQuery.ajax({url:aPath,cache:false,dataType:"html",type:"GET",data:"task=switchctry&ctryCode="+ctryCode,success:function(html){window.location.reload();}});}
function reloadppage(){var url=window.location.href.toLowerCase();if(url.indexOf("pl160w")>0||url.indexOf("po180w")>0||url.indexOf("po170w")>0||url.indexOf("po200w")>0||url.indexOf("pp100w")>0||url.indexOf("pp120w")>0||url.indexOf("po190w")>0||url.indexOf("pb120w")>0||url.indexOf("pb100w")>0||url.indexOf("pd150w")>0||url.indexOf("pp110w")>0){window.location.reload();}
else if(url.indexOf("pp140w")>0)
{window.location.href=url;}
else
{getcartitems();getbulkitems();}}
function seoTrackNonPage(thisObj){var url=window.location.pathname.toLowerCase()+window.location.search.toLowerCase();var objPath=jQuery(thisObj).attr("href");if(url.indexOf("gl110ah")>0){_gaq.push(['_trackEvent','PDF','Download',objPath]);}}
function savesrchtyp(seltyp){var typ=new String(seltyp.options[seltyp.selectedIndex].value);setCookie("searchtype",typ,1);}
function getsearchtype()
{var typ=getCookie("searchtype");jQuery("#searchtype option[value="+typ+"]").attr("selected","selected");}
