function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function strictNewWindow(){if(!document.getElementsByTagName)return false;var aList=document.getElementsByTagName('a');for(var i=0;i<aList.length;i++){if(aList[i].className=='popup'){aList[i].onclick=function(){window.open(this.getAttribute('href'),'popup');return false;}}
if(aList[i].className=='flash'){aList[i].onclick=function(){window.open(this.getAttribute('href'),'flash','width=480,height=500');return false;}}}}
function replaceAlign(){if(!document.getElementsByTagName)return false;if(!document.getElementsByTagName('img'))return false;var imgList=document.getElementsByTagName('img');for(var i=0;i<imgList.length;i++){var align=imgList[i].getAttribute('align');if(align){if(align=='left'){imgList[i].className='left';}
if(align=='right'){imgList[i].className='right';}
if(align=='middle'){imgList[i].className='middle';}
imgList[i].removeAttribute('align')}}}
function replaceTarget(){if(!document.getElementsByTagName)return false;if(!document.getElementsByTagName('a'))return false;var aList=document.getElementsByTagName('a');for(var i=0;i<aList.length;i++){var target=aList[i].getAttribute('target');if(target){aList[i].className+=' popup';aList[i].removeAttribute('target')}}}
hdrHover=function(){if(document.getElementById('headerNav')!=null){if((document.all)&&(document.getElementById)){var hdrCat=document.getElementById("headerNav").getElementsByTagName("li");for(var i=0;i<hdrCat.length;i++){hdrCat[i].onmouseover=function(){this.className+=" hdrhover";}
hdrCat[i].onmouseout=function(){this.className=this.className.replace(new RegExp(" hdrhover\\b"),"");}}}}}
cdHover=function(){if(document.getElementById('cdRequirements')!=null){if((document.all)&&(document.getElementById)){var cdrCat=document.getElementById("cdRequirements").getElementsByTagName("li");for(var i=0;i<cdrCat.length;i++){cdrCat[i].onmouseover=function(){this.className+=" cdhover";}
cdrCat[i].onmouseout=function(){this.className=this.className.replace(new RegExp(" cdhover\\b"),"");}}}}}
function showScrollBar(){if(!document.getElementById('copyInner'))return false;if(!document.getElementById('main_2'))return false;if(!document.getElementById('scrollbar'))return false;document.getElementById('main_2').style.overflow='hidden';if(document.getElementById('copyInner').offsetHeight>414){document.getElementById('scrollbar').style.display='block';}}
function moveSlider(){if(!document.getElementById('copyInner'))return false;if(!document.getElementById('pageup'))return false;if(!document.getElementById('pagedown'))return false;document.getElementById('pageup').onmouseover=function(){pos=document.getElementById('copyInner').style.top;scrollerUp('copyInner',pos);}
document.getElementById('pageup').onmouseout=function(){terminateTimer();}
document.getElementById('pagedown').onmouseover=function(){pos=document.getElementById('copyInner').style.top;scrollerDown('copyInner',pos);}
document.getElementById('pagedown').onmouseout=function(){terminateTimer();}}
var timerID=null;function scrollerUp(page,pos){if(typeof pos=="string"){pos=pos.replace('px','');pos=1*pos;}
if((pos*-1)>0){pos=eval(pos+45);}
document.getElementById(page).style.top=pos+"px";timerID=window.setTimeout('scrollerUp("copyInner",'+pos+')',100);}
function scrollerDown(page,pos){if(typeof pos=="string"){pos=pos.replace('px','');}
if((pos*-1)<(document.getElementById(page).offsetHeight-(document.getElementById(page).parentNode.offsetHeight/2))){pos=eval(pos-45);}
document.getElementById(page).style.top=pos+"px";timerID=window.setTimeout('scrollerDown("copyInner",'+pos+')',100);}
function terminateTimer(){window.clearTimeout(timerID);}
function imageSwitch(){if(!document.getElementById('productImages'))return false;var aList=document.getElementById('productImages').getElementsByTagName('a');for(var i=0;i<aList.length;i++){aList[i].onclick=function(){document.getElementById('mainImg').src=this.getAttribute('href');for(var j=0;j<aList.length;j++){aList[j].className=('');}
this.className=('selected');return false;}}}
function divSwitch(){if(!document.getElementById('contentSidebarNav'))return false;if(!document.getElementById('features-benefits'))return false;if(!document.getElementById('available-options'))return false;if(!document.getElementById('available-models'))return false;document.getElementById('features-benefits').style.display='none';document.getElementById('available-options').style.display='none';document.getElementById('available-models').style.display='none';var aList=document.getElementById('contentSidebarNav').getElementsByTagName('a');for(var i=0;i<aList.length;i++){aList[i].onclick=function(){for(var j=0;j<aList.length;j++){aList[j].className=('');document.getElementById(aList[j].getAttribute('rel')).style.display='none';}
document.getElementById(this.getAttribute('rel')).style.display='block';this.className=('selected');return false;}}}
function circleImageSwitch(){if(!document.getElementById('circleImg'))return false;if(!document.getElementById('circleNav'))return false;var aList=document.getElementById('circleNav').getElementsByTagName('a');var locationBegin='/images/products/circleNav-';var locationEnd='img.jpg';for(var i=0;i<aList.length;i++){aList[i].onmouseover=function(){document.getElementById('circleImg').src=locationBegin+this.id.replace("pclnk","")+locationEnd;return false;}}}
function tableRowColor(){if(!document.getElementsByTagName)return false;if(!document.getElementsByTagName('thead'))return false;if(!document.getElementsByTagName('tr'))return false;var trList=document.getElementsByTagName('tr');var theadList=document.getElementsByTagName('thead');for(var i=0;i<trList.length;i++){if(i%2==0){trList[i].className='row2';}
else{trList[i].className='row1';}}
for(var j=0;j<theadList.length;j++){theadList[j].onclick=function(){for(var k=0;k<trList.length;k++){if(k%2==0){trList[k].className='row2';}
else{trList[k].className='row1';}}}}}
function initializeFlash(){if(!document.getElementById)return false;if(document.getElementById('flashcontent')){var so=new SWFObject("/swf/loader.swf","flash","490","414","8","#fff");so.addParam("wmode","transparent");so.write("flashcontent");}
if(document.getElementById('flashcontentde')){var sode=new SWFObject("/swf/bhs-rotation-german.swf","flash","451","401","8","#fff");sode.addParam("wmode","transparent");sode.write("flashcontentde");}
if(document.getElementById('flashcontentes')){var soes=new SWFObject("/swf/bhs-rotation-spanish.swf","flash","451","401","8","#fff");soes.addParam("wmode","transparent");soes.write("flashcontentes");}
if(document.getElementById('flashcontentfr')){var sofr=new SWFObject("/swf/bhs-rotation-french.swf","flash","451","401","8","#fff");sofr.addParam("wmode","transparent");sofr.write("flashcontentfr");}}
function clearSearchBox(){if(!document.getElementById)return false;if(!document.getElementById('txtSearch'))return false;document.getElementById('txtSearch').onfocus=function(){if(document.getElementById('txtSearch').value=='SEARCH'){document.getElementById('txtSearch').value='';}}}
function clearOtherBox(){if(!document.getElementById)return false;if(!document.getElementById('txtOther'))return false;document.getElementById('txtOther').onfocus=function(){document.getElementById('txtOther').value=''}}
addLoadEvent(strictNewWindow);addLoadEvent(replaceAlign);addLoadEvent(replaceTarget);addLoadEvent(hdrHover);addLoadEvent(cdHover);addLoadEvent(showScrollBar);addLoadEvent(moveSlider);addLoadEvent(imageSwitch);addLoadEvent(divSwitch);addLoadEvent(circleImageSwitch);addLoadEvent(tableRowColor);addLoadEvent(initializeFlash);addLoadEvent(clearSearchBox);addLoadEvent(clearOtherBox);
