
function setMenu() {

x = document.getElementById("menu");

for (i=0; i<x.childNodes.length; i++) {
	y = x.childNodes[i];
	if (y.nodeName=="LI") {
			y.onclick = function() {
				if (this.className.indexOf("open")<0) {this.className+=" open";}
				else {this.className=this.className.replace(" open","");}
				}
   			}
	}
}


// POPUP SCRIPT
function viewimage() {}

// POPUP SCRIPT
function launch_viewer() {}

// FLASH DETECTION
var flashInstalled = false;
var isIE = (navigator.userAgent.indexOf("MSIE") != -1) ? true : false;    
var isWin = (navigator.userAgent.indexOf("Win") != -1) ? true : false;

if (navigator.plugins && navigator.plugins.length){
	var x = navigator.plugins["Shockwave Flash"];
	if (x){
		if (x.description){
			y = x.description;
			var flashVersion = y.charAt(y.indexOf('.')-1); //checks flash version
				if (flashVersion>6){ //checks for version 6 and above.
					flashInstalled = true;
				}
		}
	}
}

if(isIE && isWin){ //can't read from plugins array on ie pc...
document.write('<SCR' + 'IPT LANGUAGE=VBScript> \n');
document.write('on error resume next \n'); 
document.write('flashInstalled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n'); 
document.write('flashInstalled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n'); 
document.write('flashInstalled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n'); 
document.write('<\/SCR' + 'IPT> \n');
}


// EMBEDS FLASH
function embedFlash (url,w,h) {
document.write('<object type="application/x-shockwave-flash" data="'+url+'" width="'+w+'" height="'+h+'" menu="false">');
document.write('<param name="movie" value="'+url+'">');
document.write('<param name="menu" value="false">');
document.write('<\/object>');
}


// EMBEDS A YOUTUBE MODULE
function embedYouTube (url) {
document.write('<object class="video" type="application/x-shockwave-flash" data="'+url+'" width="200" height="170" menu="false" wmode="transparent">');
document.write('<param name="movie" value="'+url+'">');
document.write('<param name="menu" value="false">');
document.write('<param name="wmode" value="transparent">');
document.write('<\/object>');
}


// EMBEDS AN UPLOADED FLV
function embedVideo (url) {
document.write('<object class="video" type="application/x-shockwave-flash" data="/params/video/player.swf?video='+url+'" width="200" height="170" menu="false" wmode="transparent">');
document.write('<param name="movie" value="/params/video/player.swf?video='+url+'">');
document.write('<param name="menu" value="false">');
document.write('<param name="wmode" value="transparent">');
document.write('You need Flash (version 8+) to view the video... please download it <a href="http://www.adobe.com/go/getflashplayer" target="_blank">here</a>.<br><br>');
document.write('<\/object>');
}


// QUANTITY FOR SHOP
function plus(thisOne) {
x = document.getElementById("qty"+thisOne)
x.value=parseFloat(x.value)+1
}

function minus(thisOne) {
x = document.getElementById("qty"+thisOne)
if (x.value!='0'){
	x.value=parseFloat(x.value)-1}
}

function resizeMe(x){
var theIframe = document.getElementById(x)
var theIframeHeight = Math.max(theIframe.contentWindow.document.body.scrollHeight, theIframe.contentWindow.document.documentElement.scrollHeight);
theIframe.style.height = theIframeHeight+"px"
theIframe.contentWindow.document.getElementById('iframeContent').style.visibility = "visible"
}