
// PRIMARYSOURCES POPUP HORIZONTAL
	var pscW = 600;
	var pscH = 540;
	var pscL = (screen.width) ? Math.ceil((screen.width/2) - (pscW/2)) : 0;
	var pscT = (screen.height) ? Math.ceil((screen.height/2) - (pscH/2)) : 0;
	var _PSC_HORIZ = 'left='+pscL+',top='+pscT+',location=0,statusbar=0,menubar=0,width='+pscW+',height='+pscH+'';

	// PRIMARYSOURCES POPUP VERTICAL
	var pscW = 400;
	var pscH = 600;
	var pscL = (screen.width) ? Math.ceil((screen.width/2) - (pscW/2)) : 0;
	var pscT = (screen.height) ? Math.ceil((screen.height/2) - (pscH/2)) : 0;
	var _PSC_VERT = 'left='+pscL+',top='+pscT+',location=0,statusbar=0,menubar=0,width='+pscW+',height='+pscH+'';


 function raw_popup_bk(url, target, features) {
    // pops up a window containing url optionally named target, optionally having features
	var theWindow;
	var winName = "largerphoto";
	target = winName;
	// check if a window is already instansiated 
	 if(eval("window." + winName + "document")){
		 
		 // pop  to front
 
		 if (parseInt(navigator.appVersion) >= 4) { eval(winName+".window.focus()"); }
		 return false; 
		 
	 } else{  // open popup window
	
     	if (isUndefined(features)) features = _POPUP_FEATURES;
   		if (isUndefined(target  )) target   = '_blank';
    	theWindow = window.open(url, target, features);
    	theWindow.focus();
    	return theWindow;
	 }
}



function link_popup_bk(src, w, h) {
	
	var horizontal_padding = 20;
	var vertical_padding = 80; 
	//var winMaxWidth = 600; // due to banner image size
	
	
    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
	
	// Local override of link_popup() to allow for image dimensions. 
	
	//w = Math.max(winMaxWidth, w); //  due to the header width (/kids/hmss05/graphics/l3_bnr_generic.gif) 600 is the min width
    var pscW = w + horizontal_padding;
	var pscH = h + vertical_padding;
	var pscL = (screen.width) ? Math.ceil((screen.width/2) - (pscW/2)) : 0;
	var pscT = (screen.height) ? Math.ceil((screen.height/2) - (pscH/2)) : 0;
	var local_PSC = 'left='+pscL+',top='+pscT+',location=0,statusbar=0,menubar=0,scrollbars=yes, width='+pscW+',height='+pscH+'';
	

   return raw_popup_bk(src.getAttribute('href'), src.getAttribute('target') || '_blank', local_PSC);
    
}




// pop-up script with resize capabilities added 5-10-06

var newwindow = '';
function popIt(pageName,winWidth,winHeight) {


newwindow = window.open(pageName,'mypop','left=200,top=150,height='+winHeight+',width='+winWidth+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
newwindow.resizeTo(winWidth+20,winHeight+80);


	if (window.focus) {newwindow.focus();}
	return false;
}
