// Rollover Left Nav: List Style
/*startList = function() 
	{ 
		if (document.all&&document.getElementById) { 
			navRoot = document.getElementById("leftnav");
			for (i=0; i<navRoot.childNodes.length; i++) { 
				node = navRoot.childNodes[i]; 
				if (node.nodeName=="LI") { 
					node.onmouseover=function() { 
						this.className+=" over"; 
					} 
					node.onmouseout=function() { 
						this.className=this.className.replace(" over", ""); 
					} 
				} 
			}
		} 
	} 
	window.onload=startList;*/
function startLeftNav() { 
	if (document.all&&document.getElementById) { 
		navRoot = document.getElementById("leftnav");
		for (i=0; i<navRoot.childNodes.length; i++) { 
			node = navRoot.childNodes[i]; 
			if (node.nodeName=="LI") { 
				node.onmouseover=function() { 
					this.className+=" over"; 
				} 
				node.onmouseout=function() { 
					this.className=this.className.replace(" over", ""); 
				} 
			} 
		}
	} 
} 




// for left nav -- flyout lev3 menu
function startLeftNavLev3() { 
	if (document.all&&document.getElementById) { 
		navRoot = document.getElementById("lev2");
		for (i=0; i<navRoot.childNodes.length; i++) { 
			node = navRoot.childNodes[i]; 
			if (node.nodeName=="LI") { 
				node.onmouseover=function() { 
					this.className+=" over"; 
				} 
				node.onmouseout=function() { 
					this.className=this.className.replace(" over", ""); 
				} 
			} 
		}
	} 
} 

// flash movie (upload flv files 400*335 -- width 400px)
function  loadSWFObject_w400(video_src) {
	var so = new SWFObject("http://www.columbiasurgery.org/mov/flv_w400.swf", "flvMovie", "400", "335", "8", "#ffffff"); 
	so.addVariable("flvMovie", video_src); 
	so.useExpressInstall('http://www.columbiasurgery.org/mov/expressinstall.swf');
	so.write("flash_movie"); 
}

// Flash Movie Pop Up Windwo (for movie 400*335 playing in a popup window, passsing flvURL variable)
function onFlvMovie400(url) {
	var flvWindow;
	flvWindow = window.open(url,'_blank','width=400,height=335,scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 		if (flvWindow.blur) flvWindow.focus();
} 

// flash movie (upload flv files 320*275 -- width 320px )
function  loadSWFObject_w320(video_src) {
	var so = new SWFObject("http://www.columbiasurgery.org/mov/flv_w320.swf", "flvMovie", "320", "275", "8", "#ffffff"); 
	so.addVariable("flvMovie", video_src); 
	so.useExpressInstall('http://www.columbiasurgery.org/mov/expressinstall.swf');
	so.write("flash_movie"); 
}

// Flash Movie Pop Up Windwo (for movie 320*275 playing in a popup window, passsing flvURL variable)
function onFlvMovie320(url) {
	var flvWindow;
	flvWindow = window.open(url,'_blank','width=320,height=275,scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 		if (flvWindow.blur) flvWindow.focus();
} 

//show hide area
	function show_div(div){
  		document.getElementById(div).style.display='block';
	}  	

// Rollover Image
function changeImg(imgName,imgSrc){
	document[imgName].src=imgSrc;
}		
// Dropdown Link
/* good for one select drop down menu

function goURL(shortcutForm){
	var URL = document.shortcutForm.selectURL.options[document.shortcutForm.selectURL.selectedIndex].value;
		if (URL != null) {
		window.location.href = URL;
	}
}
*/
// Dropdown Link -- good for multiple drop down menu
function goURL(shortcutForm){
	var URL = shortcutForm.options[shortcutForm.selectedIndex].value;
		if (URL != null) {
		window.location.href = URL;
	}
}
// Dropdown Link -- good for multiple drop down menu
function goURL_new(shortcutForm){
	var URL = shortcutForm.options[shortcutForm.selectedIndex].value;
		if (URL != null) {
		//window.location.href = URL;
		window.open (URL,"_blank");
	}
}


// Dropdown Link for Archive (Newsletter)
function goArchiveURL(shortcutForm){
	var URL = document.shortcutForm.selectULR.options[document.shortcutForm.selectULR.selectedIndex].value;
	parent.frames['content'].location.href = URL;
}

// Dropdown Link for Archive (Newsletter - NYPHeart: Replace the whole window)
function goArchiveURL_NYPHeart(shortcutForm){
	var URL = document.shortcutForm.selectULR.options[document.shortcutForm.selectULR.selectedIndex].value;
	parent.location.href = URL;
}

function init() {
	DynLayerInit();
	myscroll = new MiniScroll(scrollWindow,scrollContent);
}

// Focus/link to the main/parent window
function onMainWin(url){	
	if (!opener.closed){
		opener.location.href = url;
		opener.focus();
	} else {
		var mainWin = window.open(url,'mainWin');		
		mainWin.focus();		
	}		
}

function onTop(url) {
	var linkWin;
	if (!linkWin||linkWin.closed) {
		linkWin=window.open(url,'linkWin','height=450,width=600,scrollbars=yes,location=yes,resizable=yes,menubar=yes,toolbar=yes,directories=yes');
 	} else {
		linkWin.location.href=url;
	}
	linkWin.focus();		
}
 
function onFlaObesity(url) {
	var flaWin;
	if (!flaWin||flaWin.closed) {
		flaWin=window.open(url,'flaWin','height=584,width=764,scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no');
 	} else {
		opener.location.href = url;
		opener.focus();
	}
	flaWin.focus();				
}
// Focus the external linkwindow
function onDivTop(url) {
	var divisionwindow= null;
	divisionWindow = window.open(url,'_blank');
 		if (divisionWindow.blur) divisionWindow.focus();
} 

// Show the Staff List on the Staff Profile Page	
function showList() { 
	if (ng5) document.getElementById('stafflist').style.visibility = "visible"; 
	else if (ns4) document.layers["stafflist"].visibility = "show"; 
	else if (ie4) document.all["stafflist"].style.visibility = "visible"; 
}
// Open & Focus the Print-friendly Version Window
function onPrintWin(url) {
	var printWin;
	if (!printWin||printWin.closed){
		printWin=window.open(url,'printWin','height=450,width=600,scrollbars=yes,location=yes,resizable=yes,menubar=yes,toolbar=yes');
 	} else {
		printWin.location.href=url;
	}
	printWin.focus();		
} 
// NewsletterWindow
function onPPT(url) {
	var pptWin;
	if (!pptWin||pptWin.closed){
		pptWin = window.open(url,'pptWin','width=1200,height=780,scrollbars=auto,location=no,resizable=yes,menubar=no,toolbar=no,directories=no');
 	} else {	
		pptWin.location.href=url; 
	}
	pptWin.focus();		
} 

// NewsletterWindow
function onNewsletter(url) {
	var newsletterWin;
	if (!newsletterWin||newsletterWin.closed){
		newsletterWin = window.open(url,'newsletterWin','width=550,height=445,scrollbars=yes,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 	} else {	
		newsletterWin.location.href=url; 
	}
	newsletterWin.focus();		
} 

// Novartis
function onNovartis(url) {
	var novartisWindow= null;
	novartisWindow = window.open(url,'novartisWindow','width=600,height=500,scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 		if (novartisWindow.blur) novartisWindow.focus();
}

// ScondOpinion WIndow
function onSnd(url,w,h) {
	var sndWindow= null;
	sndWindow = window.open(url,'sndWindow','width='+w+',height='+h+',scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 		if (sndWindow.blur) sndWindow.focus();
	sndWindow.resizeTo(w,h);
} 

// Movie WIndow
function onMovie(url,w,h) {
	var movieWindow= null;
	movieWindow = window.open(url,'movieWindow','width='+w+',height='+h+',scrollbars=yes,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 		if (movieWindow.blur) movieWindow.focus();
	movieWindow.resizeTo(w,h);
} 

// Movie Window (320*240)
function onMovie320(url) {
	var movieWin;
	if (!movieWin||movieWin.closed){
		movieWin = window.open(url,'movieWin','width=320,height=255,scrollbars=no,location=no,resizable=yes,menubar=no,toolbar=no,directories=no');
 	} else {	
		movieWin.location.href=url; 
	}	
	movieWin.focus();
} 

// Movie Window (192*144)
function onMovie192(url) {
	var movieWin;
	if (!movieWin||movieWin.closed){
		movieWin = window.open(url,'movieWin','width=192,height=164,scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 	} else {	
		movieWin.location.href=url; 
	}	
	movieWin.focus();
} 
// Movie Window (for quicktime movie)
function onMovie352(url) {
	var movieWin;
	if (!movieWin||movieWin.closed){
		movieWin = window.open(url,'movieWin','width=352,height=260,scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 	} else {	
		movieWin.location.href=url; 
	}	
	movieWin.focus();
} 
// Movie Window (for quicktime movie)
function onQTMovie352(url) {
	var movieWindow;
	movieWindow = window.open(url,'movieWindow352','width=352,height=256,scrollbars=no,location=no,resizable=yes,menubar=no,toolbar=no,directories=no');
 		if (movieWindow.blur) movieWindow.focus();
} 

// Movie Window (for movie 480*360)
function onMovie480(url) {
	var movieWindow;
	movieWindow = window.open(url,'movieWin','width=480,height=365,scrollbars=no,location=no,resizable=yes,menubar=no,toolbar=no,directories=no');
 		if (movieWindow.blur) movieWindow.focus();
} 
// Movie Window (for movie 400*300)
function onMovie400(url) {
	var movieWindow;
	movieWindow = window.open(url,'movieWin','width=400,height=350,scrollbars=no,location=no,resizable=yes,menubar=no,toolbar=no,directories=no');
 		if (movieWindow.blur) movieWindow.focus();
} 
// Movie Window (for movie 640*480)
function onMovie640(url) {
	var movieWindow;
	movieWindow = window.open(url,'movieWin','width=640,height=480,scrollbars=no,location=no,resizable=yes,menubar=no,toolbar=no,directories=no');
 		if (movieWindow.blur) movieWindow.focus();
}  
function onNoScrollWin(url,w,h) {
	var newsletterWindow= null;
	movieWindow = window.open(url,'movieWindow','height='+h+',width='+w+',scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 		if (movieWindow.blur) movieWindow.focus();
	movieWindow.resizeTo(w,h);
} 
// Focus the external linkwindow
function onSmallWindow(url) {
	var smallWindow= null;
	smallWindow = window.open(url,'smallWindow','width=350,height=103,scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 		if (smallWindow.blur) smallWindow.focus();
} 

// Survery Window for Plastic Division (w:434;h:476)
function onSurvey(url) {
	var surveyWindow;
	if (!surveyWindow||surveyWindow.closed) {
		surveyWindow=window.open(url,'surveyWindow','width=434,height=476,scrollbars=no,location=no,resizable=no,menubar=no,toolbar=no,directories=no');
 	} else {
		surveyWindow.location.href=url;
	}
	surveyWindow.focus();		
}

function printIt() {
	if (window.print) {
		setTimeout('window.print();',200);
	}
	else if (agt.indexOf("mac") != -1) {
		alert("Press 'Cmd+p' on your keyboard to print article.");
	}
	else {
		alert("Press 'Ctrl+p' on your keyboard to print article.")
	}
}