$(document).ready(function()
{osdet();iehover();vatToggle();});jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};function osdet(){if(navigator.appVersion.indexOf("Win")!=-1)OSName="Windows";if(navigator.appVersion.indexOf("Mac")!=-1)OSName="MacOS";if(navigator.appVersion.indexOf("X11")!=-1)OSName="UNIX";if(navigator.appVersion.indexOf("Linux")!=-1)OSName="Linux";}
$(function(){$(".nojs").hide();});$(document).ready(iehover);function iehover(){if($.browser.msie){$("#nav li").hover(function(){$(this).addClass("hover");},function(){$(this).removeClass("hover");})};}
$(function(){if($.browser.msie){$(".mBasketItem").bind("mouseover",function(){$(this).css({background:"4a4a4a"});});$(".mBasketItem").bind("mouseout",function(){$(this).css({background:"none"});});}})
function iehover()
{if($.browser.msie)
{$("#nav li").hover(function()
{$(this).addClass("hover");$("select").css("display","none");},function()
{$(this).removeClass("hover");$("select").css("display","block");});$("#guidedNav li").hover(function()
{$(this).addClass("hover");$("select").css("display","none");},function()
{$(this).removeClass("hover");$("select").css("display","block");});}}
$(function(){$("#azIndex").click(function(){$("#indexWindow").show();$("#indexWindow").css("position","absolute");$("#indexWindow").css("z-index","9999");return false;});});$(function(){$("#closeIndex").click(function(){$("#indexWindow").hide();return false;});});$(function(){if($.browser.msie){$("div.catMenuTrigger").hover(function(){$(this).addClass("iehover");},function(){$(this).removeClass("iehover");})}});$(function(){$(".pictorals ul").css("-moz-border-radius-bottomleft","6px");$(".pictorals ul").css("-moz-border-radius-bottomright","6px");});function getY(oElement){var yReturnValue=0;while(oElement!=null){yReturnValue+=oElement.offsetTop;oElement=oElement.offsetParent;}return yReturnValue;}function getX(oElement)
{var xReturnValue=0;while(oElement!=null){xReturnValue+=oElement.offsetLeft;oElement=oElement.offsetParent;}return xReturnValue;}
$(function(){$(".pictoralHover").click(function(){$(".pictorals").fadeOut("fast");var listoget=this.name;var wheret=getY(this);wherel=getX(this);var listtoshow=document.getElementById(listoget+'_dropdowns');listtoshow.style.display='block';listtoshow.style.position='absolute';listtoshow.style.top=wheret+"px";listtoshow.style.left=(wherel-15)+"px";return false;});});$(function(){$(".pictorals h4").click(function(){$(".pictorals").fadeOut("fast");return false;});});$(function(){$(window).resize(function(){$(".pictorals").hide();});});var vatToggleVal=null;var vatToggleInProgress=false;function vatToggle()
{var value=$.cookie('EBVATPrice');if(value==0){toggleVATPrices('ex')}
else{toggleVATPrices('inc');}
$("#vatToggle").click(function(){if(vatToggleVal==1){toggleVATPrices('ex');}
else{toggleVATPrices('inc');}});}
function toggleVATPrices(option)
{if(vatToggleInProgress==true)return false;vatToggleInProgress=true;vatToggleVal=(option=='inc'?1:0);$.cookie('EBVATPrice',vatToggleVal,{expires:+365,path:'/',domain:'ebuyer.com'});if(option=="inc")
{$(".ex").hide();$(".inc").show();$("#vatToggle").html("Show &nbsp;ex vat prices");}
else{$(".inc").hide();$(".ex").show();$("#vatToggle").html("Show inc vat prices");}
$("#vatToggle").show();vatToggleInProgress=false;return false;}
$(function(){$('.clickable').click(function(){if(this.id==""){var curon=document.getElementById('on');curon.id="";this.id="on";$(this).next('div').slideToggle('fast').siblings('div.hideable:visible').slideUp('fast');return false;}else{return false;}});});$(function(){$("#specsTable tr:even").addClass("alt");});$(function(){$("#specsTable tr").hover(function(){$(this).addClass("trhov");},function(){$(this).removeClass("trhov");});});$(function(){$("div.whiteBox ol li").hover(function(){$(this).addClass("sbhov");},function(){$(this).removeClass("sbhov");});});$(function(){$("#leftCol li").hover(function(){$(this).addClass("pshov");},function(){$(this).removeClass("pshov");});});$(function(){$("#loginOptions li").hover(function(){$(this).addClass("pshov");},function(){$(this).removeClass("pshov");});});$(function(){if($.browser.msie){$(".helpTip").prepend("<img src='/images/yellow_tip_pointer.gif' />");};});$(function(){if($.browser.msie){$(".tips").prepend("<img src='/images/yellow_tiptop_pointer.gif' />");};});function checkbox(j){var compareform=document.compareItems;var total=0;for(var i=0;i<compareform.ckb.length;i++){if(compareform.ckb[i].checked){total+=1;}if(total>4){alert("Only 4 items can be compared at any one time.");j.checked=false;return false;}}}
$(function(){$('.compareProduct').click(function(){checkbox(this);});});$(function(){$("form#sortBy select").change(function(){this.form.submit();});});$(function(){$("form#pageSelect select").change(function(){this.form.submit();});});$(function(){$("form#sortByNG select").change(function(){this.form.submit();});});$(function(){$("form#pageSelectNG select").change(function(){this.form.submit();});});$(function(){$("input").focus(function(){$(this).parent().addClass("lovely");});});$(function(){$("input").blur(function(){$(this).parent().removeClass("lovely");});});$(document).ready(DisableAutoCompleteAddress);function DisableAutoCompleteAddress(){var result=$('#AutoCompleteResult').attr('value');if(typeof result=='undefined')
{$('.AutoCompleteAddressField').attr("disabled",true);}}
$(function(){$(".closethis").click(function(){$("#returningCustomer").fadeOut();})});function KingstonConfigurator_UK(){winpops=window.open("http://www.ec.kingston.com/ecom/config/default.asp?referid=672","KingstonConfigurator","scrollbars=yes,width=750,height=650");}
$(document).ready(function(){$("#tvlink").click(function(){$(".tvfaq").show();$("#tvlink").addClass('faqActive');$("#faqlink").removeClass('faqActive');$(".faq").hide();});$("#faqlink").click(function(){$("#faqlink").addClass('faqActive');$("#tvlink").removeClass('faqActive');$(".tvfaq").hide();$(".faq").show();});});function updateOrderDeadlineCountdown(){if(typeof(orderDeadlineData)!="undefined"){var d=new Date();var newTimeout=1000;var currentTimeDifference=orderDeadlineData.cutoffEpochTime-Math.round(d.getTime()/1000)+orderDeadlineData.correction;if(currentTimeDifference<0){}else{var days='0'+Math.floor((currentTimeDifference)/86400);days=days.substring(days.length-2);var hours='0'+Math.floor((currentTimeDifference%86400)/3600);hours=hours.substring(hours.length-2);var minutes='0'+Math.floor((currentTimeDifference%3600)/60);minutes=minutes.substring(minutes.length-2);var seconds='0'+currentTimeDifference%60;seconds=seconds.substring(seconds.length-2);var delClock=document.getElementById(orderDeadlineData.counterId);var pos1='',pos2='',pos3='';var pos1Label='',pos2Label='',pos3Label='';if(days>0){newTimeout=(seconds>0?seconds:60)*1000;pos1=days;pos2=hours;pos3=minutes;pos1Label=' days ';pos2Label=' hours ';pos3Label=' minutes ';if(delClock.className.indexOf('delClockDays')==-1){delClock.className+=' delClockDays';}}else{pos1=hours;pos2=minutes;pos3=seconds;pos1Label=' hours ';pos2Label=' minutes ';pos3Label=' seconds ';if(delClock.className.indexOf('delClockDays')!=-1){delClock.className=delClock.className.replace('delClockDays','');}}
for(var i=0;i<delClock.childNodes.length;i++){switch(delClock.childNodes[i].className){case'pos1':if(delClock.childNodes[i].firstChild.nodeValue!=pos1){delClock.childNodes[i].firstChild.nodeValue=pos1;}
if(delClock.childNodes[i].nextSibling.firstChild.nodeValue!=pos1Label){delClock.childNodes[i].nextSibling.firstChild.nodeValue=pos1Label;}
break;case'pos2':if(delClock.childNodes[i].firstChild.nodeValue!=pos2){delClock.childNodes[i].firstChild.nodeValue=pos2;}
if(delClock.childNodes[i].nextSibling.firstChild.nodeValue!=pos2Label){delClock.childNodes[i].nextSibling.firstChild.nodeValue=pos2Label;}
break;case'pos3':if(delClock.childNodes[i].firstChild.nodeValue!=pos3){delClock.childNodes[i].firstChild.nodeValue=pos3;}
if(delClock.childNodes[i].nextSibling.firstChild.nodeValue!=pos3Label){delClock.childNodes[i].nextSibling.firstChild.nodeValue=pos3Label;}
break;}}
setTimeout('updateOrderDeadlineCountdown()',newTimeout);}}}
