// JavaScript Document
function ShowDiv(Id)
{
	//alert(Id);
	try{
	document.getElementById(Id).style.display = "block";
	}
	catch(e){}
}

function HideDiv(Id)
{
	try{
	document.getElementById(Id).style.display = "none";
	}
	catch(e){}
}

function ShowHideDiv(Id)
{
	if (document.getElementById(Id).style.display == "none")
		document.getElementById(Id).style.display = "block";
	else
		document.getElementById(Id).style.display = "none";
}

function ChangeStyle(Obj,className)
{
	try
	{
		Obj.setAttribute("class",className);
	}
	catch(e){};
	
	try
	{
		Obj.setAttribute("className",className);
	}
	catch(e){}
}

var arrOnLoadFunctions = new Array();
function OnLoad()
{
	//alert(arrOnLoadFunctions.length);
	for (i=0; i < arrOnLoadFunctions.length; i++)
	{
		eval(arrOnLoadFunctions[i]);
	}
}

function ShowPopup(pPage, pId)
{
	var objPopup = document.getElementById("Popup");
	objPopup.style.display = "block";
	objPopup.style.top = document.body.scrollTop;
	window.open("./?page=" + pPage + "&id=" + pId,"PopupFrame");
}

function HidePopup()
{
	window.open("./loading.html","PopupFrame");
	HideDiv("Popup");
}

var TaskBar_TimeOut;

function MoveTaskBar_Start()
{
	var obj = document.getElementById("TaskBar");
	obj.style.display = "block";
	obj.style.bottom = 0;
	TaskBar_TimeOut = setTimeout("MoveTaskBar()",0);
}

function MoveTaskBar()
{
	clearTimeout(TaskBar_TimeOut);
	//Move Task Bar
	var obj = document.getElementById("TaskBar");
	//obj.style.bottom = - document.body.scrollTop;
	obj.style.bottom = parseInt(obj.style.bottom) - Math.round((document.body.scrollTop + parseInt(obj.style.bottom))/2);
	TaskBar_TimeOut = setTimeout("MoveTaskBar()",50);
}

function WindowResize()
{
	//MoveTaskBar();
	
}


function callCalendarShow(pId)
{
	var tDivContentId;
	tDivContent = (pId == "Tournee")?"Other":"Paris";
	tDivOpContent = (pId == "Tournee")?"Paris":"Other";

	tOpId = (pId == "Tournee")?"Paris":"Tournee";

	//content
	ShowDiv("province" + tDivContent); 	HideDiv("province" + tDivOpContent);
	
	//tab
	ShowDiv(pId + "Active" ); 	HideDiv(pId);
	ShowDiv(tOpId); 			HideDiv(tOpId + "Active");
	init_dw_Scroll();
	
	
}


window.onresize = WindowResize;

arrOnLoadFunctions.push("MoveTaskBar_Start();");