//Specify display mode. 3 possible values are:
//1) "always"- This makes the fade-in box load each time the page is displayed
//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session
//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...
// For example, 2 would display the box about (1/2) 50% of the time the page loads.
var webURL = "";
var displaymode="always";
var the_state = "";
var stnid = "";
var enablefade="yes" //("yes" to enable fade in effect, "no" to disable)
var autohidebox=["no", 5] //Automatically hide box after x seconds? [yes/no, if_yes_hide_after_seconds]
var showonscroll="no" //Should box remain visible even when user scrolls page? ("yes"/"no)
var IEfadelength=1 //fade in duration for IE, in seconds
var Mozfadedegree=0.05 //fade in degree for NS6+ (number between 0 and 1. Recommended max: 0.2)


if (parseInt(displaymode)!=NaN)
	var random_num=Math.floor(Math.random()*displaymode)


function getWebURL()
{
	var webURL = "";
	var url = window.location + "";
	var urlparts = url.split("/");
	for(i=0;i < urlparts.length - 2; i++)
	{
		webURL += urlparts[i] + "/";		
	}
}
getWebURL();

function displayfadeinsamplebox(opt)
{
	var ie=document.all && !window.opera
	var dom=document.getElementById
	iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	objref=(dom)? document.getElementById("fadeinwebarchive") : document.all.fadeinwebarchive;
	objref.innerHTML = "<table><tr><td><div align=\"right\"> <a href=\"#\" onClick=\"hidefadebox();return false\">Dismiss Sample</a></div><br /></td><td>" ;
		switch(opt)
		{
			case -5:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/pdf5.txt\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: FloralWhite;\"></iframe></td></tr></table>";
				break;
			case -4:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/pdf4.txt\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: Gold;\"></iframe></td></tr></table>";
				break;
			case -3:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/pdf3.txt\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: Azure;\"></iframe></td></tr></table>";
				break;
			case -2:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/pdf2.txt\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: Aquamarine;\"></iframe></td></tr></table>";
				break;
			case -1:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/pdf1.txt\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: Coral;\"></iframe></td></tr></table>";
				break;
			case 0:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/pdf0.txt\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: CadetBlue;\"></iframe></td></tr></table>";
				break;
			case 1:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/KBTR_DegreeDay_Sample.htm\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: DarkSeaGreen;\"></iframe></td></tr></table>";
				break;
			case 2:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/LittleRock_StnSum_Sample.htm\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: #EEE8AA;\"></iframe></td></tr></table>";
				break;
			case 3:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/Memphis_MonthlySum_Sample.htm\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\"  style=\"background-color: #B0E0E6;\"></iframe></td></tr></table>";
				break;
			case 4:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/Memphis_PrcpHistSum_Sample.htm\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\"  style=\"background-color: #F4A460;\"></iframe></td></tr></table>";
				break;
			case 5:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/Tulsa_FrostStats_Sample.htm\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\" style=\"background-color: #FFFACD;\"></iframe></td></tr></table>";
				break;
			case 6:
				objref.innerHTML += "<iframe src=\"" + webURL + "/ks/Kyle_Stuff/Product_Samples/Tulsa_FrostSum_Sample.htm\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\"  style=\"background-color: #90EE90;\"></iframe></td></tr></table>";
				break;
			default:
				"<iframe src=\"\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\"></iframe></td></tr></table>";
				break;
		}
	var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
	var docwidth=(ie)? iebody.clientWidth : window.innerWidth
	docheight=(ie)? iebody.clientHeight: window.innerHeight
	var objwidth=objref.offsetWidth
	objheight=objref.offsetHeight
	objref.style.left=docwidth/2-objwidth/2+"px"
	objref.style.top=scroll_top+docheight/2-objheight/2+"px"

	if (showonscroll=="yes")
		showonscrollvar=setInterval("staticfadebox()", 50)

	if (enablefade=="yes" && objref.filters)
	{
		objref.filters[0].duration=IEfadelength
		objref.filters[0].Apply()
		objref.filters[0].Play()
	}
	objref.style.visibility="visible"
	if (objref.style.MozOpacity)
	{
		if (enablefade=="yes")
			mozfadevar=setInterval("mozfadefx()", 90)
		else
		{
			objref.style.MozOpacity=1
			controlledhidebox()
		}
	}
	else
		controlledhidebox()
}
function displayfadeinbox()
{
	var ie=document.all && !window.opera
	var dom=document.getElementById
	iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	objref=(dom)? document.getElementById("fadeintx") : document.all.fadeintx
	switch(the_state)
	{
		case 'tx':
			//objref=(dom)? document.getElementById("fadeintx") : document.all.fadeintx
			objref=(dom)? document.getElementById("fadeintx") : document.all.fadeintx
			break;
		case 'ok':
			objref=(dom)? document.getElementById("fadeinok") : document.all.fadeinok
			break;
		case 'ar':
			objref=(dom)? document.getElementById("fadeinar") : document.all.fadeinar
			break;
		case 'la':
			objref=(dom)? document.getElementById("fadeinla") : document.all.fadeinla
			break;
		case 'ms':
			objref=(dom)? document.getElementById("fadeinms") : document.all.fadeinms
			break;
		case 'tn':
			objref=(dom)? document.getElementById("fadeintn") : document.all.fadeintn
			break;
		default:
			objref=(dom)? document.getElementById("fadeintx") : document.all.fadeintx
			break;
	}
	objref.innerHTML = "<table><tr><td><div align=\"right\"> <a href=\"#\" onClick=\"hidefadebox();return false\">Dismiss Charts</a></div><br /></td><td>" +
		"<iframe src=\"http://legacy.srcc.lsu.edu/southernClimate/climatesummaries/stnsum/getPngPlot\?id="+stnid+"\" height=\"570px\"width=\"800px\" scroll=\"no\" frameborder=\"0\"></iframe></td></tr></table>";
	var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
	var docwidth=(ie)? iebody.clientWidth : window.innerWidth
	docheight=(ie)? iebody.clientHeight: window.innerHeight
	var objwidth=objref.offsetWidth
	objheight=objref.offsetHeight
	objref.style.left=docwidth/2-objwidth/2+"px"
	objref.style.top=scroll_top+docheight/2-objheight/2+"px"

	if (showonscroll=="yes")
		showonscrollvar=setInterval("staticfadebox()", 50)

	if (enablefade=="yes" && objref.filters)
	{
		objref.filters[0].duration=IEfadelength
		objref.filters[0].Apply()
		objref.filters[0].Play()
	}
	objref.style.visibility="visible"
	if (objref.style.MozOpacity)
	{
		if (enablefade=="yes")
			mozfadevar=setInterval("mozfadefx()", 90)
		else
		{
			objref.style.MozOpacity=1
			controlledhidebox()
		}
	}
	else
		controlledhidebox()
}

function mozfadefx()
{
	if (parseFloat(objref.style.MozOpacity)<1)
		objref.style.MozOpacity=parseFloat(objref.style.MozOpacity)+Mozfadedegree
	else
	{
		clearInterval(mozfadevar)
		controlledhidebox()
	}
}

function staticfadebox()
{
	var ie=document.all && !window.opera
	var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
	objref.style.top=scroll_top+docheight/2-objheight/2+"px"
}

function hidefadebox()
{
	objref.style.visibility="hidden";
	objref.style.width="0px";
	objref.style.height="0px";
	if (typeof showonscrollvar!="undefined")
		clearInterval(showonscrollvar)
}

function controlledhidebox()
{
	if (autohidebox[0]=="yes")
	{
		var delayvar=(enablefade=="yes" && objref.filters)? (autohidebox[1]+objref.filters[0].duration)*1000 : autohidebox[1]*1000
		setTimeout("hidefadebox()", delayvar)
	}
}
function initfunction_samples(opt)
{
	setTimeout("displayfadeinsamplebox("+opt+")",100);
}
function initfunction()
{
	setTimeout("displayfadeinbox()", 100)
}

function get_cookie(Name) 
{
	var search = Name + "="
	var returnvalue = ""
	if (document.cookie.length > 0) 
	{
		offset = document.cookie.indexOf(search)
		if (offset != -1) 
		{
			offset += search.length
			end = document.cookie.indexOf(";", offset)
			if (end == -1)
				end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;
}
function display_fadin(id,state)
{
	the_state = state;
	stnid     = id;
	initfunction();
}
function display_fadin_samples(opt)
{
	initfunction_samples(opt);
}
function display_tennessee()
{
	/*
	document.getElementById('tennessee').style.display = "block";
	document.getElementById('arkansas').style.display = "none";
	document.getElementById('mississippi').style.display = "none";
	document.getElementById('texas').style.display = "none";
	document.getElementById('louisiana').style.display = "none";
	document.getElementById('oklahoma').style.display = "none";
	*/
  	var webURL = "";
        var url = window.location + "";
        var urlparts = url.split("/");
        for(i=0;i < 3; i++)
        {
                webURL += urlparts[i] + "/";
        }
        document.getElementById('basemap').src = webURL+"tennessee.html";


}
function display_mississippi()
{
 	var webURL = "";
        var url = window.location + "";
        var urlparts = url.split("/");
        for(i=0;i < 3; i++)
        {
                webURL += urlparts[i] + "/";
        }
        document.getElementById('basemap').src = webURL+"mississippi.html";

	/*
	document.getElementById('tennessee').style.display = "none";
	document.getElementById('arkansas').style.display = "none";
	document.getElementById('mississippi').style.display = "block";
	document.getElementById('texas').style.display = "none";
	document.getElementById('louisiana').style.display = "none";
	document.getElementById('oklahoma').style.display = "none";
	*/
}
function display_arkansas()
{
/*
	document.getElementById('tennessee').style.display = "none";
	document.getElementById('arkansas').style.display = "block";
	document.getElementById('mississippi').style.display = "none";
	document.getElementById('texas').style.display = "none";
	document.getElementById('louisiana').style.display = "none";
	document.getElementById('oklahoma').style.display = "none";
*/

	var webURL = "";
        var url = window.location + "";
        var urlparts = url.split("/");
        for(i=0;i < 3; i++)
        {
                webURL += urlparts[i] + "/";
        }
        document.getElementById('basemap').src = webURL+"arkansas.html";


}
function display_texas()
{
	var webURL = "";
        var url = window.location + "";
        var urlparts = url.split("/");
        for(i=0;i < 3; i++)
        {
                webURL += urlparts[i] + "/";
        }
	document.getElementById('basemap').src = webURL+"texas.html";
	/*
	document.getElementById('tennessee').style.display = "none";
	document.getElementById('texas').style.display = "block";
	document.getElementById('mississippi').style.display = "none";
	document.getElementById('arkansas').style.display = "none";
	document.getElementById('louisiana').style.display = "none";
	document.getElementById('oklahoma').style.display = "none";
	*/
}
function display_oklahoma()
{
	var webURL = "";
        var url = window.location + "";
        var urlparts = url.split("/");
        for(i=0;i < 3; i++)
        {
                webURL += urlparts[i] + "/";
        }
        document.getElementById('basemap').src = webURL+"oklahoma.html";
	/*
	alert('I am in display_oklahoma');
	alert(document.getElementById('oklahoma').style.display);
	document.getElementById('tennessee').style.display = "none";
	document.getElementById('oklahoma').style.display = "block";
	document.getElementById('mississippi').style.display = "none";
	document.getElementById('arkansas').style.display = "none";
	document.getElementById('texas').style.display = "none";
	document.getElementById('louisiana').style.display = "none";
	alert(document.getElementById('oklahoma').style.display);
	*/
}
function display_louisiana()
{
	/*
	document.getElementById('tennessee').style.display = "none";
	document.getElementById('louisiana').style.display = "block";
	document.getElementById('mississippi').style.display = "none";
	document.getElementById('arkansas').style.display = "none";
	document.getElementById('oklahoma').style.display = "none";
	document.getElementById('texas').style.display = "none";
	*/
  	var webURL = "";
        var url = window.location + "";
        var urlparts = url.split("/");
        for(i=0;i < 3; i++)
        {
                webURL += urlparts[i] + "/";
        }
        document.getElementById('basemap').src = webURL+"louisiana.html";
}

function updateMap(field,v){
	/*Set the new Form Field*/
	document.getElementById(field).value=v;
	/*Set the Action Value*/
	document.getElementById('action').value='update_'+field;
	/*Submit the Form*/
	document.M.submit();
}


function switchSub(object){
	if(object.getElementsByTagName('ul').length > 0){
		fUl = object.getElementsByTagName('ul')[0];
		if(fUl.style['visibility'] != 'visible'){
			fUl.style['visibility'] = 'visible'
		}else{
			fUl.style['visibility'] = 'hidden'
		}
	}
}



function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}




function showSubmenu(whichDiv)
{
	var menus = new Array("subHome", "subProducts", "subData", "subServices","subPublications");
	
	for(var i = 0; i < menus.length; i++){
		
		if (document.getElementById)
		{
		// this is the way the standards work
		var style = document.getElementById(menus[i]).style;
		style.display = "none";
		}
		else if (document.all)
		{
		// this is the way old msie versions work
		var style = document.all[menus[i]].style;
		style.display = "none";
		}
		else if (document.layers)
		{
		// this is the way nn4 works
		var style = document.layers[menus[i]].style;
		style.display = "none";
		}		
	}
	
	
	if(whichDiv != 'none'){
	
	if (document.getElementById)
		{
		// this is the way the standards work
		var style = document.getElementById(whichDiv).style;
		style.display = "inline";
		}
	else if (document.all)
		{
		// this is the way old msie versions work
		var style = document.all[whichDiv].style;
		style.display = "inline";
		}
	else if (document.layers)
		{
		// this is the way nn4 works
		var style = document.layers[whichDiv].style;
		style.display = "inline";
		}
	
	}

}

var win_flag = 0;
function popNewWindow(url,name,features)
{
	win_flag = name
   new_window = window.open(url,name,features);
	new_window.focus();
}


//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "bylocation"]

////////Stop editting////////////////

function cascadedstyle(el, cssproperty, csspropertyNS){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(csspropertyNS)
}
}

var previoustab=""

function expandcontent(cid, aobject){
if (document.getElementById){
highlighttab(aobject)
detectSourceindex(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
if (aobject.blur)
aobject.blur()
return false
}
else
return true
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}

function collecttablinks()
{
	var tabobj=document.getElementById("tablist")
	if(tabobj != null)
		tabobjlinks=tabobj.getElementsByTagName("A")
}

function detectSourceindex(aobject){
for (i=0; i<tabobjlinks.length; i++){
if (aobject==tabobjlinks[i]){
tabsourceindex=i //source index of tab bar relative to other tabs
break
}
}
}

function do_onload()
{
	var cookiename=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent" : window.location.pathname
	var cookiecheck=window.get_cookie && get_cookie(cookiename).indexOf("|")!=-1
	collecttablinks()
	try
	{
		initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color")
	}
	catch(err)
	{
	}
	try
	{
		initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color")
	}	
	catch(err)
	{
	}
	if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck)
	{
		var cookieparse=get_cookie(cookiename).split("|")
		var whichtab=cookieparse[0]
		var tabcontentid=cookieparse[1]
		expandcontent(tabcontentid, tabobjlinks[whichtab])
	}
	else
		try
		{
			expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
		}
		catch(err)
		{
		}
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

/////////////////////////////////////

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab1=[1, "sc1"]

////////Stop editting////////////////

var previoustab1=""
function cascadedstyle1(el, cssproperty, csspropertyNS)
{
	if (el.currentStyle)
		return el.currentStyle[cssproperty]
	else if (window.getComputedStyle)
	{
		var elstyle=window.getComputedStyle(el, "")
		return elstyle.getPropertyValue(csspropertyNS)
	}
}

function expandcontent1(cid, aobject)
{
	try
	{
		if (document.getElementById)
		{
			highlighttab1(aobject)
			detectSourceindex1(aobject)
			if (previoustab1!="")
				document.getElementById(previoustab1).style.display="none"
			document.getElementById(cid).style.display="block"
			previoustab1=cid
			if (aobject.blur)
				aobject.blur()
			return false
		}
		else
			return true
	}
	catch(err)
	{
	}
}

function highlighttab1(aobject)
{
	if (typeof tabobjlinks=="undefined")
		collecttablinks1()
	for (i=0; i<tabobjlinks.length; i++)
	{
		tabobjlinks[i].style.backgroundColor=initTabcolor
	}
	var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
	try
	{
		aobject.style.backgroundColor=document.getElementById("tabcontentcontainer1").style.backgroundColor=themecolor
	}
	catch(err)
	{
	}
}

function collecttablinks1()
{
	var tabobj=document.getElementById("tablist1")
	if(tabobj != null)
		tabobjlinks=tabobj.getElementsByTagName("A")
}

function detectSourceindex1(aobject)
{
	for (i=0; i<tabobjlinks.length; i++)
	{
		if (aobject==tabobjlinks[i])
		{
			tabsourceindex=i //source index of tab bar relative to other tabs
			break
		}
	}
}

function do_onload1()
{
	var cookiename=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent" : window.location.pathname
	var cookiecheck=window.get_cookie && get_cookie(cookiename).indexOf("|")!=-1
	collecttablinks1()
	try
	{
		initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color")
	}
	catch(err)
	{
	}
	try
	{
		initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color")
	}
	catch(err)
	{
	}
	if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck)
	{
		var cookieparse=get_cookie(cookiename).split("|")
		var whichtab=cookieparse[0]
		var tabcontentid=cookieparse[1]
		expandcontent1(tabcontentid, tabobjlinks[whichtab])
	}
	else {
		try
		{
			expandcontent1(initialtab1[1], tabobjlinks[initialtab1[0]-1])
		}
		catch(err)
		{
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", do_onload1, false)
else if (window.attachEvent)
	window.attachEvent("onload", do_onload1)
else if (document.getElementById)
	window.onload=do_onload1




function changePlan(stn)
{
	//alert('Inside changePlan function; stn = ' + stn);
}
function change2(e, state,color)
{
	//alert('inside change2 and color = ' + color);
	var el=window.event? event.srcElement: e.target
	if (el.tagName=="INPUT"&&el.type=="button")
	{
		//el.style.backgroundColor=color;
		if(state == "in")
		{
			//alert('inside');
			el.style.height="175px";
			el.style.width="175px";
		}
		else
		{
			//alert('outside');
			el.style.height="150px";
			el.style.width="150px";
		}
	}

	if (el.tagName=="IMG")
	{
		if(state == "in")
		{
			//alert('inside');
			el.style.height="175px";
			el.style.width="175px";
		}
		else
		{
			//alert('outside');
			el.style.height="150px";
			el.style.width="150px";
		}
	}
}

function jumpto2(url)
{
	if (buttontarget=="")
		window.location=url
	else if (buttontarget=="_new")
		window.open(url)
	else
		parent[buttontarget].location=url
}

function expandAnnualContent(iid,cid,aobject)
{
	var currentURL=window.document.location.toString();
	/*
	annualDiv = document.getElementById(cid);
	im = document.createElement("img");
	annualDiv.appendChild(im);
	im.style.position="absolute";
	im.src="http://www.cnn.com";
	*/
	document.getElementById('textcontent').style.display="none";
	document.getElementById('stationcontentcontainer').style.display="block";
	document.getElementById('barchartcontent').style.display="none";
	document.getElementById('annualcontent').style.display="block";
	document.getElementById('tabularcontent').style.display="none";
}
function expandTextContent(iid,cid,aobject)
{
	document.getElementById('annualcontent').style.display="none";
	document.getElementById('stationcontentcontainer').style.display="block";
	document.getElementById('barchartcontent').style.display="none";
	document.getElementById('textcontent').style.display="block";
	document.getElementById('tabularcontent').style.display="none";
}
function expandBarChartContent(iid,cid,aobject)
{
	document.getElementById('annualcontent').style.display="none";
	document.getElementById('stationcontentcontainer').style.display="block";
	document.getElementById('barchartcontent').style.display="block";
	document.getElementById('textcontent').style.display="none";
	document.getElementById('tabularcontent').style.display="none";
}
function test()
{
	alert('I am in common.js');
}
function getTextData(beginDate,endDate,stationID)
{
	//alert('getTextData: beginDate:' + beginDate + ' endDate: ' + endDate + ' stationID: ' + stationID);
        var url = window.location + "";
	var webURL = "";
	var urlparts = url.split("/");
        for(i=0;i < 3; i++)
        {
		webURL += urlparts[i] + "/";
        }
	var ajaxResult="";
	
	function processGetPost()
	{
		var myajax=ajaxpack.ajaxobj;
		var myfiletype=ajaxpack.filetype;
		if (myajax.readyState == 4)
		{ 
			if (myajax.status==200 || window.location.href.indexOf("http")==-1)
			{ 
				if (myfiletype=="txt")
				{
					document.getElementById('tabularcontent').style.display = "block"
					//var endtxt = myajax.responseText.search(/\'Stn_ID\'/);
					//document.getElementById('tabularcontent').innerHTML=myajax.responseText.substring(0,endtxt);
					document.getElementById('tabularcontent').innerHTML=myajax.responseText;
				}
				else
					alert(myajax.responseXML)
			}
		}
	}
	
	//alert(beginDate);
	//alert(endDate);
	
	//ajaxreq = webURL + "php/getMonthlyData.php?beginDate=" + beginDate + "&endDate=" + endDate + "&stationID=" + stationID;
	ajaxpack.getAjaxRequest(webURL + "/php/getMonthlyData.php?beginDate=" + beginDate + "&endDate=" + endDate + "&stationID=" + stationID + "&nothing=", "", processGetPost, "txt")
	//ajaxpack.getAjaxRequest(webURL + "/php/getMonthlyData.php?beginDate=" + beginDate + "&endDate=" + endDate + "&stationID=" + stationID, processGetPost, "txt")
}
function ldm()
{
	document.getElementById('query').innerHTML = "";
	document.getElementById('query').innerHTML = "<iframe src=\"http://www.srcc.lsu.edu/q.htm\" style=\"width: 98%; height: 98%;\" frameborder=\"0\" scrolling=\"yes\">";
}
function processGray()
{
	//alert('inside processGray()');
}
function process_hurricane()
{
	alert('inside process_hurricane');
	//document.getElementById('query').innerHTML = "";
	window.location = "http://www.srcc.lsu.edu/tropdesk_rpts";
}
function disout()
{
	document.getElementById('query').innerHTML = "<iframe src=\"http://www.srcc.lsu.edu/atwo.php\" style=\"width: 98%; height: 98%;\" frameborder=\"0\" scrolling=\"yes\">";
}
function ssScale()
{
	document.getElementById('query').innerHTML = "";
	document.getElementById('query').innerHTML = "<iframe src=\"http://www.srcc.lsu.edu/sscale.htm\" style=\"width: 98%; height: 98%;\" frameborder=\"0\" scrolling=\"yes\">";
}


function satelliteImagery()
{
	//alert('inside satelliteImagery');
	document.getElementById('query').innerHTML = "<iframe width='100%' height='95%' width='90%' scrolling='no'  frameborder='0' src='http://www.srcc.lsu.edu/satellite.htm'></iframe>";
}

function archiveRpts()
{
	//document.getElementById('query').innerHTML = "";
	document.getElementById('query').innerHTML = "<iframe width='100%' height='95%' width='90%' scrolling='no'  frameborder='0' src='http://stormtrack.srcc.lsu.edu/'></iframe>";
}
function trackingChart()
{
	document.getElementById('query').innerHTML = "";
	document.getElementById('query').innerHTML = "<img src=\"http://www.nhc.noaa.gov/gifs/track_chart.gif\" style=\"width: 750px; height: 98%;\">";
}
function exposeSubList()
{
	if(document.getElementById('sublist').style.visibility == "hidden")
		document.getElementById('sublist').style.visibility = "visible";
	else
		document.getElementById('sublist').style.visibility = "hidden";
}
function display_storm()
{
	alert('inside display_storm');
}
