var host = 'http://'+location.hostname;
function menu_on(id){
	var element = document.getElementById('submenu_'+id);
	element.style.display = "block";
}
function menu_off(id){
	var element = document.getElementById('submenu_'+id);
	element.style.display = "none";
}

function smile(i){
	var area = document.getElementById('forum_area');
	area.value += '['+i+']';	
	area.focus();
}
function b_on(i){
	var elem = document.getElementById('span'+i);
	elem.style.background = "url("+host+"/img/menu_on.jpg) right bottom no-repeat";
}
function b_off(i){
	var elem = document.getElementById('span'+i);
	elem.style.background = "url("+host+"/img/menu_off.jpg) right bottom no-repeat";
}
function popup(url){
	
	if(navigator.appName == 'Netscape' || navigator.appName == 'Opera'){
			ScreenWidth_half = Math.round(window.innerWidth/2);
	}
	else if(navigator.appName == 'Microsoft Internet Explorer'){
		ScreenWidth_half = Math.round(document.documentElement.clientWidth/2);
	}
	else{
		ScreenWidth_half = Math.round(window.innerWidth/2);
	}
	left_p = ScreenWidth_half - 450;

	window.open(url,'popup','width=900,height=650,top=50,left='+left_p+',scrollbars=1');
	
}

/*
var div = document.getElementById('gallery');
var loading = document.getElementById('loading');
var shadow = document.getElementById('shadow');

function banner(path)
{
	div.style.opacity = 0;
	div.style.filter = "alpha(opacity=0);";

	var ScrollPosition = document.documentElement.scrollTop;
	shadowHeight = document.body.clientHeight;

	if(shadowHeight < document.documentElement.clientHeight){
		shadowHeight = document.documentElement.clientHeight;
	}

	shadow.style.height = shadowHeight + "px";
	shadow.style.display = 'block';

	img = new Image();
 	img.src = host + '/banners/' + path;
	image = host + '/banners/' + path;

	if(navigator.appName == 'Netscape' || navigator.appName == 'Opera'){
		ScreenHeight_half = Math.round(window.innerHeight/2);
	}
	else if(navigator.appName == 'Microsoft Internet Explorer'){
		ScreenHeight_half = Math.round(document.documentElement.clientHeight/2);
	}
	else{
		ScreenHeight_half = Math.round(window.innerHeight/2);
	}

	loading.style.top = ScreenHeight_half + ScrollPosition - 8 + 'px';
	loading.style.display = 'block';

	var n=0;

	function galleryAlpha(){
		n += 0.1;
		div.style.opacity = n;
		div.style.filter = "alpha(opacity=" + n*100 + ")";

		if(n>1){

			if(meter != "undefined"){
				clearInterval(meter);
			}

		}
	}

	function ShowImage()
	{
		var ImgWidth  = img.width+20;
		var ImgHeight = img.height;
		var ImgBorder = 10;

		ImgWidth_half  = Math.round(ImgWidth/2);
		ImgHeight_half = Math.round(ImgHeight/2);

		div.style.top = '10px'; //ScreenHeight_half + ScrollPosition - ImgHeight_half - ImgBorder + 'px';
		div.style.marginLeft = '-'+ImgWidth_half+'px';
		div.innerHTML = '<a href="javascript:close();"><img class="g_image" src="'+image+'" />';
		div.innerHTML += '<a class="gallery_close" href="javascript:close();"><img border="0" src="' + host + '/images/close.jpg" alt="close" /></a>';
		loading.style.display = 'none';
		div.style.display = 'block';
		meter = setInterval(galleryAlpha,50);
	}
	if (img.complete) {
		ShowImage();
	}
	else {
		img.onload = function() {
			ShowImage();
		}
	}
}
*/
