var flstate='F'; var fldata='';
function showhidefeaturelist(){
 if (flstate=='F'){
  fldata=document.getElementById('featurelist').innerHTML;
  fldata=fldata.replace('<b>Quooker colour guide</b><p></p><ul><li>6 Quooker colour finishes</li></ul>','<table cellspacing=\"0\" cellpadding=\"2\" style=\"font-size:11px;background-color:#dddcde;\"><tr align=\"center\"><td colspan=\"3\">Quooker colour guide</td></tr>'+
    '<tr align=\"center\"> <td><img src=\"shopimages/products/colours/quooker/PolishedChrome.jpg\"></td> <td><img src=\"shopimages/products/colours/quooker/SatinChrome.jpg\"></td> <td><img src=\"shopimages/products/colours/quooker/StainlessSteelEffect.jpg\"></td> </tr>'+
    '<tr align=\"center\"> <td>Polished chrome</td> <td>Satin Chrome</td> <td>Stainless steel effect</td> </tr>'+
    '<tr align=\"center\"> <td><img src=\"shopimages/products/colours/quooker/BrushedChrome.jpg\"></td> <td><img src=\"shopimages/products/colours/quooker/GoldPlatedBrass.jpg\"></td> <td><img src=\"shopimages/products/colours/quooker/Bronze.jpg\"></td> </tr>'+
    '<tr align=\"center\"> <td>Brushed chrome</td> <td>Gold-plated brass</td> <td>Bronze</td> </tr></table>');
  flstate='S';
 }
 if (flstate=='S'){ flstate='H';
  document.getElementById('featurelist').innerHTML='<p></p><div onclick\=\"javascript:showhidefeaturelist()\;\" style=\"cursor:pointer;color:#ff0000\;text-decoration:underline\;\">Show full feature list</div>';
 }
 else{ flstate='S';
  document.getElementById('featurelist').innerHTML='<p></p><div onclick\=\"javascript:showhidefeaturelist()\;\" style=\"cursor:pointer;color:#ff0000\;text-decoration:underline\;\">Hide feature list</div><p></p>'+fldata;
 }
}

function reduce(){
 document.getElementById('enlarge').innerHTML='';
 document.getElementById('enlarge').style.marginTop='0px';
 document.getElementById('enlarge').style.backgroundColor='';
 document.getElementById('enlarge').style.padding='0px';
 document.getElementById('enlarge').style.border='0px';
 document.getElementById('fader').style.opacity=1; document.getElementById('fader').style.filter=''; 
}

function enlarge(largeimage,code,description,techdiagram){
 document.getElementById('fader').style.opacity=0.2; document.getElementById('fader').style.filter='alpha(Opacity=20)';
 document.getElementById('enlarge').style.marginTop='70px';
 document.getElementById('enlarge').style.backgroundColor='#ffffff';
 document.getElementById('enlarge').style.padding='10px';
 document.getElementById('enlarge').style.border='2px solid #91c39d';
 if(techdiagram.indexOf('NOIMAGE')!=-1){imagemenu='';}else{
  imagemenu='<table width=\"100%\" style=\"color:#993399;font-size:12px;\"><tr><td><span onmouseover=\"this.style.cursor=\'pointer\';\" onclick=\"javascript:document.getElementById(\'enlargedimage\').src=\''+largeimage+'\';\"><u>Show product image</u></span></td>'+
   '<td><span onmouseover=\"this.style.cursor=\'pointer\';\" onclick=\"javascript:document.getElementById(\'enlargedimage\').src=\''+techdiagram+'\';\"><u>Show technical diagram</u></span></td></tr></table>';
 }
 document.getElementById('enlarge').innerHTML='<table width=\"100%\"><tr><td align=\"left\"><a href=\"#\" onclick=\"javascript:window.print();return false;\"><img src=\"shopimages/buttons/print/print_0.jpg\" onmouseover=\"javascript:src=\'shopimages/buttons/print/print_1.jpg\';\" onmouseout=\"javascript:src=\'shopimages/buttons/print/print_0.jpg\';\" border=\"0\"></a></td>'+
  '<td align=\"center\"><b>'+code+'</b> <span style=\"font-size:11px;\">'+description+'</span></td>'+
  '<td align=\"right\"><img src=\"shopimages/buttons/close/close_0.jpg\" onmouseover=\"src=\'shopimages/buttons/close/close_1.jpg\';this.style.cursor=\'pointer\';\" onmouseout=\"src=\'shopimages/buttons/close/close_0.jpg\';\" onclick=\"javascript:reduce();\"></td></tr></table><p></p>'+
  imagemenu+'<img id=\"enlargedimage\" src=\"'+largeimage+'\"><p></p><div style="text-align:left;font-size:11px;">'+document.getElementById('longdescription').innerHTML+'<p></p>'+fldata+'</div><p></p>'+
  '<table width=\"100%\"><tr><td align=\"left\"><a href=\"#\" onclick=\"javascript:window.print();return false;\"><img src=\"shopimages/buttons/print/print_0.jpg\" onmouseover=\"javascript:src=\'shopimages/buttons/print/print_1.jpg\';\" onmouseout=\"javascript:src=\'shopimages/buttons/print/print_0.jpg\';\" border=\"0\"></a></td>'+
  '<td align=\"right\"><img src=\"shopimages/buttons/close/close_0.jpg\" onmouseover=\"src=\'shopimages/buttons/close/close_1.jpg\';this.style.cursor=\'pointer\';\" onmouseout=\"src=\'shopimages/buttons/close/close_0.jpg\';\" onclick=\"javascript:reduce();\"></td></tr></table>';
}

function addtocompare(code){
 var htmlmsg=''; var codelist=",0,0,0"; var ca=document.cookie.split(';');
 for(var i=0;i<ca.length;i++){
  var c=ca[i]; while (c.charAt(0)==' '){c=c.substring(1,c.length);}
  if(c.indexOf("compare=")==0){
   c=c.substring(8,c.length); var parts=c.split(','); codelist=','+parts[0]+','+parts[1]+','+parts[2];   
   if (parts[2]!='0'){htmlmsg='and <b style=\"color:#993399;\">'+parts[2]+'</b> ';}
   if (parts[1]!='0'){htmlmsg='and <b style=\"color:#993399;\">'+parts[1]+'</b> '+htmlmsg;}
   if (parts[0]!='0'){htmlmsg='with <b style=\"color:#993399;\">'+parts[0]+'</b> '+htmlmsg;}
  }
 }
 if(codelist.indexOf(code)==-1){
  var date=new Date(); date.setTime(date.getTime()+86400000); var expires=date.toGMTString();
  document.cookie="compare="+code+codelist+"\; "+expires+"\; path=/";
  document.getElementById('compare').innerHTML='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>'+
   '<td>Compare <b style=\"color:#993399;\">'+code+'</b> '+htmlmsg+'</td>'+
   '<td style=\"padding-left:5px;\"><a id=\"compareurl\" href=\"page.php?xPage=compare\">'+
   '<img src=\"shopimages/buttons/comparenow/comparenow_0.jpg\"'+
   ' onmouseover=\"javascript:src=\'shopimages/buttons/comparenow/comparenow_1.jpg\';\"'+
   ' onmouseout=\"javascript:src=\'shopimages/buttons/comparenow/comparenow_0.jpg\';\" border=\"0\"></a></td></tr></table>';
 }
}

var techdrawcomparestore=new Array('empty','empty','empty','empty');
var techdrawcomparemax=0;
function techdrawcompareshow(b,code,url){
 var n=0;
 if(b>techdrawcomparemax){techdrawcomparemax=b;}
 for(n=0;n<techdrawcomparemax;n++){
  if(n!=(b-1)){
   if(techdrawcomparestore[n].indexOf('empty')==-1){
    document.getElementById('techdrawcomparebutton'+(n+1)).innerHTML=techdrawcomparestore[n];
   }
  }
  else{
   techdrawcomparestore[n]=document.getElementById('techdrawcomparebutton'+(n+1)).innerHTML;
   document.getElementById('techdrawcomparebutton'+(n+1)).innerHTML='<img src=\"shopimages/minibanners/arrow.gif\">';
   document.getElementById('techdraw').innerHTML=code+'<br><img src=\"'+url+'\">';
  }
 }
}

var delone=''; var deltwo='';

function showhideaddress(){
 if(document.getElementById('tickuntick').alt=='no'){
  document.getElementById('deliveryaddresslabel').innerHTML='Billing Address';
  document.getElementById('addressone').innerHTML='';
  document.getElementById('addresstwo').innerHTML=deltwo;
  document.getElementById('tickuntick').alt='yes';
  document.getElementById('tickuntick').src='shopimages/buttons/tickuntick/tick.jpg';
 }
 else{
  document.getElementById('deliveryaddresslabel').innerHTML='Delivery Address';
  document.getElementById('addressone').innerHTML=delone;
  document.getElementById('addresstwo').innerHTML='';
  document.getElementById('tickuntick').alt='no';
  document.getElementById('tickuntick').src='shopimages/buttons/tickuntick/untick.jpg';
 }
}

function showhideaddressinit(t){
 delone=document.getElementById('addressone').innerHTML;
 deltwo=document.getElementById('addresstwo').innerHTML;
 if(t==1){
  document.getElementById('deliveryaddresslabel').innerHTML='Billing Address';
  document.getElementById('addressone').innerHTML='';
  document.getElementById('tickuntick').alt='yes';
  document.getElementById('tickuntick').src='shopimages/buttons/tickuntick/tick.jpg';
 }
 else{
  document.getElementById('addresstwo').innerHTML='';
 }
}

function popupspec(baseref,manu,code,descshort,energy,delivery,message,mainimage,imgok,colour,techdiagram,showorprint){
 var redstyle=' style=\"color\:\#993399\;\"';
 var x=window.open('','TheKitchenApplianceStore','scrollbars=1,height=760,width=640');
 x.document.write('<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>The Kitchen Appliance Store - '+code+'</title><base href=\"'+baseref+'\"></head><body style=\"font-size:12px\;font-family:arial\;\"');
 if (showorprint==1){ x.document.write(' onload=\"javascript:window.print();window.close();\"'); }
 x.document.write('>\n');
 if (showorprint==0){ 
  x.document.write('<table align=\"right\"><tr> <td> <a style=\"cursor:pointer;\" onclick=\"javascript:window.print();\">\n');
  x.document.write('<img onmouseout=\"src=\'shopimages/buttons/print/print_0.jpg\'\" \n');
  x.document.write(' onmouseover=\"src=\'shopimages/buttons/print/print_1.jpg\'\" src=\"shopimages/buttons/print/print_0.jpg\"></a></td>\n');
  x.document.write('<td><a style=\"cursor:pointer;\" onclick=\"javascript:self.close();\">\n');
  x.document.write('<img onmouseout=\"src=\'shopimages/buttons/close/close_0.jpg\'\" onmouseover=\"src=\'shopimages/buttons/close/close_1.jpg\'\" \n');
  x.document.write(' src=\"shopimages/buttons/close/close_0.jpg\"></a></td> </tr></table>');
 }
 x.document.write(' <img src=\"shopimages/banners/tkas.jpg\"><p>\n');
 x.document.write('<table width=\"100%\"><tr><td><img src=\"shopimages/minibanners/general6mini.jpg\"></td>\n');
 x.document.write('<td align=\"center\"><img src=\"shopimages/minibanners/general4mini.jpg\"></td>\n');
 x.document.write('<td align=\"right\"><img src=\"shopimages/minibanners/general5mini.jpg\"></td></tr></table>\n');
 x.document.write('<p><img src=\"shopimages/products/manufacturer_logos/'+manu+'.jpg\" align=\"right\"><p>\&nbsp;<p><b>'+manu+' '+code+' '+descshort+'</b><p>\n');
 x.document.write('<center><img src=\"'+mainimage+'\">');
 if((colour.length)>0){
  x.document.write('<p></p><img src=\"shopimages/products/colours/'+colour+'.jpg\"><br>');
  if(imgok.indexOf('Y')==-1){ 
   x.document.write('<span'+redstyle+'>For illustration only.<br>Actual colour - '+colour+'</span>');
  }
  else{
   x.document.write(colour);
  }
 }
 x.document.write('</center><p>\n');
 x.document.write(document.getElementById('longdescription').innerHTML+'<p></p>'+fldata+'\n');
 x.document.write('<p><b>Specification</b><p>\n');
 x.document.write('<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" style=\"font-size:11px;margin-left:24px;margin-right:0px;margin-top:0px;margin-bottom:0px;\">\n');
 x.document.write(document.getElementById('specificationtable').innerHTML+'\n');
 x.document.write('</table>\n');
 x.document.write('<p></p><img src=\"'+techdiagram+'\">\n');
 if((energy.length)>0){
  x.document.write('<p><img src=\"shopimages/policyimages/energysmall.jpg\"> Energy rating '+energy+'\n');
 }
 if((delivery.length)>0){
  x.document.write('<p><img src=\"shopimages/policyimages/vansmalltkas.jpg\"> Estimated delivery '+delivery+'\n');
 }
 if((message.length)>0){
  x.document.write('<p><img src=\"shopimages/policyimages/exclamation1.jpg\"> <span'+redstyle+'>'+message+'</span>\n');
 }
 x.document.write('<p>At The Kitchen Appliance Store we offer a wide range of kitchen appliances from the best names on the business \n');
 x.document.write('- all at unbeatable prices. We also offer our own fantastic value brand - Benk. \n');
 x.document.write('This range is designed to offer excellent quality and value for money with a first class service.\n');
 x.document.write('<p>Our products are usually available for delivery to you within a few days.\n');
 x.document.write('<p>Our product range has been put together using experience gained over 10 years on-line and 35 years in kitchen design and installation.\n');
 x.document.write('<p>We are kitchen specialists, not just appliance specialists, and our vast design and installation experience, \n');
 x.document.write('amounting to over 30 years, helps us to guide you through the often complex process of buying built in appliances.\n');
 x.document.write('<p><b>You will not get better service, lower prices or faster delivery from anyone else.</b>\n');
 x.document.write('<p><b><span'+redstyle+'>For price and availability please contact</span></b><p><img src=\"shopimages/banners/tkassmall.jpg\">\n');
 x.document.write('<p><img src=\"shopimages/banners/benkltd.gif\"><br><b>Unit 7, Hillgrove Business Park, Nazeing Road,<br>Nazeing, Essex. EN9 2HB.<br>\n');
 x.document.write('<span'+redstyle+'>Telephone</span> 0845 521 9999 <span'+redstyle+'>Fax</span> 01992 897805<br>\n');
 x.document.write('<span'+redstyle+'>email</span> customerservice\@thekitchenappliancestore.co.uk <span'+redstyle+'>website</span> www.thekitchenappliancestore.co.uk</b>\n');
 if (showorprint==0){ 
  x.document.write('<table align=\"right\"><tr> <td> <a style=\"cursor:pointer;\" onclick=\"javascript:window.print();\">\n');
  x.document.write('<img onmouseout=\"src=\'shopimages/buttons/print/print_0.jpg\'\" \n');
  x.document.write(' onmouseover=\"src=\'shopimages/buttons/print/print_1.jpg\'\" src=\"shopimages/buttons/print/print_0.jpg\"></a></td>\n');
  x.document.write('<td><a style=\"cursor:pointer;\" onclick=\"javascript:self.close();\">\n');
  x.document.write('<img onmouseout=\"src=\'shopimages/buttons/close/close_0.jpg\'\" onmouseover=\"src=\'shopimages/buttons/close/close_1.jpg\'\" \n');
  x.document.write(' src=\"shopimages/buttons/close/close_0.jpg\"></a></td> </tr></table>');
 }
 x.document.write('</body></html>');
 x.document.close();
}

function cardhelp_changepage(n){
 if (n==0){
  document.getElementById('cardhelp').style.border='0px';
  document.getElementById('cardhelp').style.padding='0ex';
  document.getElementById('cardhelp').innerHTML='&nbsp;';
 }
 if (n==1){
  document.getElementById('cardhelp').style.border='2px solid #79d292';
  document.getElementById('cardhelp').style.padding='2ex';
  document.getElementById('cardhelp').innerHTML='<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td><b style=\"color:#993399;font-size:14px;\">Card Security Code</b></td>'+
  '<td style=\"width:20px;\"><img src=\"shopimages/buttons/delete/delete_0.jpg\" onclick=\"javascript:cardhelp_changepage(0);\" onmouseover=\"javascript:this.src=\'shopimages/buttons/delete/delete_1.jpg\';\" onmouseout=\"javascript:this.src=\'shopimages/buttons/delete/delete_0.jpg\';\"></td></tr></table>'+
  '<p></p>The card security code is a unique three or four digit number on the back<br>'+
  'of your credit card, separate from your credit card number.'+
  '<p><img src=\"shopimages/policyimages/creditcardback.jpg\"></p>'+
  'If your credit/debit card is not mentioned above, if your security code<br>'+
  'is missing or illegible, please call 0845 521 9999 for assistance with<br>'+
  'placing your order. We will not use or in anyway transfer to third parties<br>'+
  'the personal data indicated by you with respect to your credit/debit card<br>'+
  '(card number, expiry date or the CVV/CSC code).';
 }
}
