// JavaScript Document

var whatPic = Math.ceil(2*Math.random())-1;
//var whatPic = 3;

var backImage = new Array();

backImage[0] = "/multimedia/images/skeleton/dreamstime_2793987.jpg";
backImage[1] = "/multimedia/images/skeleton/dreamstime_3720181.jpg";


function changeBGImage(whichImage){
if (document.body){
document.body.background = backImage[whichImage];

}
}


//var whatTable = document.getElementById("myTable");
// getElementById Special to handle quirky browsers
// most will use getElementById()
function getElementById_s(id){
			var obj = null;
			if(document.getElementById){
			/* Prefer the widely supported W3C DOM method, if
			available:-
			*/
			obj = document.getElementById(id);
			}else if(document.all){
			/* Branch to use document.all on document.all only
			browsers. Requires that IDs are unique to the page
			and do not coincide with NAME attributes on other
			elements:-
			*/
			obj = document.all[id];
			}
			/* If no appropriate element retrieval mechanism exists on
			this browser this function always returns null:-
			*/
			//alert(obj);
			return obj;
			
}

function alertSize() {
		  var myWidth = 0, myHeight = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		  }
		//  window.alert( 'Width = ' + myWidth +  'Height = ' + myHeight);
		
		//var whatTable = getElementById_s("myTable");
		var whatBackTable = getElementById_s("backTable");
		
		//alert(whatTable);
		//whatTable.style.height = myHeight;
		whatBackTable.style.height = myHeight;
		
		//alert(window.innerHeight);

}

function hideFrame(){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "hidden";
	
	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "hidden";

	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "";
}

function showCalendar(){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "https://secure.web.emory.edu/cancer/calendar/wciCalendar.html";
}

function showDirections(){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/framePages/wciDirections.html";
}

function showAppointments(){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "https://secure.web.emory.edu/cancer/forms/wciAppointments.html";
}

function showReferPatient(){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "https://secure.web.emory.edu/cancer/forms/wciReferPatient.html";
}

function showContacts(){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/framePages/wciContacts.html";
	
	hideScrollbar();
}

function showSIP(url){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "http://oncore.eushc.org/sip/SIPControlServlet?hdn_function=SIP_PROTOCOL_LISTINGS&"+url;
}

function showPrint(url){
	//var whatLayer1 = getElementById_s("Layer1");
	//whatLayer1.style.visibility = "visible";

	//var whatLayer2 = getElementById_s("Layer2");
	//whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/print.cfm?"+url;
}

//Scripts/cfm/search.cfm?keyword=
function showSearch(url){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/Scripts/cfm/search.cfm?phrase="+url;
}

function showNews(url){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/Scripts/cfm/showNews.cfm?newsid="+url;
}


function showPDF(url){
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
			var whatLayer1 = getElementById_s("Layer1");
			whatLayer1.style.visibility = "visible";
		 
			var whatLayer2 = getElementById_s("Layer2");
			whatLayer2.style.visibility = "visible";
			
			var whatIFrame = getElementById_s("wciIFrame");
			whatIFrame.src = "/printPDF.cfm?"+url;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
			var whatIFrame = getElementById_s("wciIFrame");
			whatIFrame.src = "/printPDF.cfm?"+url;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
	  }

}


function showReferPage(url){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/Scripts/cfm/referPage.cfm?"+url;
}

function showVolunteer(){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/Scripts/cfm/formVolunteer.cfm";
}

function showSymposiumRegistration(){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/research_symposium/register.php";
}

function showPeopleProfile(url){
	var whatLayer1 = getElementById_s("Layer1");
	whatLayer1.style.visibility = "visible";

	var whatLayer2 = getElementById_s("Layer2");
	whatLayer2.style.visibility = "visible";
	
	var whatIFrame = getElementById_s("wciIFrame");
	whatIFrame.src = "/Scripts/cfm/showPeopleProfile.cfm?"+url;
}

function checkBackPosition(){

	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myOffsetY = window.pageYOffset;
		myOffsetX = window.pageXOffset;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myOffsetY = document.documentElement.scrollTop;
		myOffsetX = document.documentElement.scrollLeft;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myOffsetY = document.body.pageYOffset;
		myOffsetX = document.body.pageXOffset;
	  }

	//var whatBody = getElementById_s("wciBody");
	var whatLayer1 = getElementById_s("Layer1");
	var whatLayer2 = getElementById_s("Layer2");
	
	whatLayer1.style.top = myOffsetY;
	whatLayer1.style.left = myOffsetX;
	
	whatLayer2.style.top = myOffsetY;

	
	//alert(myOffsetY);
}


function footer()
{
	document.write("<table width='950' class='copyrightText'><tr><td align='left' valign='midle' width='135'>");
	
	document.write("<img src='/multimedia/images/skeleton/EHCLogo.jpg' border='0' />");
	document.write("</td><td align='left' valign='middle'>");
		
	document.write("The Emory Winship Cancer Institute<br>");
	document.write("1365C Clifton Road, Atlanta, Georgia 30322 ");
	
	document.write("</td><td align='right' valign='middle'>");
	document.write("<a href='http://cancer.emory.edu/intranet'><font color='#99CCFF'>Employee Login</font></a> | ");
	document.write("<a href='/about-winship/site-map/winship-site-map'><font color='#99CCFF'>Site Map</font></a> | ");
	document.write("<a href='/about-winship/website-policies/website-policies'><font color='#99CCFF'>Privacy Policy</font></a> | ");
	document.write("<a href='/about-winship/website-policies/website-policies'><font color='#99CCFF'>Legal Statements</font></a> <br> ");

	document.write("Copyright &copy;2008 Emory Winship Cancer Institute");
	document.write("</td></tr></table>");
	
	
	
}

function init_frame()
{
	document.write("<div id='Layer1' class='layerHide'>");
		document.write("<table style='filter: alpha(opacity=80); height: 100%; background-color: #000000; opacity: 0.8; -moz-opacity: 0.8; border: black 1px solid;' border='0' cellspacing='0' cellpadding='0' width='100%' align='center'>");
			document.write("<tbody>");
			document.write("<tr>");
				document.write("<td>&nbsp;</td>");
			document.write("</tr>");
			document.write("</tbody>");
			document.write("</table>");
	document.write("</div>");
	
	document.write("<div id='Layer2' class='layerHide'>");
			document.write("<table style='height: 100%;' border='0' cellspacing='0' cellpadding='0' width='100%' align='center'>");
			document.write("<tbody>");
			document.write("<tr>");
			document.write("<td align='center'>");
			document.write("<table width='825'><tr><td align='right' valign='bottom'><a href='javascript:hideFrame()'><img src='/multimedia/images/skeleton/close.png' border='0'></a></td></tr></table>");
			document.write("<table width='825' style='background-color: #ffffff;'><tr><td><iframe id='wciIFrame'  name='wciIFrame' height=590 width=825 scrolling='auto' frameborder='0' allowtransparency='false' src=''>");
			document.write("</iframe></td></tr></table>");
			document.write("</td>");
			document.write("</tr>");
			document.write("</tbody>");
		document.write("</table>");
	document.write("</div>");

}



