// popup.js 
// used for recipe cards and kids pages 
// expects :
//			url - of the window to be called
//			Title -  for the window, each unique title spawns a new window
//			width - in pixels of the desired window
//			height - in pixels of the desired window
//	hence a legal call would look like:
// <a href="JavaScript:popWindow('myurl.htm','popupwindowname','520','615')" >click here to spawn window</a>
//

oHTMLWin = null;

function centerWindow(url, name, w, h, scroll, menu, resizable)
{
	if (window.screen)
	{
		var chasm = screen.availWidth;
		var mount = screen.availHeight;
		
		winprops = 'width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=' + scroll + ',menubar=' + menu + ',resizable=' + resizable;
		
		oHTMLWin = window.open(url, name, winprops);
		oHTMLWin.window.focus();
	}
}

function popWindow(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "no", "no");
		
		/*strProps = "scrollbars=yes,width="+width+",height="+height;
        if(navigator.appName == "Netscape") {//moz
	        popWin = window.open(url,title,strProps);
	        popWin.focus();
        }
        else{  //ie
	       if (navigator.userAgent.indexOf("MSIE 3") >= 0){ 
	           popWin = window.open(url,title,strProps);
	           popWin.location.href = url;
	       }
	       else{
	           var popWin = window.open(url,title,strProps);
	       }
       }  */     
}

function popWindowResizeable(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "no", "yes");
		
		/*strProps = "scrollbars=yes,width="+width+",height="+height;
        if(navigator.appName == "Netscape") {//moz
	        popWin = window.open(url,title,strProps);
	        popWin.focus();
        }
        else{  //ie
	       if (navigator.userAgent.indexOf("MSIE 3") >= 0){ 
	           popWin = window.open(url,title,strProps);
	           popWin.location.href = url;
	       }
	       else{
	           var popWin = window.open(url,title,strProps);
	       }
       }  */     
}

function popWindowNoScroll(url,title,width,height){
		centerWindow(url, title, width, height, "no", "no", "no");
		
		/*strProps = "scrollbars=no,width="+width+",height="+height;
        if(navigator.appName == "Netscape") {//moz
	        popWin = window.open(url,title,strProps);
	        popWin.focus();
        }
        else{  //ie
	       if (navigator.userAgent.indexOf("MSIE 3") >= 0){ 
	           popWin = window.open(url,title,strProps);
	           popWin.location.href = url;
	           //if (popWin.opener == null) popWin.opener = window; 
	           //popWin.opener.name = "opener";
	       }
	       else{
	           var popWin = window.open(url,title,strProps);
	       }
       }  */    
}



function popWindowNoScrollResizeable(url,title,width,height){
		centerWindow(url, title, width, height, "no", "no", "yes");
		
		/*strProps = "scrollbars=no,width="+width+",height="+height;
        if(navigator.appName == "Netscape") {//moz
	        popWin = window.open(url,title,strProps);
	        popWin.focus();
        }
        else{  //ie
	       if (navigator.userAgent.indexOf("MSIE 3") >= 0){ 
	           popWin = window.open(url,title,strProps);
	           popWin.location.href = url;
	           //if (popWin.opener == null) popWin.opener = window; 
	           //popWin.opener.name = "opener";
	       }
	       else{
	           var popWin = window.open(url,title,strProps);
	       }
       }  */    
}




