function showDiv(id)
{
	document.getElementById(id).style.display="block"; 
}
function closeDiv(id)
{
	document.getElementById(id).style.display="none"; 
}
function toggleDiv(id)
{
	if(document.getElementById(id).style.display=="none")
	{
		document.getElementById(id).style.display="block"; 
	}else{
		document.getElementById(id).style.display="none"; 
	}
}
function openWin(which,params,w,h)  {
       if(which.indexOf(".mov")!= -1)
		{       //is the demo video
	       params = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=270,height=210,dependent";
	       newWin = window.open(which,'',params)
	       window.newWin.focus();
		}else{
	       params = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+w+",height="+h+",dependent";	       newWin = window.open(which,'',params)
	       window.newWin.focus();
		}
}


function confirm_action(message,newurl)
{
	if(confirm(message))
	{
		window.location.href = newurl;
	}else{
		
	}
}
function confirm_submit(message,form_id)
{
	if(confirm(message))
	{
		document.getElementById(form_id).submit();
	}else{
		
	}
}
function wt_ajax(url,pars,return_id)
{
	if(return_id !="")
	{
		$(return_id).load(url+"?"+pars);	
	}else{
		$.get(url+"?"+pars);
	}
}
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);
}