var pers=null;var tf=null;var mi=null;var wmp=null;var wvpc='';var wvpt='Product';var EventCache=function(){var listEvents=[];return{listEvents:listEvents,add:function(node,sEventName,fHandler){listEvents.push(arguments);},flush:function(){var i,item;for(i=listEvents.length-1;i>=0;i--){item=listEvents[i];if(item[0].removeEventListener){item[0].removeEventListener(item[1],item[2],false);};if(item[1].substring(0,2)!='on'){item[1]='on'+item[1];};if(item[0].detachEvent){item[0].detachEvent(item[1],item[2]);};item[0][item[1]]=null;};}};}();function addEvent(obj,evType,fn){if(typeof fn!='function')return false;var result;if(obj.addEventListener){obj.addEventListener(evType,fn,false);result=true;}else if(obj.attachEvent){result=obj.attachEvent('on'+evType,fn);}else{return false;}EventCache.add(obj,evType,fn,false);return result;}function toggleField(field,showField,reset){var title=document.getElementById(field);if(title){title.style.display=showField?'block':'none';if(reset&&reset==true)title.value='';}}function bAction(field,page,qst,dval,cid){var tField=document.getElementById(field);var sQS='';if(tField&&tField.value!=''&&(dval&&tField.value!=dval)){sQS=URLEncode(tField.value);if(sQS)document.location.href=page+'?'+qst+'='+sQS+(cid?'&cid='+cid:'');}}function kEnter(e){var keyNum;if(window.event)keyNum=e.keyCode;else if(e.which)keyNum=e.which;if(keyNum==13)return true;return false;}function bClick(e,buttonid){if(kEnter(e)){var bt=document.getElementById(buttonid);if(bt&&typeof bt=='object'){bt.click();return false;}}return true;}function externalLinks(){if(!document.getElementsByTagName)return;var anchors=document.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.getAttribute('href')&&anchor.getAttribute('rel')=='external')anchor.target='_blank';}}function checkQuantities(fName){var rc=false;if(document.getElementById){var frm=document.getElementById(fName);for(i=0;i<frm.elements.length;i++){var em=frm.elements[i];if(em.type=='text'&&em.id.indexOf('qty_')==0){if(em.value.length>0){var va=parseInt(em.value);if(!isNaN(va)&&va>0){rc=true;break;}}}}}if(!rc)alert('Please enter a valid quantity for one or more products.');return rc;}function tellFriend(id){var url='TellAFriend.aspx?ProductID='+id;var width=600;var height=450;var left=((screen.width-width)/2);var top=((screen.height-height)/2);var options='status=no,scrollbars=yes,resizable=no,menubar=no,left='+left+',top='+top+',width='+width+',height='+height;if(tf==null||tf.closed)tf=window.open(url,'TellAFriend',options);tf.focus();}function catTellFriend(cat,pg){var url='TellAFriend.aspx?Catalogue='+cat;if(pg)url+='&page='+pg;var width=600;var height=450;var left=((screen.width-width)/2);var top=((screen.height-height)/2);var options='status=no,scrollbars=yes,resizable=no,menubar=no,left='+left+',top='+top+',width='+width+',height='+height;if(tf==null||tf.closed)tf=window.open(url,'TellAFriend',options);tf.focus();return false;}
function moreInfo(id){var url='PopupMoreInformation.aspx?ProductID='+id;var width=350;var height=350;var left=((screen.width-width)/2);var top=((screen.height-height)/2);var options='status=no,scrollbars=yes,resizable=no,menubar=no,left='+left+',top='+top+',width='+width+',height='+height;if(mi==null||mi.closed)mi=window.open(url,'MoreInfoPopup',options);mi.focus();}function helpInfo(id){var url='PopupMoreInformation.aspx?helpid='+id;var width=350;var height=350;var left=((screen.width-width)/2);var top=((screen.height-height)/2);var options='status=no,scrollbars=yes,resizable=no,menubar=no,left='+left+',top='+top+',width='+width+',height='+height;if(mi==null||mi.closed)mi=window.open(url,'MoreInfoPopup',options);mi.focus();}function personalise(id){var url='PopupPersonaliseProd.aspx'+(id?'?ProductID='+id:'');var width=600;var height=400;var left=((screen.width-width)/2);var top=((screen.height-height)/2);var options='status=no,scrollbars=yes,resizable=no,menubar=no,left='+left+',top='+top+',width='+width+',height='+height;if(pers==null||pers.closed)pers=window.open(url,'PersonalisePopup',options);pers.focus();}function closePopups(){if(pers!=null)pers.close();if(tf!=null)tf.close();if(mi!=null)mi.close();if(wmp!=null&&wmp&&wmp.js_wasp_amReady_ask()&&wmp.js_wasp_getPlayerState().status==1)wmp.js_wasp_stop();}function clickPlay(pc){if(!wmp)wmp=document.getElementById('wasp');if(wmp&&wmp.js_wasp_amReady_ask()&&wmp.js_wasp_getPlayerState().init==0)wmp.js_wasp_play();wmptr('Video_Button');}function wmptr(enm){if(typeof _gaq=='object'&&_gaq&&wvpc&&wvpc.length>0)_gaq.push(['_trackEvent',wvpt+enm,wvpc]);}function wasp_trackLaunched(ro){wmptr('Video_Start');}function swap(img,n){img.src=n;}function URLEncode(s){var safe="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";var hex="0123456789ABCDEF";var enc='';for(var i=0;i<s.length;i++){var ch=s.charAt(i);if(ch==' ')enc+='+';else if(safe.indexOf(ch)!=-1)enc+=ch;else{var charCode=ch.charCodeAt(0);if(charCode>255)enc+='+';else{enc+="%";enc+=hex.charAt((charCode>>4)&0xF);enc+=hex.charAt(charCode&0xF);}}}return enc;}addEvent(window,'unload',closePopups);addEvent(window,'load',externalLinks);
