  	
		function show_wait() {
			
			var count = document.forms[0].length;
			
			for (var num = 0; num < count; num++) {
			
				document.forms[0].elements[num].style.visibility = 'hidden';
			
			}
			
			document.getElementById('please_wait').style.left = document.body.scrollLeft;
			document.getElementById('please_wait').style.top 	= document.body.scrollTop;
			document.getElementById('please_wait').style.visibility = 'visible';
			
		}
		
		function help(PHPSESSID, MOD, TPL) {
		
			window.open('index.php?PHPSESSID=' + PHPSESSID + '&mod=help&tpl=help&window=popup&help_mod=' + MOD + '&help_tpl=' + TPL + '&init');
			
		}
		
		function c2p_switch_menue () {
		
			var template_view = c2p_get_curr_template_view();
			
			if (!template_view)
					template_view	= 'arrow_left_white.gif';
			
			c2p_show_hide_menue(template_view);
			
			var NEW_ARROW = (template_view == 'arrow_left_white.gif') ? 'arrow_right_white.gif' : 'arrow_left_white.gif' ;
			document.cookie = "template_view=" + NEW_ARROW;
		
		}
		
		function c2p_get_curr_template_view() {
			
			if (!document.getElementById('template_arrow'))
				return;
			
			var CURR_SRC 								= document.getElementById('template_arrow').src;
  		var SLASHES									= CURR_SRC.split("/");
			
			var CURR_ARROW							= SLASHES[SLASHES.length-1];
			
			var COOKIE									= document.cookie.split(";");
			
			for (var cn = 0; cn < COOKIE.length; cn++) {
				
				var TEMP 				= COOKIE[cn].split("=");
				var TEMP_COOKIE = TEMP[0].replace(/ /, "");
				
				if (TEMP_COOKIE == 'template_view') {
					
					var COOKIE_TEMPLATE_VIEW		= TEMP[1];
					
				}
			}
			
			return COOKIE_TEMPLATE_VIEW;
			
		}
		
		function c2p_show_hide_menue(ARROW) {
			
			if (!document.getElementById('template_arrow'))
				return;
			
			var CURR_SRC 								= document.getElementById('template_arrow').src;
  		
			switch (ARROW) {
  			
				// hide menue
				
				case  'arrow_left_white.gif':
  				
					var NEW_ARROW		= 'arrow_right_white.gif';
    			
    			document.getElementById('menue_scope').style.display = 'none';
    			
  			break;
			
				// show menue
			
				case 'arrow_right_white.gif':
				default:
					
					var NEW_ARROW		= 'arrow_left_white.gif';
					
    			document.getElementById('menue_scope').style.display = 'inline';
				
				break;
    	
			}
			
			var NEW_SRC 		= CURR_SRC.replace(ARROW, NEW_ARROW);
			document.getElementById('template_arrow').src 							= NEW_SRC;
			
		}
		
  	function change_seperator(OBJ, SEPERATOR_STR, SEPERATOR) {
  		
  		var SEPERATOR_ARRAY = SEPERATOR_STR.split("");
  		var OBJ_DATA 				= OBJ.value;
  		
  		for (var num = 0; num < SEPERATOR_ARRAY.length; num++) {
  			
				for (var count = 0; count < 5; count++) {
					
	 				OBJ_DATA = OBJ_DATA.replace(SEPERATOR_ARRAY[num], SEPERATOR);
					
				}
  		}
  		
  		OBJ.value = OBJ_DATA;
  		
  	}
		
		function switch_mod (MOD, CURR_TPL, TPL, ACTION, KEY, VALUE) {
			
			show_wait();
			
			eval("document." + CURR_TPL + ".mod.value = '" + MOD + "';");
			eval("document." + CURR_TPL + ".tpl.value = '" + TPL + "';");
			eval("document." + CURR_TPL + ".action.value = '" + ACTION + "';");
			
			if (KEY && VALUE)
				eval("document." + CURR_TPL + "." + KEY + ".value = '" + VALUE + "';");
			
			window.setTimeout("document." + CURR_TPL + ".submit();", 500);
			
		}
		
		function option (SHOW, HIDE) {
			
			if (SHOW != '') {
			
  			var obj = document.getElementById(SHOW);
  			
  			if (obj.style.visibility == 'visible') {
  			
  				obj.style.visibility = 'hidden';
  				document.getElementById("reg_" + SHOW).style.backgroundColor 	= '#ffffff';
  				
  			}
  			else {
  			
  				obj.style.visibility = 'visible';
  				document.getElementById("reg_" + SHOW).style.backgroundColor = '#eeeeee';
  			
  			}
			}
			
			if (HIDE != '') {
			
  			var ARRAY = HIDE.split(";");
  			
  			for (var id = 0; id < ARRAY.length; id++) {
  				
  				document.getElementById(ARRAY[id]).style.visibility 							= 'hidden';
  				document.getElementById("reg_" + ARRAY[id]).style.backgroundColor = '#ffffff';
  				
  			}
			}
		}
		
		function menue_alpha(img_id, mouse) {
			
			if (mouse == 'out' && document.getElementById('form').mod_menue.value == img_id.replace(/img_/,""))
				return;
				
			obj = document.getElementById(img_id);
			
			if (obj)
				obj.style.filter = (mouse == 'in') ? "" : "Alpha(opacity=50, finishopacity=50, style=2) Gray();";
				
		}
		
		function $(ID) {
			
			return document.getElementById(ID);
		
		}
