function launchwin(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);

  if (window == null || window.closed)
	{
	newwindow = window.open(theURL,winName,features);
		if (window.opener == null) // set the opener property manually for Nav 2.0.
		{				
			//window.opener = windowparent;
		}
	window.opener.name = windowparent; // give our parent window a name so we can target it from newwindow
	}	
 }

	 
function secureWindow(theURL, width, height) {
   windowprops = "width=" + width + ",height=" + height;
   if (document.all||document.layers||document.getElementById)
   {
   	var top = ((screen.height-50)-height)/2;
  	var left = ((screen.width-10 )-width)/2;
  	 windowprops += ",top=" + top + ",left=" + left;
   }
   	windowprops += "location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0";
  	 //alert(theURL);
	 secure = window.open(theURL, 'secure', windowprops);
	secure.focus();
  }	 
	 
function defaultMessageWindow(theURL, width, height, scrollbars) {
   windowprops = "width=" + width + ",height=" + height+",scrollbars="+scrollbars;
   messageWindow = window.open(theURL, 'messageWindow', windowprops);
   messageWindow.focus();
 }		 
	 
	 
function NewPrintWindow(FileToPrint) {
PrintWindow = window.open(FileToPrint,"","height=600,width=650,toolbar=yes,statusbar=no,menubar=no,titlebar=yes,location=no,scrollbars=yes");
			PrintWindow.focus();
}	
/* used by Facebook and other sharing/social networking links */
function openShareWindow(site){
	var pageURL = escape(window.location.href);
	var articleTitle = 'null';
	var articleLeadin = 'null';
	switch (site) {
			case "Digg":
			postPopUp('http://digg.com/remote-submit?phase=2&url=' + pageURL + '&title=' + articleTitle + '&bodytext=' + articleLeadin +'', 'digg', 'toolbar=0,status=0,height=450,width=650,scrollbars=yes,resizable=yes');
			break;	
			case "Delicious":
			postPopUp('http://del.icio.us/post?v=4&partner=nyt&noui&jump=close&url=' + pageURL + '&title='+ articleTitle+ '&bodytext='+ articleLeadin+'', 'delicous', 'toolbar=0,status=0,height=450,width=650,scrollbars=yes,resizable=yes');
			break;
			case "Reddit":
			postPopUp('http://reddit.com/submit/?url=' + pageURL + '&title='+ articleTitle+ '', 'reddit', 'toolbar=0,status=0,height=450,width=650,scrollbars=yes,resizable=yes');
			break;
			case "Facebook":
			postPopUp('http://www.facebook.com/sharer.php?u=' + pageURL + '&t=' + articleTitle, 'facebook', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');
			break;
			case "Linkedin":
			postPopUp('http://www.linkedin.com/shareArticle?mini=true&url=' + pageURL, 'linkedin', 'toolbar=0,status=0,height=650,width=646,scrollbars=yes,resizable=yes');
			break;
			case "Newsvine":
			postPopUp('http://www.newsvine.com/_wine/save?ver=2&popoff=1&u=' + pageURL + '', 'Newsvine', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');
			break;
			case "Twitter":
			postPopUp('http://twitter.com/home?status=' + pageURL + '', 'Twitter', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');
			break;
	}
}
/* used by Facebook  so that title displays page name or blog entries name*/
function openShareWindowFacebook(pageName){
	var pageURL = escape(window.location.href);
	var articleTitle = (pageName);
	var articleLeadin = 'null';
	 {
			
			postPopUp('http://www.facebook.com/sharer.php?u=' + pageURL + '&t=' + articleTitle, 'facebook', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');
			
	}
}
function postPopUp(url, name, params) {
	var win = window.open(url, name,params);
}
