
var oIFrame = null;



function createIFrame(name){
		
		var oIFrameElement = document.createElement("iframe");
		
		oIFrameElement.width=0;
		oIFrameElement.height=0;
		oIFrameElement.frameBorder=0;
		oIFrameElement.name = name;
		oIFrameElement.id = name;		
		document.body.appendChild(oIFrameElement);
		oIFrame = frames[name];
	
	
	
}

function showmenu(elmnt)
{
	if (document.getElementById(elmnt).style.display == "block"){
		hidemenu(elmnt)
	}
	else{
	document.getElementById(elmnt).style.display="block"
	}
}
function hidemenu(elmnt)
{
     document.getElementById(elmnt).style.display="none"
}


function firstLoad(){
	
	aToZ();	
	
	

}

function HealthNewsInfo(a){
	
		
		if (!frames["hiddenHealth"] == true){
			createIFrame("hiddenHealth");						
					
		}	
				
		top.frames["hiddenHealth"].location = "/phcommon/public/media/media_p.cfm?option=2";
		if (a == 1){
		CurrNewsInfo('1');
		}
}	
function displayHealthNews(sHealth){
	var OutHealthNews = document.getElementById("OutHealthNews");
	OutHealthNews.innerHTML = sHealth;	
	
}




function CurrNewsInfo(a){
	
	if (!frames["hiddenCurrent"] == true){
		
		createIFrame("hiddenCurrent");	
	}	
	top.frames["hiddenCurrent"].location = "/phcommon/public/media/media_p.cfm?option="+a;			
}	
function displayCurrNews(sText){
	var OutCurNews = document.getElementById("OutCurNews");
	OutCurNews.innerHTML = sText;	

}



function MAdvisoryInfo(){
	
	if (!frames["hiddenMAdvisory"] == true){
		
		createIFrame("hiddenMAdvisory");	
	}	
	top.frames["hiddenMAdvisory"].location = "/phcommon/public/portlet/index.cfm";			
}	
function displayMAdvisory(sText){
	var MAdvisory = document.getElementById("MAdvisory");
	MAdvisory.innerHTML = sText;	

}

function NewsAlertInfo(){
	
	if (!frames["hiddenNewsAlert"] == true){
		
		createIFrame("hiddenNewsAlert");	
	}	
	top.frames["hiddenNewsAlert"].location = "/phcommon/public/portlet/index.cfm?id=2";			
}	
function displayNewsAlert(sText2){
	var NewsAlert = document.getElementById("NewsAlert");
	NewsAlert.innerHTML = sText2;	

}

function NewsAlertSPInfo(){
	
	if (!frames["hiddenNewsAlertSP"] == true){
		
		createIFrame("hiddenNewsAlertSP");	
	}	
	top.frames["hiddenNewsAlertSP"].location = "/phcommon/public/portlet/index.cfm?id=3";			
}	
function displayNewsAlertSP(sText3){
	var NewsAlertSP = document.getElementById("NewsAlertSP");
	NewsAlertSP.innerHTML = sText3;	

}
 
function AvisoDeMediosInfo(){
	
	if (!frames["hiddenAvisoDeMedios"] == true){
		
		createIFrame("hiddenAvisoDeMedios");	
	}	
	top.frames["hiddenAvisoDeMedios"].location = "/phcommon/public/portlet/index.cfm?id=4";			
}	
function displayAvisoDeMedios(sText4){
	var AvisoDeMedios = document.getElementById("AvisoDeMedios");
	AvisoDeMedios.innerHTML = sText4;	

}


function chgOnState(a){
	
	var obj= document.getElementById(a);
	obj.style.color = "#c97962";
	obj.style.fontSize = "12px";	
}

function aToZ(){
	
	var cont = "";
	cont = cont + "<table align='center' class='atoz'><tr>";
	for (i=65;i<=90; i++){
		cont = cont + "<td class='atoz' align='center'>" + 
			"<input type='Submit' class='aTozButton' name='ALPHA' value='" + String.fromCharCode(i) +  "'></td>"
		if (i == 70 || i==76 || i ==82 || i == 88 ){
		cont = cont + "</tr><tr>";
		
		}
	}
	cont = cont + "<td colspan=4 class='atoz' align='center'><input type='Submit' class='aTozButton' name='ALPHA' value='ALL'></td>"
	cont = cont + "</tr></table>";	
	var divAtoZ = document.getElementById("divAtoZ");
		divAtoZ.innerHTML = cont;	
		
}


function aToZHor(){
	
	var cont = "";
	cont = cont + "<table width='90%'><tr><td align=right><font color=white>A-Z Index</font></td>";
	for (i=65;i<=90; i++){
		cont = cont + "<td class='aTozH' align='center'>" + 
			"<input type='Submit' class='aTozH' name='ALPHA' value='" + String.fromCharCode(i) +  "'></td>"		
	}
	cont = cont + "<td class='aTozH' align='center'><input type='Submit' class='aTozH' name='ALPHA' value='ALL'></td>"
	cont = cont + "</tr></table>";	
	var divAtoZH = document.getElementById("divAtoZH");
		divAtoZH.innerHTML = cont;	
		
}


function aToZHor2(){
	
	var cont = "";
	cont = cont + "<table width='90%'><tr><td align=right><font color=white>A-Z Index</font></td>";
	for (i=65;i<=90; i++){
		cont = cont + "<td class='aTozH2' align='center'>" + 
			"<input type='Submit' class='aTozH2' name='ALPHA' value='" + String.fromCharCode(i) +  "'></td>"		
	}
	cont = cont + "<td class='aTozH2' align='center'><input type='Submit' class='aTozH2' name='ALPHA' value='ALL'></td>"
	cont = cont + "</tr></table>";	
	var divAtoZH2 = document.getElementById("divAtoZH2");
		divAtoZH2.innerHTML = cont;	
		
}


function portletOpenClose(a){
	indText= a + "1";;
	indView = document.getElementById(indText);
	indopen=document.getElementById(a);	
	if (indopen.style.display == "block"){
		indopen.style.display = "none"		
		indView.innerHTML = "Open"	
	}
	else{
		indopen.style.display = "block"	
		indView.innerHTML = "Close"	
	
	}
}



function getCenterContent(indpath){


	var oXmlHttp = createXMLHttp();
	
	oXmlHttp.open("get", indpath, true);
	oXmlHttp.onreadystatechange = function (){
		
		if (oXmlHttp.readyState == 4){
			if (oXmlHttp.status == 200){
				
				var sData = oXmlHttp.responseText;
				var disContent = document.getElementById("disContent");
					disContent.innerHTML = sData;				
				
			}
			else{
				var disContent = document.getElementById("disContent");
				
			}
			
		}
	
	
	
	}
	

	oXmlHttp.send(null);
	
}	

function createXMLHttp(){
	if (typeof XMLHttpRequest != "undefined"){
		
		return new XMLHttpRequest();
		
	}
	else if (window.ActiveXObject){
		
		var aVersions = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHttp.5.0",
				"MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
				"MSXML2.XMLHttp", "Microsoft.XMLHTTP"
				];
		for (var i=0; i < aVersions.length; i++){
			try {
				
				var oXmlHttp = new ActiveXObject(aVersions[i]);
				return oXmlHttp;
			} catch (oError){
				
				document.write ("Your browser doesn't support XMLHTTP.");
				}
		
		
		
		}
	}
	throw new Error ("XMLHttp object could not be created.");
	

}


function lasite(){
	document.gosearch.cx[0].checked = true

}

function trsite(){	
	document.gosearch.cx[1].checked = true

}


function sideAction(a){
	indAction=document.getElementById(a);
	indImg = a + 'Img';
	imgexist = document.images[indImg];
	
	if (indAction.style.display == "block"){
		indAction.style.display = "none"
		
		if (imgexist !== undefined)
		{
				
		document.images[indImg].src="/images/2008/arrow.gif";
		}
		
	}
	else{
		indAction.style.display = "block"	
			if (imgexist !== undefined)
		{
			
		document.images[indImg].src="/images/2008/arrow_down.gif";
		}
	
	}
}

function sideOnState(b){
	indState = document.getElementById(b);
	if (indState.style.textDecoration == "underline"){
		indState.style.textDecoration = "none";
	}
	else
		{
		indState.style.textDecoration = "underline";
		}

}
 
function sslAdmin(){
	var relocate = "no"
	var indURL = document.URL	
	
	if (indURL.indexOf('https:') == -1){
		indURL = (indURL.replace(/http:/i, "https:"))
		relocate = "yes"
	}
	
	if (indURL.indexOf('130.') != -1){
		var ip = indURL.split('/');
		indURL = (indURL.replace(ip[2], "admin.publichealth.lacounty.gov"))
		relocate = "yes"
		
	
	
	}
	
	if (indURL.indexOf('admin.') == -1){
		indURL = (indURL.replace(/publichealth.lacounty/i, "admin.publichealth.lacounty"))
		indURL = (indURL.replace(/lapublichealth.org/i, "admin.publichealth.lacounty.gov"))
		indURL = (indURL.replace(/ph.lacounty.gov/i, "admin.publichealth.lacounty.gov"))
		relocate = "yes"	
	}
	
	if (indURL.indexOf('www.admin.') != -1){
		indURL = (indURL.replace(/www.admin./i, "admin."))
		relocate = "yes"	
	
	
	}
	if (relocate == "yes"){
		window.location = indURL;	
	}
	

}



 





