	var show=0;
	function show_sub_menu(dir) {
		if (dir == 1) {
			show=1;
			document.getElementById("sub_menu").style.display = "block";
		} else {
			show=0;
			setTimeout("hide_sub()",500);
		}
	}
	
	function hide_sub() {
		if (show==0)
			document.getElementById("sub_menu").style.display = "none";
	}

	function show_gallery_image(image_name) {
		document.getElementById("big_photo").innerHTML="<img src='./media/loading.gif' />";
		var image = new Image();
		image.onload = function() {
	    		document.getElementById("big_photo").innerHTML='<img src="./media/image.php?img=media/uploaded_files/blocks_list/'+image_name+'&w=800&h=540" border="0" />';
		};
		image.src = './media/image.php?img=media/uploaded_files/blocks_list/'+image_name+'&w=800&h=540';
	}

	function show_gallery_image_w(image_name,id) {
		click_counter = id;
		document.getElementById("big_photo").innerHTML="<img src='./media/loading.gif' />";
		var image = new Image();
		image.onload = function() {
	    		document.getElementById("big_photo").innerHTML='<img src="./media/image.php?img=media/uploaded_files/weird1_list/'+image_name+'&w=800&h=540" border="0" />';
		};
		image.src = './media/image.php?img=media/uploaded_files/weird1_list/'+image_name+'&w=800&h=540';
	}
	
	function show_gallery_next() {
		click_counter++;
		if (click_counter >= images.length)
			click_counter = 0;		
		document.getElementById("big_photo").innerHTML="<img src='./media/loading.gif' />";
		var image = new Image();
		image.onload = function() {
	    		document.getElementById("big_photo").innerHTML='<img src="./media/image.php?img=media/uploaded_files/blocks_list/'+images[click_counter]+'&w=800&h=540" border="0" />';
		};
		image.src = './media/image.php?img=media/uploaded_files/blocks_list/'+images[click_counter]+'&w=800&h=540';
	}	
	function show_gallery_prev() {
		click_counter--;
		if (click_counter<0)
			click_counter = images.length -1;
		document.getElementById("big_photo").innerHTML="<img src='./media/loading.gif' />";
		var image = new Image();
		image.onload = function() {
	    		document.getElementById("big_photo").innerHTML='<img src="./media/image.php?img=media/uploaded_files/blocks_list/'+images[click_counter]+'&w=800&h=540" border="0" />';
		};
		image.src = './media/image.php?img=media/uploaded_files/blocks_list/'+images[click_counter]+'&w=800&h=540';
	}	
	function show_gallery_next_w() {
		click_counter++;
		if (click_counter >= images.length)
			click_counter = 0;
		document.getElementById("big_photo").innerHTML="<img src='./media/loading.gif' />";
		var image = new Image();
		image.onload = function() {
	    		document.getElementById("big_photo").innerHTML='<img src="./media/image.php?img=media/uploaded_files/weird1_list/'+images[click_counter]+'&w=800&h=540" border="0" />';
		};
		image.src = './media/image.php?img=media/uploaded_files/weird1_list/'+images[click_counter]+'&w=800&h=540';
	}	
	function show_gallery_prev_w() {
		click_counter--;
		if (click_counter<0)
			click_counter = images.length -1;		
		document.getElementById("big_photo").innerHTML="<img src='./media/loading.gif' />";
		var image = new Image();
		image.onload = function() {
	    		document.getElementById("big_photo").innerHTML='<img src="./media/image.php?img=media/uploaded_files/weird1_list/'+images[click_counter]+'&w=800&h=540" border="0" />';
		};
		image.src = './media/image.php?img=media/uploaded_files/weird1_list/'+images[click_counter]+'&w=800&h=540';
	}
	var cs = 0;
	var zindex=5;
	function imgi_slider(idi,current) {
		var last_current = current;
		var next_current = parseInt(current)+1;
		try {
			document.getElementById(idi+next_current).style;
			val = document.getElementById(idi+next_current);
		} catch(e) { 
			document.getElementById(idi+0).style;
			val = document.getElementById(idi+0);
			next_current = 0;
		}
		val.style.opacity = "0.0";
		val.style.filter = "alpha(opacity=0)";
		val.style.zIndex = zindex;
		zindex++;
		val.style.display = "block";
		fade_in(val.id,0);
		document.getElementById(idi+last_current).style.display = "none";
		setTimeout("imgi_slider('"+idi+"','"+next_current+"')",10000);
	} 
 
	function fade_in(id,inti) {  
		document.getElementById(id).style.opacity = "0."+inti;
		//alert("alpha(opacity="+(inti*10)+")");
		document.getElementById(id).style.filter = "alpha(opacity="+(inti*10)+")";
		if (inti == 9) return true;
		else inti++;
		setTimeout("fade_in('"+id+"','"+inti+"')",100);
	}	

	function correct_banner() {
		try {
			var nax = 140;
			if (navigator.appName == "Microsoft Internet Explorer")
				nax = 140;
			var ele = document.getElementById("banner_place");
			var ele1 = document.getElementById("banner_place1");
			if (ele.offsetHeight <= nax)
				return "";			
			ele.style.height=ele.offsetHeight;
			ele1.style.height=ele1.offsetHeight;
					
			var i = 0;
			while(1) {
					//alert(parseInt(ele.style.height.replace(/px/g,'')));
					if (parseInt(ele.style.height.replace(/px/g,'')) <= nax)
						return "";
					ele.style.height = ele.style.height.replace(/px/g,'') - 5;
					ele1.style.height = ele1.style.height.replace(/px/g,'') - 5;
					ele1.style.width = ele.offsetWidth + 20;
					ele.style.width = ele.offsetWidth + 15; 
					if (i >=3)
						return "";
					i++;
			}
		} catch(e) {}
	}
