var cImgPfx = "";
var pGalDesc = "";
var MaxPic = 8232;
var MaxDvd = 1300;
var MaxFny = 546;
var MaxMus = 2039;

function genNav(cTarget){
 var cNavTo = "";
 
 //alert("Nav:" + cTarget);

 switch (cTarget){
 
  case "dvdcollection":
   if (TovRunningHDD()){
    cNavTo = cImgPfx + "../Tovster (ShagNowOrShagLater.co.uk)/movies/iatoz/0p1.html";
   } else {
    var url = document.location.href.toLowerCase();
    if (url.indexOf("shagnoworshaglater") > -1){
 	 cNavTo = cImgPfx + "movies/iatoz/0p1.html";
    }else {
     cNavTo = "http://shagnoworshaglater.co.uk/movies/iatoz/0p1.html"
    }
   }
   break;
   
  case "karaokeA":
   if (TovRunningHDD()){
    cNavTo = cImgPfx + "../Tovster (ShagNowOrShagLater.co.uk)/karaoke/art-a.html";
   } else {
    var url = document.location.href.toLowerCase();
    if (url.indexOf("shagnoworshaglater") > -1){
 	 cNavTo = cImgPfx + "karaoke/art-a.html";
    }else {
     cNavTo = "http://shagnoworshaglater.co.uk/karaoke/art-a.html"
    }
   }
   break;

  case "karaokeS":
   if (TovRunningHDD()){
    cNavTo = cImgPfx + "../Tovster (ShagNowOrShagLater.co.uk)/karaoke/sng-a.html";
   } else {
    var url = document.location.href.toLowerCase();
    if (url.indexOf("shagnoworshaglater") > -1){
 	 cNavTo = cImgPfx + "karaoke/sng-a.html";
    }else {
     cNavTo = "http://shagnoworshaglater.co.uk/karaoke/sng-a.html"
    }
   }
   break;

  default:
	if (cTarget.indexOf(".csv") > -1){
	 cNavTo = cImgPfx + cTarget;
	}else{
	 cNavTo = cImgPfx + cTarget + ".html";
	}
	break;   
  }
  document.location = cNavTo;
}

function MM_preloadImages() {
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if(imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
    }
  }
}

function MM_swapImgRestore() {
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_swapImage() {
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
    }
  }
  document.MM_swapImgData = swapArray;
}

function tovWritePartyGearHeader(loadimageno){
 document.write ('<table width="75%" align="center" cellpadding="2" cellspacing="2" border="0"><tr><td style="font-size:11pt;" align="left">');
 document.write ("Quite a few people ask me what all the party gear is and where can they get it from. ");
 document.write ("My memory is not that good, so I've put details of all the stuff I use at the parties here. ");
 document.write ('Check out the <a style="font-size:11pt;" href="halloween.html">Halloween</a> page for more details on the stuff dedicated to the Halloween parties.<br><br>'); 
 document.write ("I've added links to some of the places where I originally got the gear from but ");
 document.write ("some of these no longer sell the same stuff or have changed prices (I tend to buy the gear when prices are good) so I've included alternative links as well.<br><br><br>");
 document.write ('</td></tr></table>');

 document.write ('<table border="1" bgcolor = "#007f00" width="90%" align="center" cellspacing="0" cellpadding="4" frame="below"><tr><td align="left">');
 document.write ('<a href="partygear.html"><img src="images/pstuffsound');
 if (loadimageno == 0){document.write ('r');}
 
 document.write ('.jpg" hspace="1" width="63" height="34" alt="Sound System" border="0" align=""></a>');
 document.write ('<a href="partygear1.html"><img src="images/pstufflight');
 if (loadimageno == 1){document.write ('r');}
 
 document.write ('.jpg" hspace="1" width="75" height="34" alt="Lighting Systems" border="0" align=""></a>');
 document.write ('<a href="partygear2.html"><img src="images/pstuffeffects');
 if (loadimageno == 2){document.write ('r');}
 
 document.write ('.jpg" hspace="1" width="72" height="34" alt="Effects Stuff" border="0" align=""></a>');
 document.write ('<a href="partygear3.html"><img src="images/pstufffworks');
 if (loadimageno == 3){document.write ('r');}
 
 document.write ('.jpg" hspace="1" width="95" height="34" alt="Fireworks" border="0" align=""></a>');
 document.write ('<a href="partygear4.html"><img src="images/pstuffmisc');
 if (loadimageno == 4){document.write ('r');}
 
 document.write ('.jpg" hspace="1" width="49" height="34" alt="Misc Party Stuff" border="0" align=""></a>');
 document.write ('</td></tr></table>');
}

function tovWritePartyGearFooter(){
  document.write ('<br><div align="center">Check out these places to get this gear<br>');
  document.write ('<sup>(some gear no longer stocked by all)</sup><br><br>');
  document.write ('<a href="http://www.thedjbox.com" target="_blank"><img src="images/links/thedjboxlogo.jpg" width="100" height="40" alt="the DJBox.com" border="0" hspace="2"></a>');
  document.write ('<a href="http://www.ecwuk.com" target="_blank"><img src="images/links/ecwlogo.jpg" width="100" height="40" alt="Electronic City Wharehouse" border="0" hspace="2"></a>');
  document.write ('<a href="http://www.maplin.co.uk" target="_blank"><img src="images/links/maplinlogo.gif" width="124" height="40" alt="Maplin Electronics" border="0" hspace="2"></a>');
  document.write ('<a href="http://www.tega.co.uk" target="_blank"><img src="images/links/tegalogo.gif" width="150" height="40" alt="Tega Sound and Lighting" border="0" hspace="2"></a>');
  document.write ('</div><br><br>');
}

function tovWriteHeader(loadimageno, backlinkno, cPassCap)
{
 var titsrc = "images/";
 var imghigh = "";
 var htmlText = "";
 var cHeight = "57";
 var cAltCol = "";
 var cBgButtons = "#292929"
 
 pGalDesc = "" + cPassCap;
 cPassCap = "&nbsp;" + cPassCap;
 switch (loadimageno)
 {
  case 0:
   titsrc += "b2title_tovstercom.gif";
   break;
  case 1:
   titsrc += "b2title_tovstercom.gif";
   break;
  case 2:
   titsrc += "b2title_webcam.gif";
   break;
  case 3:
   titsrc += "b2title_newcastle.gif";
   break;
  case 4:
   titsrc += "b2title_watersportspages.gif";
   break;
  case 5:
   titsrc += "b2title_picturegallery.gif";
   if (backlinkno > 1){
    cImgPfx = "../../";
   }
   break;
  case 6:
   titsrc += "b2title_psu.gif";
   break;
  case 7:
   titsrc += "b2title_links.gif";
   break;
  case 8:
   titsrc += "b2title_partygear.gif";
   break;
  case 9:
   titsrc += "b2title_tides.gif";
   break;
  case 10:
   titsrc += "b2title_claireemma.gif";
   break;
  case 11:
   titsrc += "b2title_sitemap.gif";
   break;   
  case 12:
   titsrc += "b2title_videoclips.gif";
   break;   
  case 13:
   titsrc += "b2title_finger.gif";
   break; 
  case 14:
   titsrc += "b2title_tovstercom.gif";
   cAltCol = "blk";
   cBgButtons = "#333333";
   break;
  case 15:
   titsrc += "b2title_dvdcollection.gif";
   cImgPfx = "../../";
   break; 
  case 15:
   titsrc += "b2title_dvdcollection.gif";
   cImgPfx = "../../";
   break; 
  case 16:
   titsrc += "b2title_dvdcollection.gif";
   cImgPfx = "../";
   break;
  case 17:
   titsrc += "b2title_wherethefugg.gif";
   cImgPfx = "../";
   break; 
  case 18:
   titsrc += "b2title_karaoke.gif";
   cImgPfx = "../";
   break; 
  case 19:
   titsrc += "b2title_roguesgallery.gif";
   cImgPfx = "../../";
   break;
  case 20:
   titsrc += "b2title_musicvdcollection.gif";
   cImgPfx = "../../";
   break;


  case 99:
   titsrc += "newbanner.jpg";
   break;
  case 999:
   titsrc += "newbanner.jpg";
   break;
 }
 
 document.write ('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="122" valign="top">');

 // Need a bigger banner if running on lycos - because the lycos banner obscures the title bar
 var url = document.location.href.toLowerCase();
 if (url.indexOf(".lycos.") != -1){
 	document.write ('<tr><td bgcolor="#eeeeee" colspan="3" height="25"></td></tr>');
 }
 document.write ('<tr><td background="'+cImgPfx+'images/newbanner'+cAltCol+'.jpg" height="136" width="1200" style="background-repeat:no-repeat;">&nbsp;</td>');
 document.write ('<td bgcolor="#ffffff">&nbsp;<width="*"></td></tr></table>');

 document.write ('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="17" valign="top"><td>');
 document.write ('<td bgcolor="#005957" height="28" width="8" background="'+cImgPfx+'images/newborderleft.jpg" style="background-repeat:no-repeat;">&nbsp;</td>');
 document.write ('<td bgcolor="#005957" height="28" width="100%-16px" background="'+cImgPfx+'images/newbordermid.jpg" style="background-repeat:repeat; font-size:8pt; weight:bold; text-align:left; color:#dddd00;">'+cPassCap+'</td>');
 document.write ('<td id="MenuAnchor" bgcolor="#005957" height="28" width="8" background="'+cImgPfx+'images/newborderright.jpg" style="background-repeat:no-repeat;">&nbsp;</td></tr></table>');

}


function TovRunningHDD (){
   if (location.href.substring(0,5) == "file:")
      return (true);
   return (false);
}

function TovGetImageZip (zipname){
 if (TovRunningHDD()){
   location.href = "P:/PublicWWW/gallery/zip/" + zipname;
 }else{
   location.href = "http://tovster.kicks-ass.net/gallery/zip/" + zipname;
 }
 document.MM_returnValue = false;
}

function TovGalleryPic (imagefile, imgtype, portrait, optDesc, optPfx, optHigh){
 var loadimage;
 var highimage;
 var pos = imagefile.indexOf('/');
 var galID = imagefile.substring(0,pos);
 var h=0;
 var w=0;
 var cOpt="";
 var highLink="";
 
 if (optDesc==null)
  optDesc="";
 if (optPfx==null)
  optPfx="";

 if (TovRunningHDD()){
  if (optHigh > 0){
   highimage = "P:/PublicWWW/gallery/high/" + imagefile;
  }
  loadimage = optPfx + "../../../Tovster (ShagNowOrShagLater.co.uk)/gallery/pic/" + imagefile;
 }else{
  if (optHigh > 0){
   highimage = "http://tovster.kicks-ass.net/gallery/high/" + imagefile;
  }
  loadimage = "http://shagnoworshaglater.co.uk/gallery/pic/" + imagefile;
 }

 if (optHigh > 0){
  //alert(highimage);
  highLink = '<a href="' + highimage + '" target="_blank" style="color:#eeeeee;font-size:8pt;font-weight:bold;"><font face="Arial, Helvetica">View high-resolution image ' + optHigh + 'Kb</font></a>';
 }

 if (imgtype == "dun"){
  cOpt="Digital";
  if (portrait=="p"){
   h=507;
   w=760;
  }else{
   h=760;
   w=507;
  }
 }else if (imgtype == "dig"){
  cOpt="Digital";
  if (portrait=="p"){
   h=570;
   w=760;
  }else{
   h=760;
   w=570;
  }
 }else if (imgtype == "aps"){
  cOpt="APS";
  if (portrait=="p"){
   h=460;
   w=800;
  }else{
   h=800;
   w=460;
  }
 }else if (imgtype == "35mm"){
  cOpt="35mm";
  if (portrait=="p"){
   h=469;
   w=700;
  }else{
   h=700;
   w=469;
  }
 }else {
  cOpt="Video/Digital";
  if (portrait=="p"){
   h=570;
   w=760;
  }else{
   h=760;
   w=570;
  }
 }

 if (h > 0){
  JustSoPicWindow(loadimage,h,w,'* * Gallery '+cOpt+' Image - Click image to close * *','#3E3986','hug image','30',optDesc, pGalDesc, optPfx, highLink);
 }
}

function JustSoPicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin,optDesc,galDesc,optPfx,highLink) {
	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}
	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
    newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+(scrHeight+20)+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onxBlur="self.close()" onxClick="self.close()">');  
    newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td colspan="2">');
    newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="Click image to close" onClick="self.close()" >');
	newWindow.document.write('</td></tr><tr><td colspan="2" align="center">');
	newWindow.document.write('<font face="Arial, Helvetica" size="2" color="#ACF4FB"><strong>'+optDesc+'</strong><br>('+galDesc+')</font></td></tr><tr><td align="left">');
        newWindow.document.write(highLink + '</td><td align="right">');

	// html sitemeter - note allows us to resize the image
	newWindow.document.write('<a href="http://s13.sitemeter.com/stats.asp?site=s13tovster" target="_blank">');
	newWindow.document.write('<img src="http://s13.sitemeter.com/meter.asp?site=s13tovster" alt="Site Meter" border=0 width="70" height="25" hspace="0" vspace="0"></a></td></tr>');
	
	newWindow.document.write('</table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}

function tovRandomPicture(){
   document.write(HTMLforRandomPic());
   document.MM_returnValue = false;
   return;
}

function tovRandomCDPic(){
   document.write(HTMLforRandomMus());
   document.MM_returnValue = false;
   return;
}

function GalleryRPicNew(){
   document.getElementById('RandomPicCell').innerHTML = HTMLforRandomPic();
   document.MM_returnValue = false;
   return;
}

function GalleryRCDNew(){
   document.getElementById('RandomCDCell').innerHTML = HTMLforRandomMus();
   document.MM_returnValue = false;
   return;
}

function tovFunnyPicture(){
   document.write(HTMLforRandomFunny());
   document.MM_returnValue = false;
   return;
}

function FunnyRPicNew(){
   document.getElementById('FunnyPicCell').innerHTML = HTMLforRandomFunny();
   document.MM_returnValue = false;
   return;
}
             

function tovRandomVal(nMax){
 return (Math.floor(Math.random() * nMax) + 1);
}

function HTMLforRandomPic(){
   var newHTML = "";
   var loadImage = "";
   var picVal = tovRandomVal(MaxPic) + 1;
   if (picVal > MaxPic){picVal=MaxPic};
   var selPic = "" + picVal;
   
   while(selPic.length < 4){
      selPic = "0" + selPic;
   }
   var imgFile = "/gallery/sml/" + selPic.substring(0,1) + "/rnd" + selPic + ".jpg";

   if (TovRunningHDD()){
    loadImage = "../Tovster (ShagNowOrShagLater.co.uk)" + imgFile;
   } else {
    loadImage = "http://shagnoworshaglater.co.uk" + imgFile;
   }
   newHTML = '<a href="' + loadImage + '" target="_blank">';
   newHTML += '<img src="' + loadImage + '"';
   newHTML += ' alt="Random Gallery Picture ' + imgFile + '" width="270" border="0" name="rimagesrc"></a><br>';
   return (newHTML);
}

function HTMLforRandomMus(){
   var newHTML = "";
   var loadImage = "";
   var picVal = tovRandomVal(MaxMus) + 1;
   if (picVal > MaxPic){picVal=MaxMus};
   var selPic = "" + picVal;
   
   while(selPic.length < 4){
      selPic = "0" + selPic;
   }
   var imgFile = "/music/sml/" + selPic.substring(0,1) + "/rnd" + selPic + ".jpg";

   if (TovRunningHDD()){
    loadImage = "../Tovster (ShagNowOrShagLater.co.uk)" + imgFile;
   } else {
    loadImage = "http://shagnoworshaglater.co.uk" + imgFile;
   }
   newHTML = '<a href="' + loadImage + '" target="_blank">';
   newHTML += '<img src="' + loadImage + '"';
   newHTML += ' alt="Random CD Image ' + imgFile + '" width="270" border="0" name="cdrimagesrc"></a><br>';
   return (newHTML);
}

function HTMLforRandomFunny(){
   var newHTML = "";
   var loadImage = "";
   var picVal = tovRandomVal(MaxFny) + 1;
   if (picVal > MaxPic){picVal=MaxFny};
   var selPic = "" + picVal;

   
   while(selPic.length < 3){
      selPic = "0" + selPic;
   }
   var imgFile = "/funny/funnypic" + selPic + ".jpg";

   if (TovRunningHDD()){
    loadImage = "../Tovster (ShagNowOrShagLater.co.uk)" + imgFile;
   } else {
    loadImage = "http://shagnoworshaglater.co.uk" + imgFile;
   }

   s = '<a href="' + loadImage + '" target="_blank">';
   s += '<img id="rfunimg" src="' + loadImage + '" alt="OPEN - ' + loadImage + '" width="270" border="0"></a><br>';
   document.getElementById("FunnyPicCell").innerHTML = s;
   document.MM_returnValue = false;   
   return (newHTML);
}

function HTMLforRandomDVD(){
   var newHTML = "";
   var loadImage = "";
   var picVal = tovRandomVal(MaxDvd) + 1;
   if (picVal > MaxPic){picVal=MaxDvd};
   var selPic = "" + picVal;
   
   while(selPic.length < 4){
      selPic = "0" + selPic;
   }
   var imgFile = "/dvdcoversml/dvd" + selPic + ".jpg";

   if (TovRunningHDD()){
    loadImage = "../Tovster (ShagNowOrShagLater.co.uk)" + imgFile;
   } else {
    loadImage = "http://shagnoworshaglater.co.uk" + imgFile;
   }

   s = '<a href="' + loadImage + '" target="_blank">';
   s += '<img id="rdvdimg" src="' + loadImage + '" alt="OPEN - ' + loadImage + '" width="270" border="0"></a><br>';
   document.getElementById("DVDPicCell").innerHTML = s;
   document.MM_returnValue = false;   
   return (newHTML);
}


function popBBFCWin(cPartURL){
   var cUrl = "../../bbfc" + cPartURL + "pop.html";
   if (window.winref && !window.winref.closed) {
      window.winref.replace(URL)
   }else {
      var wind = window.open(cUrl, "BBFCCATS", "menubar=no, toolbar=no, scrollbars=yes, width=700, height=400, left=200, top=300, resizable");
   }
   return false;
}

function popBBFCWinSM(cPartURL){
   var cUrl = "bbfc" + cPartURL + "pop.html";
   if (window.winref && !window.winref.closed) {
      window.winref.replace(URL)
   }else {
      var wind = window.open(cUrl, "BBFCCATS", "menubar=no, toolbar=no, scrollbars=yes, width=700, height=400, left=200, top=300, resizable");
   }
   return false;
}

function rewriteDVDLink(cOpt){
 // Rewrite the link to the dvd page if running local, or not shagnoworshaglater
 // as these three sites are the only ones holding the dvd collection
 if (cOpt==null)
  cOpt="";
 rewriteDVDLinkID("DVDLink", cOpt);
}

function rewriteDVDLink2(cOpt){
 // Rewrite the link to the dvd page if running local, or not shagnoworshaglater
 // as these three sites are the only ones holding the dvd collection
 if (cOpt==null)
  cOpt="";
 rewriteDVDLinkID("DVDLink2",cOpt);
}

function rewriteDVDLink3(cOpt){
 // Rewrite the link to the dvd page if running local, or not shagnoworshaglater
 // as these three sites are the only ones holding the dvd collection
 if (cOpt==null)
  cOpt="";
 rewriteDVDLinkID("DVDLink3",cOpt);
 rewriteCDLinkID("CDLink3",cOpt);
}

function rewriteDVDLinkID(cID, cOpt){
 // Rewrite the link to the dvd page if running local, or not shagnoworshaglater
 // as these three sites are the only ones holding the dvd collection
 var linkloc;

 if (cOpt==null)
  cOpt="";

 if (TovRunningHDD()){
   linkloc = cOpt + "../Tovster (ShagNowOrShagLater.co.uk)/movies/iatoz/0p1.html";
 } else {
  var url = document.location.href.toLowerCase();
  if (url.indexOf("shagnoworshaglater") > -1){
 	linkloc = cOpt + "movies/iatoz/0p1.html";
  }else {
    linkloc = "http://shagnoworshaglater.co.uk/movies/iatoz/0p1.html"
  }
 }
 document.getElementById(cID).href = linkloc;
}

function rewriteCDLinkID(cID, cOpt){
 // Rewrite the link to the cd page if running local, or not shagnoworshaglater
 var linkloc;

 if (cOpt==null)
  cOpt="";

 if (TovRunningHDD()){
   linkloc = cOpt + "../Tovster (ShagNowOrShagLater.co.uk)/music/iatoz/b0p1.html";
 } else {
  var url = document.location.href.toLowerCase();
  if (url.indexOf("shagnoworshaglater") > -1){
 	linkloc = cOpt + "music/iatoz/b0p1.html";
  }else {
    linkloc = "http://shagnoworshaglater.co.uk/music/iatoz/b0p1.html"
  }
 }
 document.getElementById(cID).href = linkloc;
}


function rewriteDVDLinkCX(){
 var linkloc;

 if (TovRunningHDD()){
   linkloc = "../../Tovster (ShagNowOrShagLater.co.uk)/movies/iatoz/0p1.html";
 } else {
  var url = document.location.href.toLowerCase();
  if (url.indexOf("shagnoworshaglater.") > -1){
 	linkloc = "../../iatoz/0p1.html";
  }else {
    linkloc = "http://shagnoworshaglater.co.uk/movies/iatoz/0p1.html"
  }
 }
 document.getElementById("cxdvd").href = linkloc;
}

function wriMoviePic (movID){
 var cHTML;

 if (TovRunningHDD()){
   cHTML = '<img src="../../../Tovster (ShagNowOrShagLater.co.uk)/movimg/' + movID + '.jpg" border="0" vspace="0" hspace="0" height="370" width="270">';
 } else {
   cHTML = '<img src="http://shagnoworshaglater.co.uk/movimg/' + movID + '.jpg" border="0" vspace="0" hspace="0" height="370" width="270">';
 }
 document.write (cHTML);
 document.MM_returnValue = false;
}

function wriCDPic (cdID){
 var cHTML;

 if (TovRunningHDD()){
   cHTML = '<img src="../../../Tovster (ShagNowOrShagLater.co.uk)/music/img/' + cdID + '.jpg" border="0" vspace="0" hspace="0" height="200" width="200">';
 } else {
   cHTML = '<img src="http://shagnoworshaglater.co.uk/music/img/' + cdID + '.jpg" border="0" vspace="0" hspace="0" height="200" width="200">';
 }
 document.write (cHTML);
 document.MM_returnValue = false;
}

function wTN (movID){
 var cHTML;

 if (TovRunningHDD()){
   cHTML = '<img src="../../../Tovster (ShagNowOrShagLater.co.uk)/movimg_tn/' + movID + '.jpg" border="0" vspace="0" hspace="0" width="56" height="80">';
 } else {
   var url = document.location.href.toLowerCase();
   if (url.indexOf("shagnoworshaglater.co.uk") > -1){

     cHTML = '<img src="../../movimg_tn/' + movID + '.jpg" border="0" vspace="0" hspace="0" width="56" height="80">';
   } else {
     cHTML = '<img src="http://shagnoworshaglater.co.uk/movimg_tn/' + movID + '.jpg" border="0" vspace="0" hspace="0" width="56" height="80">';
   }
 }
 document.write (cHTML);
 document.MM_returnValue = false;
}

function mTN (cdID){
 var cHTML;

 if (TovRunningHDD()){
   cHTML = '<img src="../../../Tovster (ShagNowOrShagLater.co.uk)/music/tn/' + cdID + '.jpg" border="0" vspace="0" hspace="0" width="80" height="80">';
 } else {
   var url = document.location.href.toLowerCase();
   if (url.indexOf("shagnoworshaglater.co.uk") > -1){

     cHTML = '<img src="../../music/tn/' + cdID + '.jpg" border="0" vspace="0" hspace="0" width="80" height="80">';
   } else {
     cHTML = '<img src="http://shagnoworshaglater.co.uk/music/tn/' + cdID + '.jpg" border="0" vspace="0" hspace="0" width="80" height="80">';
   }
 }
 document.write (cHTML);
 document.MM_returnValue = false;
}

function TovGetFile (fileName){
 if (TovRunningHDD()){
   location.href = "P:/PublicWWW/" + fileName;
 }else{
   location.href = "http://tovster.kicks-ass.net/" + fileName;
 }
}

var CDGWin;
var CDGUrl="";

function nextCDGPage() {
  CDGWin.location = CDGUrl;
}

function TovCDGSearch (fileRef){
 var url = "http://www.platterpuss.com/site/Main.asp?DepChange=Karaoke&SelBrandID=0"
 CDGWin = window.open(url, "CDGSearch", "menubar=yes, toolbar=yes, scrollbars=yes, width=800, height=600, left=100, top=100, resizable");
 CDGUrl = "http://www.platterpuss.com/site/Main.asp?fpost=YES&SelectBrandID=0&SearchWord=" + fileRef + "&SearchFilter=CDG";
 setTimeout("nextCDGPage();",1500);
}

function cdgLWri(JBRef, JBSng){
   var apos = "'";
   var cHTML = '<a class="vclink" href="javascript:;" onClick="TovGetFile(' + apos + 'cdg/wmaclip/' + JBRef + '.wma' + apos;
   cHTML += ');return false;">wma</a>&nbsp;&nbsp<a class="vclink" href="javascript:;" onClick="TovGetFile(' + apos;
   cHTML += 'cdg/mp3clip/' + JBRef + '.mp3' + apos + ');return false;">mp3</a>&nbsp;&nbsp;&nbsp;&nbsp;';
   cHTML += '<a class="vclink" href="javascript:;" onClick="TovCDGSearch(' + apos + JBSng + apos + ');return false;">search/buy</a>';
   document.write(cHTML);
}

function rewritePartyWCImage(){
 rewritePartyWCImageID("PartyWebCamImage");
}

function rewritePartyWCImageID(cID){
 var linkloc;

 linkloc = '<a href="partywebcam.html" alt="Click to open the party webcams page"><img src="';
 if (TovRunningHDD()){
  linkloc += "http://192.168.0.100/cam0.jpg";
 } else {
  linkloc += "http://tovster.kicks-ass.net/cam0.jpg";
 }
 linkloc += '" width="270" border="0" hspace="0" vspace="0"></a>';
 document.getElementById(cID).innerHTML = linkloc;
}
