// function to handily open a new window...
function newWindow(url) {
  window.open(url);
} 

       
// function to open a new window and display a specified image...
function displayImage(img) {
  var win = window.open('');
  win.document.write('<html><head><title>s2 Audio Technology :: Media</title><link rel="stylesheet" type="text/css" href="explorer.css"></head><body><table border="0" width="100%" height="100%" id="table1"><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td><p align="center"><img name="photo" border="1" src="' + img + '"></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td><p align="center"><a href="javascript:window.close()">Close</a></p></td><td>&nbsp;</td></tr></table><p align="center">&nbsp;</p></body></html>');
}


// load the banner image links...
function getBanners() {	
  // create an array to hold image src locations without preloading
  var bannerImages = new Array(10);
  for (var i = 0; i < 10; i++) {
    bannerImages[i] = 'http://www.s2amps.com/media/header' + i + '.jpg';
  }

  return bannerImages;
}


// find a random number to choose which banner image to use for this impression...
function getNumbers() {
  return random = Math.round(Math.random() * 9) + 0;
}


// write the code to the document to show the chosen random banner...
function showBanner() {
  document.write('<img id="entry" src="' + bannerImages[random] + '" title="top banner thingy" width="768" height="52" border="0" alt="top banner thingy"><br>');
}


// function to display an alert about possible croakage...
function showDisclaimer() {
  window.alert("Vacuum tube products such as guitar amps, preamps, and pedals\n" + 
               "contain potentially HARMFUL OR LETHAL HIGH VOLTAGE electricity.\n" +
               "A shock delivered by a tube circuit can STOP YOUR HEART and KILL YOU.        \n\n" +
               "If you are not qualified to work with high voltage electronics, please\n" +
               "seek help from a qualified engineer or technician.\n\n" +
               "Your use of this site indicates you and your representatives agree to\n" +
               "hold s2 Audio Technology, s2 Amplification, s2amps.com and their agents\n" +
               "and shareholders harmless from any property damage, injury or fatality\n" +
               "which may occur from your use of products and/or information offered\n" +
               "by this site. All kits and information are provided as-is and without\n" +
               "warranty of any kind.\n\n" +
               "If you should choose to work with high voltage tube products or\n" +
               "circuits, you agree to assume any and all associated risk.\n\n" +
               "s2 Audio Technology, s2 Amplification, s2amps.com and their agents\n" +
               "and shareholders expressly disclaim all liability for property damage,\n" +
               "injury, and/or death resulting from the use of our products and\n" +
               "information.\n\n" + 
			   "By placing an order, you signify you have fully read, understood, and\n" +
			   "agreed to the terms described herein.\n\n");
}

	
// disable right click functions...
function disableRightClick(e) {
	if(!document.rightClickDisabled) {
		if(document.layers) {
			document.captureEvents(Event.MOUSEDOWN);
			document.onmousedown = disableRightClick;
		}
		else {
			document.oncontextmenu = disableRightClick;
		}
		return document.rightClickDisabled = true;
	}
	if(document.layers || (document.getElementById && !document.all)) {
		if (e.which==2||e.which==3) {
			return false;
		}
	}
	else {
		return false;
	}
}


// handle links in iframe navigation...
function iframeGo(url) {
	parent.window.location.href = url;
}