// 2006-2007 Pine Orchard Inc. (mg)

// Call from <A> OnClick. 
// Be sure to specify A's Target attribute. 




function popupF(e)
{
	// specially for popups with forms.
	var url
	var href=e.href
	if(href){
		url=href
	}else{
		// js handler for <input type="image"...OnClick="...> (no href attribute)
		// assumes "name" attribute begins with "href:" followed by URL
		url=e.name.substring(5);
	}
	var target="More";
	var hLeft=50;
	var hTop=92;
	var hWidth=580;
	popupV(url,target,hLeft,hTop,hWidth);
	return false; // cancel default submit
}


function popupMore(a)
{
	// popupA1(a,"More");
	popupAV2(a,"More",50,92,580);
	return false;
}

function popupWDPlans(a)
{
	popupAV(a,"WDPlans",30,620);
	return false;
}
function popupCartoon(a)
{
	popupAV(a,"Cartoon",60,580);
	return false;
}
function popupPolicy(a)
{
	popupAV(a,"Policy",35,520);
	return false;
}

// 
function popupA1(a,target)
{
	var url=a.href;
	a.target=target;
	a.Target=target;
	popup1(url,target);
	window.event.returnValue = false; //Cancel Event IE4
	return false;
}
function popupAV(a,target,hLeft,hWidth)
{
	var url=a.href;
	a.target=target;
	a.Target=target;
	popupV(url,target,hLeft,0,hWidth);
	window.event.returnValue = false; //Cancel Event IE4
	return false;
}
function popupAV2(a,target,hLeft,hTop,hWidth)
{
	var url=a.href;
	a.target=target;
	a.Target=target;
	popupV(url,target,hLeft,hTop,hWidth);
	window.event.returnValue = false; //Cancel Event IE4
	return false;
}


// General Windows
function popup1(url,sName)
{
	popup(url,sName,10,92,580,430);
}
function popupV(url,sName,hLeft,hTop,hWidth)
{
	// V for "vertical"
	var pad=32; // needed for borders?
	var hHeight;
	if(window.screen.availHeight){
		hHeight=(window.screen.availHeight)-hTop-pad;
		if(hHeight<300){hHeight=null;hTop=0;}
	}else{
		hTop=0;
	}
	popup(url,sName,hLeft,hTop,hWidth,hHeight);
}


function popup(url,sName,hLeft,hTop,hWidth,hHeight)
{
	params = "menubar=0,toolbar=0,directories=0,status=0,location=0,scrollbars=1,resizable=1";
	params += ",top=" + hTop;
	params += ",left=" + hLeft;
	params += ",width=" + hWidth;
	params += ",height=" + hHeight;
	popupOpen(url, sName, params);
}

function popupOpen(url, windowName, params)
{

	//self.name = "Main" // Add reference to this window
	                     // so popup can link back if needed.

	var win=null;
	win = window.open(url, windowName, params);

	agent = navigator.userAgent;
	if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) 
		// popup again? is  this needed?
		win = window.open(url, windowName, params);

	//if (!win.opener) {
	//    win.opener = window;
	//}

		
  	// move window topmost z-order
	win.focus();
	
}




