function hide_form(){
	var d = document.getElementById("download");
	d.style.display = "none";

	var l = document.getElementById("loading");
	l.style.display = "block";
}

function popUp(url, w, h)
{

var wi = parseInt(w,10)+50;
var he = parseInt(h,10)+50;

    var popup = window.open("swf/"+url, "popup", "left=50, top=50, width="+wi+", height="+he+",resizable=yes");
    
    popup.document.open();
    
    popup.document.write(
	'<html><head><title></title></head><body style="background: #313f48;"><center><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+w+'" height="'+h+'"> <param name="menu" value="false" /> <param name="movie" value="'+url+'" /> <param name="quality" value="high" /> <embed src="'+url+'" menu="false" quality="high" width="'+w+'" height="'+h+'" name="bgcenterGame" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object><center></body></html>'
	);
   popup.document.close();
}


function popIt(url, w, h, name)
{
	if (!name){
		name = "";
	}
    var popup = window.open(url, name, "left=50, top=50, width="+w+", height="+h+", scrollbars=no, resizable=no, toolbar=no, titlebar=no");	
}

function fopIt(url, w, h)
{
    var popup = window.open(url, "", "left=50, top=50, width="+w+", height="+h+", scrollbars=yes");
        
}



/*=====================Cookies Functions===========================*/

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}



/*===============================================================*/

function show(num){
//createCookie("bgcenter_menu"+num,num,"7");
//alert(readCookie("bgcenter_menu"+num));
var dif = document.getElementById("submenu"+num);
var top = document.getElementById("left"+num);

if (dif.className == 'vis'){
dif.className = 'hid';
top.className = 'left1';
createCookie("bgcenter_menu"+num,"0-#-"+num,"7");
//alert(readCookie("bgcenter_menu"+num));
}else {
dif.className = 'vis';
top.className = 'left2';
createCookie("bgcenter_menu"+num,"1-#-"+num,"7");
//alert(readCookie("bgcenter_menu"+num));
}

}

function page(){
			var sPath = window.location.pathname;
			var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
			
			return sPage;
}

function color(what, el){
	var ans = document.getElementById("left"+el);
	if (what == 1 ) ans.style.textDecoration = 'underline';
	if (what == 0 ) ans.style.textDecoration = 'none';
}


function goImage(){

var ans = document.getElementById("goImage").value;

if (isNaN(ans)){
alert("Моля въведете число.")
return false;
}

window.location.href = "gallery.php?im="+ans;

}

