// Flipside 2006
// Tapes 2... Web Site Menu Script

var first = 0;
var stayopen = '';
var currentmenu = '';
var menuID = '';

function openMenu(menuID) {
  if (currentmenu != '') { stayopen = 0; closeMenu(); }
  if (document.getElementById) { var element = document.getElementById(menuID).style }
  else if (document.all) { var element = document.all[menuID].style }
  else if (document.layers) { var element = document.layers[menuID] }

  element.visibility = 'visible';
  stayopen = 1;
  currentmenu = menuID;
}

function closeMenu() {
  if (stayopen == 1) { setTimeout("closeMenu()", 1000); return; }
  if (!currentmenu) { return }

  if (document.getElementById) { var element = document.getElementById(currentmenu).style }
  else if (document.all) { var element = document.all[currentmenu].style }
  else if (document.layers) { var element = document.layers[currentmenu] }

  element.visibility = 'hidden';
  currentmenu = '';
}

var usr='';
var thispage='';

function printMenu(thispage) {
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/1\')" onMouseOver="openMenu(\'packagingtapes\'); stayopen=1; catlink1.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink1.className=\'menu\'"><a id="catlink1" href="category/1" class=menu>Packaging tapes</a></td></tr>');
document.write('<tr height=3><td align=center><img src="images/mspace.gif" alt="" width=161 height=3 border=0></td></tr>');
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/2\')" onMouseOver="openMenu(\'clothaluminiumtapes\'); stayopen=1; catlink2.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink2.className=\'menu\'"><a id="catlink2" href="category/2" class=menu>Cloth & aluminium tapes</a></td></tr>');
document.write('<tr height=3><td align=center><img src="images/mspace.gif" alt="" width=161 height=3 border=0></td></tr>');
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/3\')" onMouseOver="openMenu(\'papertapes\'); stayopen=1; catlink3.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink3.className=\'menu\'"><a id="catlink3" href="category/3" class=menu>Paper tapes</a></td></tr>');
document.write('<tr height=3><td align=center><img src="images/mspace.gif" alt="" width=161 height=3 border=0></td></tr>');
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/4\')" onMouseOver="openMenu(\'industrialtapes\'); stayopen=1; catlink4.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink4.className=\'menu\'"><a id="catlink4" href="category/4" class=menu>Industrial tapes</a></td></tr>');
document.write('<tr height=3><td align=center><img src="images/mspace.gif" alt="" width=161 height=3 border=0></td></tr>');
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/5\')" onMouseOver="openMenu(\'electricaltapes\'); stayopen=1; catlink5.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink5.className=\'menu\'"><a id="catlink5" href="category/5" class=menu>Electrical tapes</a></td></tr>');
document.write('<tr height=3><td align=center><img src="images/mspace.gif" alt="" width=161 height=3 border=0></td></tr>');
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/6\')" onMouseOver="openMenu(\'surfaceprotectiontapes\'); stayopen=1; catlink6.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink6.className=\'menu\'"><a id="catlink6" href="category/6" class=menu>Surface protection tapes</a></td></tr>');
document.write('<tr height=3><td align=center><img src="images/mspace.gif" alt="" width=161 height=3 border=0></td></tr>');
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/7\')" onMouseOver="openMenu(\'doublesidedtapes\'); stayopen=1; catlink7.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink7.className=\'menu\'"><a id="catlink7" href="category/7" class=menu>Double sided tapes</a></td></tr>');
document.write('<tr height=3><td align=center><img src="images/mspace.gif" alt="" width=161 height=3 border=0></td></tr>');
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/8\')" onMouseOver="openMenu(\'foamproducts\'); stayopen=1; catlink8.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink8.className=\'menu\'"><a id="catlink8" href="category/8" class=menu>Foam products</a></td></tr>');
document.write('<tr height=3><td align=center><img src="images/mspace.gif" alt="" width=161 height=3 border=0></td></tr>');
document.write('<tr height=15><td class=menutab nowrap onClick="jumpTo(\'category/10\')" onMouseOver="openMenu(\'packagingclothtapes\'); stayopen=1; catlink9.className=\'menuHi\'" onMouseOut="stayopen=0; setTimeout(\'closeMenu()\', 2000); catlink9.className=\'menu\'"><a id="catlink9" href="category/10" class=menu>Packaging & cloth tapes</a></td></tr>');
}

function printSubMenus() {
printMenustart('packagingtapes', 120);
printMenuend();

printMenustart('clothaluminiumtapes', 140);
printMenuitem('shop/2/Waterproof', 'Waterproof', 10, 0);
printMenuitem('shop/2/Aluminium', 'Aluminium', 11, 0);
printMenuitem('shop/2/Polyester', 'Polyester', 12, 0);
printMenuitem('shop/2/Cloth', 'Cloth', 13, 1);
printMenuend();

printMenustart('papertapes', 160);
printMenuitem('shop/3/Packaging', 'Packaging', 14, 0);
printMenuitem('shop/3/Masking', 'Masking', 15, 1);
printMenuend();

printMenustart('industrialtapes', 180);
printMenuitem('shop/4/PVC', 'PVC', 16, 0);
printMenuitem('shop/4/Stereo-Mount', 'Stereo Mount', 17, 0);
printMenuitem('shop/4/Polythene', 'Polythene', 18, 0);
printMenuitem('shop/4/Polyester', 'Polyester', 19, 0);
printMenuitem('shop/4/Anti-Slip', 'Anti Slip', 20, 1);
printMenuend();

printMenustart('electricaltapes', 200);
printMenuitem('shop/5/Kapton', 'Kapton', 21, 0);
printMenuitem('shop/5/Glass-Cloth', 'Glass Cloth', 22, 0);
printMenuitem('shop/5/Insulation', 'Insulation', 23, 0);
printMenuitem('shop/5/Polyester', 'Polyester', 24, 1);
printMenuend();

printMenustart('surfaceprotectiontapes', 220);
printMenuend();

printMenustart('doublesidedtapes', 240);
printMenuitem('shop/7/General', 'General', 25, 0);
printMenuitem('shop/7/Electrical', 'Electrical', 26, 0);
printMenuitem('shop/7/PVC', 'PVC', 27, 0);
printMenuitem('shop/7/Cloth', 'Cloth', 28, 0);
printMenuitem('shop/7/Tissue', 'Tissue', 29, 0);
printMenuitem('shop/7/Poly-Prop', 'Poly Prop', 30, 0);
printMenuitem('shop/7/Stereo-Mount', 'Stereo Mount', 31, 1);
printMenuend();

printMenustart('foamproducts', 260);
printMenuend();

printMenustart('packagingclothtapes', 280);
printMenuend();

printMenustart('subso', 300);
printMenuend();
}


function printMenustart(menuname, ypos) {
document.write("<table id=\"" + menuname + "\" style=\"position: absolute; top: "+ypos+"px; left: 169px; visibility: hidden; background: #c8bdb2; z-index: 1\" onMouseOver=\"stayopen=1\" onMouseOut=\"stayopen=0\" cellpadding=0 cellspacing=0 border=0>");
first=1;
}

function printMenuitem(link, item, linkref, last) {
document.write("<tr><td class=nav nowrap onClick=\"jumpTo('"+link+"')\" onMouseOver=\"stayopen=1; this.className='navHi'; grouplink"+linkref+".className='menuHi'\" onMouseOut=\"this.className='nav'; grouplink"+linkref+".className='menu'\">&nbsp;<a id=\"grouplink"+linkref+"\" href=\""+link+"\" class=menu>" + item + "</a>&nbsp;</td></tr>");
if (!last) { document.write("<tr height=5><td background=\"images/5line.gif\"><img src=\"images/mask.gif\" alt=\"\" width=100 height=5 border=0></td></tr>\n") }
}

function printMenuend() {
document.write("</table>");
}


// Block right clicking
var clickmessage='Note that all images and product photos are copywright Tapes 2 ...\nPlease contact us if you wish to use any of our images.';

function disableclick(e) {
  if (document.all) {
    if (event.button==2||event.button==3) {
      if (event.srcElement.tagName=='IMG'){ alert(clickmessage); return false; }
    }
  } else if (document.layers) {
    if (e.which == 3) { alert(clickmessage); return false; }
  } else if (document.getElementById) {
    if (e.which==3&&e.target.tagName=='IMG'){ alert(clickmessage); return false; }
  }
}

function associateimages() {
  for(i=0; i<document.images.length;i++) { document.images[i].onmousedown=disableclick; }
}

if (document.all) { document.onmousedown=disableclick }
else if (document.getElementById) { document.onmouseup=disableclick }
else if (document.layers) { associateimages() }

var message='';

function clickIE() {if (document.all) {(message);return false;}}

function clickNS(e) {
if (document.layers||(document.getElementById&&!document.all)) {
  if (e.which==2||e.which==3) {(message);return false;}
  }
}

if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

function popup(mylink, windowname, width, height)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width='+width+',height='+height+',status=no,scrollbars=yes,resizable=yes');
return false;
}

function jumpTo(link) {
// Browser safe onClick linking
top.location='http://www.tapes2.co.uk/'+link;
}

