//----- Determine Browser

IE = (document.all) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
NS6 = (document.getElementById) ? 1 : 0;

var exit=false;

// ---- Do cookie stuff for ad servers
self.name='thiswindow';
var pv = getCookie('pv');
if (pv == null)
	{
	setCookie('pv','1',1);
	}
else	
	{
	var newcount = parseInt(pv) + 1;
	setCookie('pv',newcount,1);
	}

function mark_exit()
	{
	var hasexited = getCookie('he');
	if (hasexited == null)
		{
		setCookie('he','yes',12);
		ptExit();
		}
	}

function load_window(picturename,height,width)
	{
	var left;
	var top;
	var scrollbars="no";

	if (width>768)
		{
		height=height+95;
		}
	else
		{
		height=height+65;
		}

	if (width<470)
		{
		width=470;
		}

	if (width<screen.width)
		{
		left=(screen.width-width)/2;
		}
	else
		{
		left=0;
		scrollbars="auto";
		}
	if (height<(screen.height-20))
		{
		top=20+(((screen.height-20)-height)/2)
		}
	else
		{
		top=0;
		scrollbars="yes";
		}
	var tem;
	window.open("http://www.celebrity-fansites.com/p/picture.php?pic="+picturename, "pwin", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars="+scrollbars+",resizable=no,directories=no,location=no,width="+width+",height="+height+",left="+left+",top="+top+"");
	return true;
	}

function leave()
	{
	if (exit)
		{
		if (getCookie('skip')=='true')
			{
			}
		else
			{
			var winl = 3000;
			var wint = 3000;
			var winprops="";
			winprops = 'height=1, width=1, top=' + wint + ', left=' + winl;
			var win = window.open("http://www.celebrity-fansites.com/plauncher.html", "win",winprops);
			win.blur();
			self.focus();
			}
		}
	}

function add_bookmark()	
	{
	if (IE)
		{
		window.external.AddFavorite(window.location,document.title);
		}
	else
		{
		alert("You can bookmark this page by pressing 'Control' + 'D' on your keyboard");
		}
	}

function setCookie(NameOfCookie, value, expirehours)
	{
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expirehours * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) +
	((expirehours == null) ? "" : "; expires=" + ExpireDate.toGMTString()) +
	"; path=/;" ;
	}

function getCookie(NameOfCookie)
	{
	// First we check to see if there is a cookie stored.
	// Otherwise the length of document.cookie would be zero.
	if (document.cookie.length > 0)
 		{
 		// Second we check to see if the cookie's name is stored in the
		// "document.cookie" object for the page.
		// Since more than one cookie can be set on a
		// single page it is possible that our cookie
		// is not present, even though the "document.cookie" object
		// is not just an empty text.
		// If our cookie name is not present the value -1 is stored
		// in the variable called "begin".
		begin = document.cookie.indexOf(NameOfCookie+"=");
 		if (begin != -1) // Note: != means "is not equal to"
			{
 			// Our cookie was set.
 			// The value stored in the cookie is returned from the function.
			begin += NameOfCookie.length+1;
 			end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end));
			}
 		}
	return null;
 	// Our cookie was not set.
 	// The value "null" is returned from the function.
	}

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=50
}



function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}