var themeBgColor;
jQuery(window).load(function(){
	themeBgColor = jQuery("TD.UnselectedTopTab").css('background-color');
});
function resizeImages()
{
	var width;
	if(self.innerWidth)
		width = self.innerWidth;
	else if(document.documentElement && document.documentElement.clientWidth)
		width = document.documentElement.clientWidth;
	else if(document.body)
		width = document.body.clientWidth;

	var ratio = width / old_width;
	//image_count = ".count($_FOCUS['Menu']).";
	if(ratio!=0 && ratio!=null)
	{
		for(i=0;i<document.images.length;i++)
			document.images[i].width = Math.round(document.images[i].width * ratio);
	}

	old_width = width;
	return true;
}

function getSize()
{
	if(self.innerWidth)
		old_width = self.innerWidth;
	else if(document.documentElement && document.documentElement.clientWidth)
		old_width = document.documentElement.clientWidth;
	else if(document.body)
		old_width = document.body.clientWidth;

	return true;
}

function openModcat(modcat)
{
	opened = true;

	if(old_modcat==modcat)
	{
		jQuery(old_modcat.childNodes[0].childNodes[0]).fadeOut(150);
		old_modcat.style.backgroundPosition = "0px 0px";
		old_modcat.style.backgroundColor = "";
		old_modcat.style.color = "#212121";
		opened = false
	}

	else if(old_modcat!=false)
	{

		//old_modcat.childNodes[0].childNodes[0].style.visibility = "hidden";
		old_modcat.style.backgroundPosition = "0px 0px";
		modcat.style.backgroundColor = "";
		old_modcat.style.color = "#212121";

		modcat.style.backgroundPosition = "0px -50px";
		modcat.style.color = "#FFFFFF";
		modcat.style.backgroundColor = themeBgColor;
		jQuery(modcat.childNodes[0].childNodes[0]).slideDown(100);

	}
	else
	{
		modcat.style.backgroundPosition = "0px -50px";
		modcat.style.color = "#FFFFFF";
		modcat.style.backgroundColor = themeBgColor;
		//document.getElementById("button_"+modcat).style.color = '#FFFFFF';
		//modcat.childNodes[0].childNodes[0].style.visibility = 'visible';
		jQuery(modcat.childNodes[0].childNodes[0]).slideDown(100);
	}

	if(old_modcat==modcat)
		old_modcat = false;
	else
		old_modcat = modcat;
}

function openRollover(modcat)
{
	if(old_modcat!=false && old_modcat!=modcat)
	{
		//old_modcat.childNodes[0].childNodes[0].style.visibility = "hidden";
		//old_modcat.childNodes[0].childNodes[0].style.display = 'none';
		jQuery(old_modcat.childNodes[0].childNodes[0]).hide();
		old_modcat.style.backgroundPosition = "0px 0px";
		old_modcat.style.backgroundColor = "";
		old_modcat.style.color = "#212121";

		//modcat.childNodes[0].childNodes[0].style.visibility = 'visible';
		//modcat.childNodes[0].childNodes[0].style.display = 'block';
		jQuery(modcat.childNodes[0].childNodes[0]).show();
		modcat.style.backgroundPosition = "0px -50px";
		modcat.style.backgroundColor = themeBgColor;
		modcat.style.color = "#FFFFFF";
		old_modcat = modcat;
	}
}

function disabletextselection(e){
	return false
}

function enabletextselection(){
	return true
}

