// JavaScript Document

function small_panel_menu_rollover(mode,element)
{
	if(mode == "in")
	{
		element.parentNode.style.backgroundColor = "#cfe3f0";		
	}
	else if(mode == "out")
	{
		element.parentNode.style.backgroundColor = "";				
	}
}

function switch_image_banner(obj,imagename)
{
	for(i=1;i<=3;i++)
	{
		document.getElementById("num"+i).style.backgroundColor = "#ff6464";
	}
	obj.style.backgroundColor = "#ff0000"
	//alert(imagename);
	objimg = document.getElementById("image_banner");
	//alert(objimg.src);
	objimg.src = "images/"+imagename;
}

function menu_blur(mode,obj)
{
	if(mode == 1)
	{
		obj.style.backgroundImage = "url(images/menubar_blur.jpg)";
	}
	else if(mode == 2)
	{
		obj.style.backgroundImage = "none";
	}
}

function switch_active_vacany(obj,id)
{
	//alert(obj.checked+" "+id);
	location = "logic_handler/vacancy_manager.php?method=change_activation&id="+id+"&status="+obj.checked;
}

function switch_highlight_product(obj,id)
{
	location = "logic_handler/product_manager.php?method=highlight&id="+id+"&status="+obj.checked;	
}

function switch_active_news(obj,id)
{
	location = "logic_handler/news_manager.php?method=change_activation&id="+id+"&status="+obj.checked;	
}

function switch_latest_news(obj,id)
{
	location = "logic_handler/news_manager.php?method=change_latest_news&id="+id+"&status="+obj.checked;	
}

function switch_privilege(obj)
{
	//alert(obj.id+"_"+obj.checked);
	location = "logic_handler/privilege_manager.php?method=change_privilege&param="+obj.id+"_"+obj.checked;
}

function delete_project_category(id)
{
	if(confirm("Are you sure to delete this project category and entire project item that related with this category ?"))
		location = "logic_handler/project_manager.php?method=delete_category&id="+id;
}

function delete_product_brand(id)
{
	if(confirm("Are you sure to delete this product brand and entire product item that related with this brand ?"))
		location = "logic_handler/product_manager.php?method=delete_brand&id="+id;	
}

function delete_product_category(id)
{
	if(confirm("Are you sure to delete this product category and entire product item that related with this category ?"))
		location = "logic_handler/product_manager.php?method=delete_category&id="+id;
}

function delete_confirmation(url)
{
	if(confirm("Are you sure to delete this item ? "))
			location = url;
}

function delete_parent_data(mode,url)
{
	if(mode==1)
		alert("You can't delete this item because it's related with another data");
	else if(mode == 0)
	{
		if(confirm("Are you sure to delete this item ? "))
			//alert(url);
			location = url;
	}
}
