if(top.frames.length!=0){if(window.location.href.replace)
top.location.replace(self.location.href);else
top.location.href=self.document.href;}
function OpenWindow(URL){var MaxArguments=4;var ArgumentsIndex;for(ArgumentsIndex=0;ArgumentsIndex<MaxArguments;ArgumentsIndex++){if(arguments.length==ArgumentsIndex){arguments[ArgumentsIndex]=new String();}}
window.open(URL,arguments[1],arguments[2],arguments[3]);}
function open_win(url)
{window.open("url","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=400, height=400")}
function partSearchLink(keyword1,keyword2)
{myLink="http://www.ttiinc.com/page/search_results.html?step=buyNow&searchTerms="+keyword1+"+"+keyword2;window.location=myLink;}
function partQuoteLink(partnumber,quantity)
{myLink="http://www.ttiinc.com/page/quote.html?step=inquire&partNumber[1]="+partnumber+"&quantity[1]="+quantity;window.location=myLink;}
menu_status=new Array();function showHide(theid){if(document.getElementById){var switch_id=document.getElementById(theid);if(menu_status[theid]!='show'){switch_id.className='show';menu_status[theid]='show';}else{switch_id.className='hide';menu_status[theid]='hide';}}}
function hideIt(theid){if(document.getElementById){var switch_id=document.getElementById(theid);if(menu_status[theid]!='hide'){switch_id.className='hide';menu_status[theid]='hide';}}}
function showIt(theid){var el=document.getElementById(obj);el.style.display='yes';}
function open_chart(index,w,h)
{var img="/admin/staging/IO/8918/"+index+".gif";var title="graph"+index;window.open(img,title,"left=0,top=0,width="+w+",height="+h+",resizable");}
function switchMenu(obj){var el=document.getElementById(obj);if(el.style.display!="none"){el.style.display='none';}
else{el.style.display='';}}
function hideCurrentShowNext(obj1,obj2){var el1=document.getElementById(obj1);var el2=document.getElementById(obj2);el1.style.display='none';el2.style.display='';}
function matchHeight(){}
function ieboxfix(){if(!document.getElementById)return;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var cH=document.getElementById('content-holder');var mC=document.getElementById('main-content');boxFix('prod-options');boxFix('filter-options');boxFix('mfr-options');function boxFix(thisBox){if(!document.getElementById(thisBox))return;var filterbox;filterbox=document.getElementById(thisBox);filterbox.style.width=filterbox.offsetWidth+2;filterbox.childNodes[1].style.width=filterbox.offsetWidth;if(mC.offsetWidth<filterbox.offsetWidth){mC.style.width=filterbox.offsetWidth+20+'px';cH.style.width=filterbox.offsetWidth+195+'px';}}}}
function setPoaAcctSelector()
{try
{var ezBuyAccts=document.getElementById('ezBuyAcctSelector');var poaAccts=document.getElementById('payOnAccountNumber');if(ezBuyAccts!=null&&poaAccts!=null)
{if(ezBuyAccts.value!="")
{var i;for(i=0;i<poaAccts.options.length;i++)
{if(poaAccts.options[i].value==ezBuyAccts.value)
{poaAccts.options[i].selected=true;break;}}}}}
catch(ex)
{}}
jQuery.noConflict();function retrieveAutoSavedCart(urlStr){var customerID=null;try{var indx=document.cookie.indexOf("shopping_cart_id=shopping_cart_id:");var shoppingCartID=null;if(indx>-1){shoppingCartID=document.cookie.substring(indx+"shopping_cart_id=shopping_cart_id:".length);shoppingCartID=shoppingCartID.split(";")[0];}
var url=urlStr+"?shopping_cart_id="+shoppingCartID;jQuery.post(url,function(data){if(data!='')
{customerID=data;}});}catch(ex){}
var ezBuySelElem=document.getElementById("ezBuyAcctSelector");if(customerID!=null&&ezBuySelElem&&ezBuySelElem.type&&ezBuySelElem.type=="select-one"){ezBuySelElem.value=customerID;ezBuySelElem.disabled=true;}
return false;}
function initiateClientToWASSession(env,emailAddr,originEntity)
{var entity="NDC";var param="?email=";param+=emailAddr;if(originEntity)
{param+="&originEntity=";param+=originEntity;}
var options={url:"/"+env+"/InitClientToWASSessionAction.do"+param,success:function(data)
{if(data!="")
{entity=data;}},async:false};jQuery.ajax(options);jQuery.cookie("entity",entity,{path:'/'});}
jQuery(document).ready(function(){jQuery("#signOut").click(function(){jQuery.cookie("cart_count","0",{path:'/'});jQuery.post("/apps/logout.do");return true;});var gM=jQuery("#left-sidebar").height()-77;var cA=jQuery("#content-area").height();if(gM>cA){jQuery("#content-area").height(gM);}
retrieveAutoSavedCart('/page/retrieve-cart');var defaultTxt='Keyword or Part #';if(jQuery("#searchTerms").val()==defaultTxt||jQuery("#searchTerms").val()==''){var str=jQuery.cookie("partSearchForm");if(str&&str.length>12){str=str.substring(12);jQuery("#searchTerms").val(str);}else{jQuery("#searchTerms").val(defaultTxt);}}
jQuery("#searchTerms").focus(function(){if(jQuery("#searchTerms").val()==defaultTxt){jQuery(this).val('');}});jQuery("#searchTerms").blur(function(){var string=jQuery("#searchTerms").val();if(jQuery.trim(string)==''){jQuery(this).val(defaultTxt);}});jQuery("#product-search-form").submit(function(event){var string=jQuery("#searchTerms").val();var srch=jQuery.trim(string);jQuery("#searchTerms").val(srch);if((srch.length<3&&jQuery("#left-sidebar ul a[href*='ezBuy']").length<1)||srch==defaultTxt){jQuery.cookie("partSearchForm",null);alert('Please enter at least three characters in the Part Search field.');event.preventDefault();jQuery("#searchTerms").focus();}else{jQuery("#psLink").click();jQuery.cookie("partSearchForm","searchTerms:"+srch);}});jQuery("a#sign-out").click(function(){jQuery.get("/interweb/logout.do");});jQuery("#quote-link").click(function(){if(jQuery("#ezBuy-acct-box").length>0)
{var poa=jQuery("#ezBuy-acct-box option:selected").val();var modLink=jQuery(this).attr("href")+"?payOnAcctId="+poa;jQuery(this).attr("href",modLink);}});jQuery("#footer").append('<a href="#null" id="ssLink"></a>');jQuery("#ssLink").click(function()
{var terms=jQuery("#site-keywords").val();s.linkTrackVars='events,eVar9,prop5';s.linkTrackEvents='event3';s.events="event3";s.eVar9=terms;s.prop5=terms;s.tl(this,'o');});jQuery("#site-search-form").submit(function(event)
{jQuery("#ssLink").click();});jQuery("#footer").append('<a href="#null" id="psLink"></a>');jQuery("#psLink").click(function()
{var terms=jQuery("#searchTerms").val();s.linkTrackVars='events,eVar2,prop1';s.linkTrackEvents='event2';s.events="event2";s.eVar2=terms;s.prop1=terms;s.tl(this,'o');});if(jQuery('.projectListBox .tableHead').length>0)
{var plText='<strong>Project List</strong> allows you to create and maintain multiple lists of parts, or "projects",'
+' and add those parts as a group to a Quote Request or Shopping Cart. Project List allows you to organize parts'
+' as you see fit and projects can be exported to an easy-to-use spreadsheet with enriched data.'
+'<ul><li>Keep multiple sets of part requirements organized.</li>'
+'<li>Quickly generate a spreadsheet of required parts.</li></ul>'
+'<p style="text-align:center">[ Click to Close ]</p>';jQuery('.projectListBox .tableHead').html('<div id="plLabel">Project List <a id="whatsThis" href="#">What\'s this?</a><div id="plInfo" style="display:none;">text</div></div>');jQuery('#plInfo').html(plText);jQuery('#whatsThis').click(function(){jQuery('#plInfo').fadeIn().click(function(){jQuery(this).fadeOut();});});}});
