
var scroller  = null;
var scrollbar = null;

function scrollers_init() {
		//alert('halo');
if (document.getElementById("Container") != null)
  scroller  = new jsScroller(document.getElementById("Container"), 400, 484);
if (document.getElementById("Scrollbar-Container") != null)
  scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container"), scroller, true, scrollbarEvent);
}

function scrollbarEvent (o, type) {
	/*if (type == "mousedown") {
		if (o.className == "Scrollbar-Track") o.style.backgroundColor = "#E3E3E3";
		else o.style.backgroundColor = "#BBB";
	} else {
		if (o.className == "Scrollbar-Track") o.style.backgroundColor = "#EEE";
		else o.style.backgroundColor = "#CCC";
	}*/
}
function td_hover(ob)
{
	ob.style.backgroundImage = "url('menu-item-hover-background.gif')";
}
function td_unhover(ob)
{
	ob.style.backgroundImage = "url('menu-background.gif')";
}
function td_hover_down(ob)
{
	ob.style.backgroundColor = "#edfafa"; //"url('down-menu-item-hover-background.gif')";
}
function td_unhover_down(ob)
{
	//ob.style.backgroundImage = "";
	ob.style.backgroundColor = "Transparent";
}
function td_hover_btn(ob)
{
	document.getElementById("td"+ob.id).style.backgroundImage = "url('menu-item-hover-background.gif')";
}
function td_unhover_btn(ob)
{
	document.getElementById("td"+ob.id).style.backgroundImage = "url('menu-background.gif')";
}

function GetPageSize()
{
	if( window.innerHeight && (window.scrollMaxY != null)  || navigator.appName=="Opera") // Firefox 
	{
		wWidth = window.innerWidth;

	}
	else if (navigator.appName=="Microsoft Internet Explorer")
	{
		wWidth = document.body.offsetWidth;
	}
	else
	{
		wWidth = window.innerWidth;
	}

	return wWidth;
}
function SuperResizeMe()
{
	//alert("SuperResizeMe");
	var w = GetPageSize();
	var d = w - 1200;
	
	var ob_all = document.getElementById("all");
	
	if (d <= 0)
		ob_all.style.marginLeft = "0";
	else
	{
		ob_all.style.marginLeft = d/2 + "px";
	}
}

function search_games()
{
	t = document.getElementById('search_games_text').value;
	window.location = "index.php?m=games&ms="+t;

}

function search_htlms()
{
	t = document.getElementById('search_htmls_text').value;
	window.location = "index.php?title=search&m="+t;

}

function switch_tab_news(id1, id2)
{
	var id1_ob = document.getElementById(id1);
	var id2_ob = document.getElementById(id2);	
	
	
	//id1_ob.style.visibility = "visible";
	//id2_ob.style.visibility = "hidden";
	
	id1_ob.className = "btabdiv_active";
	id2_ob.className = "btabdiv_inactive";
	
	var id1_body = document.getElementById("body_"+id1);
	var id2_body = document.getElementById("body_"+id2);	
	
	id1_body.style.visibility = "visible";
	id2_body.style.visibility = "hidden";
	
	var id1_scrollbar = document.getElementById("Scrollbar-Container_news_home_"+id1);
	var id2_scrollbar = document.getElementById("Scrollbar-Container_news_home_"+id2);	
	//Scrollbar-Container_news_home_idg
	
	id1_scrollbar.style.display = "inline";
	id2_scrollbar.style.display = "none";
}


function switch_tab_careers(id1)
{	
	//alert("jestem");
	var id1_ob = document.getElementById(id1);
	
	//alert("1");
	var ob = document.getElementById('idp');	
	if (ob != null)
	ob.className = "btabdiv_inactive";
	
	//alert("2");
	ob = document.getElementById('idr');	
	if (ob != null)
	ob.className = "btabdiv_inactive";
	
	//alert("3");
	ob = document.getElementById('ido');	
	if (ob != null)
	ob.className = "btabdiv_inactive";
	
	//alert("4");
	ob = document.getElementById('idw');	
	if (ob != null)
	ob.className = "btabdiv_inactive";
	
	//alert("5");
	ob = document.getElementById('body_idp');	
	if (ob != null)
	ob.style.visibility = "hidden";
	
	//alert("6");
	ob = document.getElementById('body_idr');	
	if (ob != null)
	ob.style.visibility = "hidden";
	
	//alert("7");
	ob = document.getElementById('body_ido');	
	if (ob != null)
	ob.style.visibility = "hidden";
	
	//alert("8");
	ob = document.getElementById('body_idw');	
	if (ob != null)
	ob.style.visibility = "hidden";
	
	//alert("9");
	ob = document.getElementById('body_'+id1);	
	
	//alert("10");
	if (ob != null)
	ob.style.visibility = "visible";
	if (id1_ob != null)
	id1_ob.className = "btabdiv_active";
	
}

function switch_tab_support(id1)
{	
	var id1_ob = document.getElementById(id1);
	
	var ob = document.getElementById('ids');	
	if (ob != null) ob.className = "btabdiv_inactive";
	
	ob = document.getElementById('idp');	
	if (ob != null) ob.className = "btabdiv_inactive";
	
	ob = document.getElementById('ida');	
	if (ob != null) ob.className = "btabdiv_inactive";
	
	ob = document.getElementById('idu');	
	if (ob != null) ob.className = "btabdiv_inactive";
	
	ob = document.getElementById('body_ids');	
	if (ob != null) ob.style.visibility = "hidden";
	
	ob = document.getElementById('body_idp');	
	if (ob != null) ob.style.visibility = "hidden";
	
	ob = document.getElementById('body_ida');	
	if (ob != null) ob.style.visibility = "hidden";
	
	ob = document.getElementById('body_idu');	
	if (ob != null) ob.style.visibility = "hidden";
	
	ob = document.getElementById('body_'+id1);	
	
	if (ob != null) ob.style.visibility = "visible";
	id1_ob.className = "btabdiv_active";
	
}

function Collapse(){ 
  //alert ("col");
  document.getElementById('flash_scroll').style.zIndex = "0";

}
function Expand(){ 
  document.getElementById('flash_scroll').style.zIndex = "100";

}

function switch_link_inv(ob_id,rootname,sub1)
{
	o = document.getElementById(current_inv_visible+"#content");
	if (o != null)	o.style.display = "none";
	o = document.getElementById(current_inv_visible+"#img");
	if (o != null)	o.style.display = "none";
	o = document.getElementById(current_inv_visible+"#span");
	if (o != null)	o.style.display = "inline";
	
	o = document.getElementById(current_inv_root_visible+"#img");
	if (o != null)	o.style.display = "none";
	o = document.getElementById(current_inv_root_visible+"#span");
	if (o != null)	o.style.display = "inline";
	
	o = document.getElementById(rootname+"#img");
	if (o != null)	o.style.display = "inline";
	o = document.getElementById(rootname+"#span");
	if (o != null)	o.style.display = "none";
	
	current_inv_root_visible = rootname;
	
	o = document.getElementById(current_inv_visible+"#img#sub1");
	if (o != null)  o.style.display = "none";
	o = document.getElementById(current_inv_visible+"#span#sub1");
	if (o != null)  o.style.display = "inline";
	
	//alert(ob_id+"#content");
	o = document.getElementById(ob_id+"#content");
	if (o != null)	o.style.display = "inline";
	o = document.getElementById(ob_id+"#img");
	if (o != null)	o.style.display = "inline";
	o = document.getElementById(ob_id+"#span");
	if (o != null)	o.style.display = "none";
	
	current_inv_visible = ob_id;
	
	//alert(sub1);
	if (sub1 == "sub1")
	{
		o = document.getElementById(ob_id+"#img#sub1");
		o.style.display = "inline";
		o = document.getElementById(ob_id+"#span#sub1");
		o.style.display = "none";
	}
	
	//alert( current_inv_visible +' '+ current_inv_root_visible);
}
function switch_tab_inv(ob,counts)
{
	//alert("switch_tab_inv");
	
	for (ii=0;ii<counts;ii++)
	{
		o = document.getElementById("INVEST#tab#"+ii);
		if (o != null)	o.className = "btabdiv_inactive";
		
		o = document.getElementById("INVEST#tab#"+ii+"#sidemenu#");
		if (o != null)	o.style.display = "none";
	}	
	
	ob.className = "btabdiv_active";
	
	o = document.getElementById(ob.id+"#sidemenu#");
	if (o != null)	o.style.display = "inline";
	
	//alert("current_inv_visible "+current_inv_visible);
	
	o = document.getElementById(current_inv_visible+"#content");
	if (o != null)	o.style.display = "none";
	o = document.getElementById(current_inv_visible+"#img");
	if (o != null)	o.style.display = "none";
	o = document.getElementById(current_inv_visible+"#span");
	if (o != null)	o.style.display = "inline";
	
	o = document.getElementById(current_inv_visible+"#img#sub1");
	if (o != null)	o.style.display = "none";
	o = document.getElementById(current_inv_visible+"#span#sub1");
	if (o != null)	o.style.display = "inline";
	
	o = document.getElementById(current_inv_root_visible+"#img");
	if (o != null)	o.style.display = "none";
	o = document.getElementById(current_inv_root_visible+"#span");
	if (o != null)	o.style.display = "inline";
	
	//alert("zlozony: "+ob.id+"#sidemenu#link#0#content");
	
	o = document.getElementById(ob.id+"#sidemenu#link#0#content");
	if (o != null)	o.style.display = "inline";
	
	o = document.getElementById(ob.id+"#sidemenu#link#0#img");
	if (o != null)	o.style.display = "inline";
	
	o = document.getElementById(ob.id+"#sidemenu#link#0#span");
	if (o != null)	o.style.display = "none";
	
	current_inv_visible = ob.id+"#sidemenu#link#0";
	
	//alert( current_inv_visible +' '+ current_inv_root_visible);
}

var current_inv_visible = "INVEST#tab#0#sidemenu#link#0";//"INVEST#link#".$counter."#".$counter_in."#content"
var current_inv_root_visible = "";

function Expand_Collapse(ob_id)
{
	o = document.getElementById(ob_id);
	ob = document.getElementById(ob_id+"_border");
	
	if (o != null && ob != null)
	{
		if (o.style.display == "none")
		{
			o.style.display = "inline";
			ob.style.borderTop = "1px solid #8bb9dd";
			ob.style.borderBottom = "1px solid #8bb9dd";
		}
		else
		{
			o.style.display = "none";
			ob.style.border = "0";
		}
	}
}

function switch_tab_car(ob,counts)
{
	//alert(ob.id);
	
	for (ii=0;ii<counts;ii++)
	{
		o = document.getElementById("CAREERS#tab#"+ii);
		if (o != null)	o.className = "btabdiv_inactive";
		
		o = document.getElementById("CAREERS#tab#"+ii+"#content");//CAREERS#tab#".$counter."#content
		if (o != null)	o.style.display = "none";
	
		//o = document.getElementById("CAREERS#tab#"+ii+"Scrollbar-Container");//CAREERS#tab#".$counter."#content
		//if (o != null)	
		//o.style.display = "none";
	
	}	
	
	ob.className = "btabdiv_active";
	
	
	o = document.getElementById(ob.id+"#content");
	if (o != null)	o.style.display = "inline";
	
	//o = document.getElementById(ob.id+"Scrollbar-Container");
	//if (o != null)	
	//o.style.display = "inline";
	
	//alert("po");
	/*
	o = document.getElementById(ob.id+"#sidemenu#link#0#img");
	if (o != null)	o.style.display = "inline";
	
	o = document.getElementById(ob.id+"#sidemenu#link#0#span");
	if (o != null)	o.style.display = "none";
	*/
}

function playerload()
{
	o = document.getElementById("if_player");
	o.src = "player.html";
}
