if(document.images){var imgHovers=new Array(20);} function sOn(trName,id){ document.getElementById(trName).style.backgroundImage='url('+imgHovers[id].src+')';} function lOn(id){ var lName='l'+id+''; var lcatName='lcat'+id+''; var mltName='mlt'+id+''; document.getElementById(lName).style.backgroundColor='#EFEFEF'; document.getElementById(mltName).style.background='transparent'; document.getElementById(lcatName).style.visibility='visible';} var hh=0; var hm=-430; var inter; var close="yes"; var button_clicked; var bounce="no"; function sUniforms(){ if(document.getElementById('hovermenu_border').style.visibility=='visible' && close=="yes"){ hUniforms(); } else{ if(hm>=0 || bounce=="up" || bounce=="down" || bounce=="done"){ if(hm>=0){hm=0;} if(bounce=="no"){bounce="up";} if(bounce=="up"){ hm-=10; document.getElementById('hovermenu_border').style.backgroundPosition = hm + 'px 0px'; if(hm==-70){bounce="down";} } else if(bounce=="down"){ hm+=5; document.getElementById('hovermenu_border').style.backgroundPosition = hm + 'px 0px'; if(hm==0){bounce="done";} } else if(bounce=="done"){ document.getElementById('umenu').style.visibility='visible'; clearInterval(inter); close="yes"; document.getElementById(button_clicked).onclick=function(){inter=setInterval('sUniforms()',1);return false;}; return; alert("hello"); } } else{ close="no"; hh+=50; hm+=50; document.getElementById('hovermenu_border').style.height = hh + 'px'; document.getElementById('hovermenu_border').style.backgroundPosition = hm + 'px 0px'; document.getElementById('hovermenu_border').style.visibility='visible'; document.getElementById('uniform_button_link').style.backgroundPosition='170px 0px'; document.getElementById(button_clicked).onclick=''; if(typeof document.forms['popular_colours_s']!="undefined"){document.getElementById('popular_colours_s').style.visibility='hidden';} if(typeof document.forms['province_s']!="undefined"){document.getElementById('province_s').style.visibility='hidden';} if(typeof document.forms['order_by']!="undefined"){document.getElementById('hide_order_by').style.visibility='hidden';} if(typeof document.forms['filter_colour']!="undefined"){document.getElementById('hide_colour').style.visibility='hidden';} if(typeof document.forms['frmShip']!="undefined"){document.getElementById('frmShip').style.visibility='hidden';} if(typeof document.forms['cart_form']!="undefined"){document.getElementById('cart_form').style.visibility='hidden';} }}} function hUniforms(){ hh=0; hm=-430; bounce="no"; close="no"; clearInterval(inter); document.getElementById('hovermenu_border').style.visibility='hidden'; document.getElementById('umenu').style.visibility='hidden'; document.getElementById('uniform_button_link').style.backgroundPosition=''; document.getElementById(button_clicked).onclick=function(){inter=setInterval('sUniforms()',3);return false;}; if(typeof document.forms['popular_colours_s']!="undefined"){document.getElementById('popular_colours_s').style.visibility='visible';} if(typeof document.forms['province_s']!="undefined"){document.getElementById('province_s').style.visibility='visible';} if(typeof document.forms['order_by']!="undefined"){document.getElementById('hide_order_by').style.visibility='visible';} if(typeof document.forms['filter_colour']!="undefined"){document.getElementById('hide_colour').style.visibility='visible';} if(typeof document.forms['frmShip']!="undefined"){document.getElementById('frmShip').style.visibility='visible';} if(typeof document.forms['cart_form']!="undefined"){document.getElementById('cart_form').style.visibility='visible';}} function changeHover(bg,hoverid){ if(bg==2){bg=''} else{bg='#994D00'} document.getElementById(hoverid).style.backgroundColor=bg;} function lOff(id){ var lName='l'+id+''; var lcatName='lcat'+id+''; var mltName='mlt'+id+''; document.getElementById(lName).style.background='transparent'; document.getElementById(lcatName).style.visibility='hidden';} function sCat(id){document.getElementById(id).style.visibility='visible';} function hCat(id){document.getElementById(id).style.visibility='hidden';} var time; var ttime; var sheight=0; oheights="do"; var started="no"; var sbounce="no"; function sideMenus(head){ document.getElementById(head).style.background='url(/images/layout/side_header.jpg)'; document.getElementById(head).style.backgroundPosition='170px 0px'; } function delayMenus(id,head){ document.getElementById('nh').onclick=''; document.getElementById('tvh').onclick=''; document.getElementById('sbh').onclick=''; document.getElementById('eph').onclick=''; if(document.getElementById(id).style.visibility=='visible'){return;} else{ time=setInterval("showSide('"+id+"','"+head+"')",1); return false;}} function showSide(id,head){ started="yes"; if(sheight>=350 || sbounce=="up" || sbounce=="down" || sbounce=="done"){ if(sbounce=="no"){sheight=350;sbounce="up";} if(sbounce=="up"){ sheight-=10; document.getElementById(id).style.height = sheight + 'px'; if(sheight==310){sbounce="down";}} else if(sbounce=="down"){ sheight+=5; document.getElementById(id).style.height = sheight + 'px'; if(sheight>=350){sbounce="done";}} else if(sbounce=="done"){ sheight=0; oheights="do"; started="no"; sbounce="no"; document.getElementById('nh').onclick=function(){delayMenus('navigate','nh');}; document.getElementById('tvh').onclick=function(){delayMenus('top_view','tvh');}; document.getElementById('sbh').onclick=function(){delayMenus('side_quote','sbh');}; document.getElementById('eph').onclick=function(){delayMenus('side_ep','eph');}; clearInterval(time); return; }} else{ if(oheights=="do"){ if(document.getElementById('navigate')!=null){document.getElementById('navigate').style.visibility='hidden';document.getElementById('navigate').style.height='0.1em';} if(document.getElementById('top_view')!=null){document.getElementById('top_view').style.visibility='hidden';document.getElementById('top_view').style.height='0.1em';} if(document.getElementById('side_quote')!=null){document.getElementById('side_quote').style.visibility='hidden';document.getElementById('side_quote').style.height='0.1em';} if(document.getElementById('side_ep')!=null){document.getElementById('side_ep').style.visibility='hidden';document.getElementById('side_ep').style.height='0.1em';} oheights="done";} if(sheight==200){ document.getElementById(id).style.visibility='visible';} sheight+=50; document.getElementById(id).style.height = sheight + 'px'; }} function hsBack(head){ if(started=="no"){ document.getElementById('nh').onclick=function(){delayMenus('navigate','nh');}; document.getElementById('tvh').onclick=function(){delayMenus('top_view','tvh');}; document.getElementById('sbh').onclick=function(){delayMenus('side_quote','sbh');}; document.getElementById('eph').onclick=function(){delayMenus('side_ep','eph');};} document.getElementById(head).style.background='url(/images/layout/side_header.jpg)'; document.getElementById(head).style.backgroundPosition='0px 0px'; } function loadMenuImg(){ imgHovers['15']=new Image();imgHovers['15'].src="/images/styles/bags.jpg";imgHovers['31']=new Image();imgHovers['31'].src="/images/styles/corporate.jpg";imgHovers['12']=new Image();imgHovers['12'].src="/images/styles/gifts.jpg";imgHovers['1']=new Image();imgHovers['1'].src="/images/styles/hat.jpg";imgHovers['58']=new Image();imgHovers['58'].src="/images/styles/healthcare.jpg";imgHovers['55']=new Image();imgHovers['55'].src="/images/styles/sweat.jpg";imgHovers['11']=new Image();imgHovers['11'].src="/images/styles/hospitality.jpg";imgHovers['2']=new Image();imgHovers['2'].src="/images/styles/jacket.jpg";imgHovers['7']=new Image();imgHovers['7'].src="/images/styles/knitwear.jpg";imgHovers['16']=new Image();imgHovers['16'].src="/images/styles/fleece.jpg";imgHovers['3']=new Image();imgHovers['3'].src="/images/styles/polo.jpg";imgHovers['13']=new Image();imgHovers['13'].src="/images/styles/schoolwear.jpg";imgHovers['4']=new Image();imgHovers['4'].src="/images/styles/shirting.jpg";imgHovers['5']=new Image();imgHovers['5'].src="/images/styles/skirt.jpg";imgHovers['6']=new Image();imgHovers['6'].src="/images/styles/sports.jpg";imgHovers['8']=new Image();imgHovers['8'].src="/images/styles/tee.jpg";imgHovers['9']=new Image();imgHovers['9'].src="/images/styles/trouser.jpg";imgHovers['14']=new Image();imgHovers['14'].src="/images/styles/vests.jpg";imgHovers['10']=new Image();imgHovers['10'].src="/images/styles/workwear.jpg";} var xmlHttp;var nocache=0;var fav_form='';var cart_form='';var scrollLocation=0;var oldScrollLocation=0;var hoveredSuggestion="";var newSuggestion="search-";var elementId="";var box_id="";var innerElementPrefix="search-"; function GetXmlHttpObject(){ var xmlHttp=null; try{xmlHttp=new XMLHttpRequest();} catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");} catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}} return xmlHttp; } function showResult(str,event,search_box,boxId){ elementId=search_box; box_id=boxId; if(str.length==0){ if(document.getElementById('livesearch')!=null && document.getElementById('livesearch').style.visibility=='visible'){ document.getElementById('livesearch').style.visibility='hidden'; document.getElementById('livesearch').innerHTML=''; if(typeof document.forms['order_by']!="undefined"){document.getElementById('hide_order_by').style.visibility='visible';} } else if(document.getElementById('livesearch_admin')!=null && document.getElementById('livesearch_admin').style.visibility=='visible'){ document.getElementById('livesearch_admin').style.visibility='hidden'; document.getElementById('livesearch_admin').innerHTML=''; } else if(document.getElementById('livesearch_matching')!=null && document.getElementById('livesearch_matching').style.visibility=='visible'){ document.getElementById('livesearch_matching').style.visibility='hidden'; document.getElementById('livesearch_matching').innerHTML=''; }return} else if((event.keyCode==40 || event.keyCode==38) && elementId!='livesearch_admin' && elementId!='livesearch_matching'){ checkForScroll(event, elementId, innerElementPrefix);} else if(event.keyCode!=37 && event.keyCode!=39){ hoveredSuggestion=str; document.getElementById(box_id).setAttribute("autocomplete","off"); xmlHttp=GetXmlHttpObject() if(xmlHttp==null){ alert ("Browser does not support HTTP Request"); return} var url="/"+elementId+".php"; url=url+"?q="+str; url=url+"&box="+box_id; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); scrollLocation=0; oldScrollLocation=0;}} function stateChanged(){ if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ document.getElementById(elementId).style.visibility='visible'; document.getElementById(elementId).innerHTML=xmlHttp.responseText; if(typeof document.forms['order_by']!="undefined"){document.getElementById('hide_order_by').style.visibility='hidden';}}} function checkForScroll(event, elementId, innerElementPrefix){ var el=document.getElementById(elementId); if(!el){return;} if(event.keyCode==40){ if(document.getElementById(innerElementPrefix+(scrollLocation+1))!=null){ oldScrollLocation=scrollLocation; scrollLocation=scrollLocation+1; if(document.getElementById(innerElementPrefix+(oldScrollLocation))!=null){ document.getElementById(innerElementPrefix+(oldScrollLocation)).className='';} document.getElementById(innerElementPrefix+(scrollLocation)).className='hovered'; document.getElementById(box_id).value=document.getElementById(innerElementPrefix+(scrollLocation)).innerHTML;}} else if(event.keyCode==38 && (scrollLocation-1)==0){ document.getElementById(box_id).value=hoveredSuggestion; document.getElementById(innerElementPrefix+(scrollLocation)).className='';} else if(event.keyCode==38){ if(document.getElementById(innerElementPrefix+(scrollLocation-1))!=null){ oldScrollLocation=scrollLocation; scrollLocation=scrollLocation-1; if(document.getElementById(innerElementPrefix+(oldScrollLocation))!=null){ document.getElementById(innerElementPrefix+(oldScrollLocation)).className='';} document.getElementById(innerElementPrefix+(scrollLocation)).className='hovered'; document.getElementById(box_id).value=document.getElementById(innerElementPrefix+(scrollLocation)).innerHTML;}}} function insert(prod_no,form_number){ fav_form=form_number; xmlHttp=GetXmlHttpObject() nocache=Math.random(); xmlHttp.open('get', '/products/insert_fav.php?prod_no='+prod_no+'&nocache='+nocache); xmlHttp.onreadystatechange=insertReply; xmlHttp.send(null);} function insertReply(){ if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ document.getElementById(fav_form).innerHTML=xmlHttp.responseText;}} function insertCart(id,form_number){ cart_form=form_number; xmlHttp=GetXmlHttpObject() nocache=Math.random(); xmlHttp.open('get', '/products/insert_cart.php?id='+id+'&nocache='+nocache); xmlHttp.onreadystatechange=insertCartReply; xmlHttp.send(null);} function insertCartReply(){ if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ document.getElementById(cart_form).innerHTML=xmlHttp.responseText; getCartInfo('single');}} u_qtyoq=0; u_qtylogo=0; function setCartInfo(oq,logo){ u_qtyoq=oq; u_qtylogo=logo;} function getCartInfo(type){ if(type='single'){u_qtyoq++;} document.getElementById('qtyoq').innerHTML=u_qtyoq; document.getElementById('qtylogo').innerHTML=u_qtylogo; document.getElementById('cart_info').style.display='block';} //remove from favourites function removeFav(id){ xmlHttp=GetXmlHttpObject() // Set the random number to add to URL request nocache = Math.random(); // Pass the login variables like URL variable xmlHttp.open('get', '/products/remove_fav.php?id='+id+'&nocache='+nocache); xmlHttp.send(null);} function stoperror(){return true} window.onerror=stoperror