/*********
    
    Tiny JS File for showing video Popups. Dont much like inline JS 
    
    16.06.06

 *********/

function popupURL(name, URL, theWidth, theHeight) {
	 window.open(URL,"popup_" + name,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + theWidth + ",height=" + theHeight + ",top=20,left=20");
}

function AddCruiseToCookies(tourid, tourname) {
	createCookie("avalon_" + tourid, tourname);
	window.location.reload();
}

function RemoveCruiseFromCookies(tourid) {
	eraseCookie("avalon_" + tourid);
	document.getElementById('favtour_' + tourid).style.display = 'none';
}

function ShowEmailLinker() {
	document.getElementById('email_div').style.display = 'block';
}

function HideEmailLinker() {
	document.getElementById('email_div').style.display = 'none';
}

function createCookie(name,value,days)
{
	value = escape(value);
	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);
}
