	//Define global variables
	var totalLayersInLoop=10;
	var layerNumShowing=1;


	function showLayerNumber(number){
	   var layerNumToShow=number;

	   hideLayer(eval('"layer' + layerNumShowing+ '"'));
	   showLayer(eval('"layer' + layerNumToShow+'"'));

	   layerNumShowing=layerNumToShow;
	}

	function hideLayerNumber(number){
	   hideLayer(eval('"layer' + number+ '"'));
	}

	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 textCounter(field, countfield, maxlimit) {
		if (field.value.length > maxlimit)
			field.value = field.value.substring(0, maxlimit);
		else
			countfield.value = maxlimit - field.value.length;
	}

	function popUp(URL,width,height,scrollbars) {
		if(!scrollbars) { scrollbars='0';}
		if(!width) {width='800';}
		if(!height) {height='600';}

		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,left=124,top=200,scrollbars="+scrollbars+",location=0,statusbar=0,menubar=0,resizable=0,width="+width+",height="+height+"');");
	}

	function favoriten(favorit,width,height,scrollbars) {
		popUp("favoriten_"+favorit,width,height,scrollbars);		
	}
	
	function wongpopup()
	{
		var uri = 'http://www.mister-wong.de/index.php?action=addurl&bm_url=' + encodeURIComponent(location.href) + '&bm_description=' + encodeURIComponent(document.title);
		window.open(uri);
	}