/*
Author: Scott Hills
*/
function redrawMain(currentMain){$('.productWrap').before($('.productWrap > .topbar'));$('#thumbs .thumb img').click(function(){name=$(this).attr('name');$('#mainimage #'+currentMain).hide();$('#mainimage #'+name).fadeIn('fast');currentMain=name;});var imageArr=[];var arrIdx=0;var imgCnt=0;$('#mainimage .productimage').each(function(i){imageArr[i]=$(this).attr('id');imgCnt++;});if(imgCnt>1){$('.leftarrow').show();$('.rightarrow').show();$('.leftarrow').click(function(){arrIdx--;if((arrIdx)<0){arrIdx=(imageArr.length-1);}
$('.thumb img[name='+imageArr[arrIdx]+']').click();});$('.rightarrow').click(function(){arrIdx++;if((arrIdx)>=imageArr.length){arrIdx=0;}
$('.thumb img[name='+imageArr[arrIdx]+']').click();});}else{$('.leftarrow').hide();$('.rightarrow').hide();}
$('.specicons li img').each(function(){this.onmouseover=function(){var clickedpos=$(this).position();$('#iconsoverlay span').html($(this).attr("alt"));$('#iconsoverlay').css({left:clickedpos.left,bottom:clickedpos.top+48}).show();};this.onmouseout=function(){$('#iconsoverlay').hide();};});}
var currentWidth=715;function adjustTopBar(x){if(($(x).width()>547)||(currentWidth==547)){$(x).css({width:547,lineHeight:'22px'});currentWidth=547;}}
function redrawCompatibility(){var offset=0;$('#dr_tab2Content .category ul').each(function(){var parentClass=$(this).parent().attr('class');columns=parseInt(parentClass.charAt(9));switch(columns){case 4:width=154;break;case 8:width=77;break;default:width=77;}
$(this).children('.subcat:not(:first)').each(function(){$(this).before("<li> </li>");});var rows=Math.ceil(($(this).children().length/columns));if($(this).children().length<=4){rows=$(this).children().length;}
if(($(this).children().length>4)&&($(this).children().length<=8)){rows=4;}
$(this).css({height:(rows*16)});$(this).children().each(function(index){row=(index%rows);column=Math.floor(index/rows);$(this).css({position:"absolute",top:(row*14)+offset,left:(column*width)+6});});});}