	//Define global variables
	var totalLayersInLoop=10;
	var layerNumShowing=1;

	function init(scre){
		if(!scre) {
			scre = screen.width;
		}
		if(scre>"800")  {
		   scre="1024";
		   screh = 768;
		}
		else  {
		   scre="800";
		   screh = 600;
		}
		self.resizeTo(scre,screh);

	        if (!DOM) {
				layerStyleRef="layer.";
				layerRef="document.layers";
				styleSwitch="";
        	}else{
				layerStyleRef="layer.style.";
				layerRef="document.all";
				styleSwitch=".style";
		}
	}

	function showLayerNumber(number){
	   var layerNumToShow=number;
	   hideLayer(eval('"layer' + layerNumShowing+'"'));
	   showLayer(eval('"layer' + layerNumToShow+'"'));

	   if(layerNumToShow<7)  {
		showLayer(eval('"loopControls' + layerNumToShow+'"'));
		showLayer(eval('"layer' + layerNumToShow+'navO"'));
		showLayer(eval('"layer' + layerNumToShow+'navL"'));
	   	if(layerNumShowing>6){layerNumShowing=3}	
		hideLayer(eval('"loopControls' + layerNumShowing+'"'));
		hideLayer(eval('"layer' + layerNumShowing+'navO"'));
		hideLayer(eval('"layer' + layerNumShowing+'navL"'));
	   }
	   layerNumShowing=layerNumToShow;
	}

	function showPreviousLayer(){
		var layerNumToShow=layerNumShowing-1;
		if (layerNumToShow < 1){layerNumToShow=totalLayersInLoop;}
		hideLayer(eval('"layer' + layerNumShowing+'"'));
		showLayer(eval('"layer' + layerNumToShow+'"'));
		layerNumShowing=layerNumToShow;
	}
	function showNextLayer(){
		var layerNumToShow=layerNumShowing+1;
		if (layerNumToShow > totalLayersInLoop){layerNumToShow=1;}
		hideLayer(eval('"layer' + layerNumShowing+'"'));
		showLayer(eval('"layer' + layerNumToShow+'"'));
		layerNumShowing=layerNumToShow;
	}

	function showLayer(layerName){
	    if(DOM || MS)
	        getElem("id",layerName,null).style.visibility = "visible";
	    else
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
	}
	
	function hideLayer(layerName){
	    if(DOM || MS)
	        getElem("id",layerName,null).style.visibility = "hidden";
	    else
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
	}
	function init_popup() {
		scre = screen.width;
		if(scre<"800")  {
		   scre="1024";
		   screh = 768;
		}
		else  {
		   scre="800";
		   screh = 600;
		}
		self.resizeTo(scre/2,screh/2);
		self.moveTo((scre-400),(screh -400)/2);
		self.focus();
	}
