document.write(""+
"<style type='text/css'>"+
"@media screen{"+
".info_pop,.info_ipop {"+
"display: none; border-bottom: 1px solid #999; padding-bottom: 2px; font-weight: normal}"+
".info_pop_open {"+
"display: block; border-bottom: 1px solid #999; padding-bottom: 2px; font-weight: normal}"+
".info_pop_inline {"+
"display: inline; border:none; padding-bottom: 2px;}"+
".openOnload {color: none}"+
"</style>");

	function msieversion()
   {
      var ua = window.navigator.userAgent
      var msie = ua.indexOf ( "MSIE " )

      if ( msie > 0) 
	  { 
	  		var getNum=parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));
			if(getNum > 6)
			{
				return 0;
			}
			else
			{
				return getNum;
			}
		}
      else  
	  {       
         return 0;
		}
   }
	
	
	function fixFlicker()
	{
		var b=msieversion();
		if(b > 0)
		{
			try {
  				document.execCommand("BackgroundImageCache", false, true);
			} catch(err) {}
		}
		else
		{
			return;
		}
	}	
	fixFlicker();	

function itemValue(itemID)
{
	var i=document.getElementById ? 
		document.getElementById(itemID) : document.all[itemID];
	return i;
}
var accessMsg="";
var dValue=0;


	/*if(getCookie("aKey")) {
		document.write(".aKey {display: inline}");
		document.write("#menu li a {padding: 2px 3px 2px 1px;}");
		//document.write("span.red {display: none}");
		
		accessMsg="Hide accesskey labels";
		dValue=-1;
	}
	else {
		document.write(".aKey {display: none}");
		accessMsg="Show accesskey labels";
		dValue=1;
	}*/


//yearvalue is eigher 1 (set cookie) or -1 delete cookie
function setCookie(yearValue,cookieName,cookieVal)
{
	cookieVal = cookieVal ? cookieVal : "yes";
	var thisDate = new Date();	
	thisDate.setYear((thisDate.getFullYear())+(yearValue));
	thisDate.setMonth(thisDate.getMonth());
	thisDate.setDate(thisDate.getDate());
	thisDate=thisDate.toUTCString();
	document.cookie = cookieName+'='+cookieVal+'; expires='+thisDate+'; path=/'
}

function videoViewer(videoName)
{
	alert(videoName);	
}

function getCookie(cookieName)
{
	var cookieLocation=document.cookie.indexOf(cookieName);
	
	if(cookieLocation >-1)
	{
		var c=document.cookie.split("; ");
		for(var i=0; i<c.length; i++)
		{
			if(c[i].indexOf(cookieName) > -1)
			{
				var cVal=c[i].substring(c[i].indexOf("=")+1);
				if( cVal != "yes")
				{
					return cVal;
				}
				else
				{
					return true;
				}
													
			}
		}
	}
	else
	{
		return false;
	}
}
  
var clickNotice='<em class="noprint jsblock font90" style="padding-top: 5px">'+
'Click on questions to see or hide answer.  This page will print with answers expanded.'+
' <strong style="font-style: normal; white-space: nowrap">'+
' <a href="javascript: void(0)"'+
' class="inline" onclick="hideOrShow(this)" '+
' title="Expand or hide all category descriptions.">'+
' [Expand all now]</a></strong></em>';

function pop_open(thisItem){	
	var itm= document.getElementById ? 
		document.getElementById(thisItem) : document.all[thisItem];
	var msg= document.getElementById ? 
		document.getElementById("errors") : document.all["errors"];

	itm.className=="info_pop" ? 
		itm.className="info_pop_open" : 
		itm.className=="info_ipop" ? 
		itm.className="info_pop_inline" : 
		itm.className=="info_pop_inline" ?
		itm.className="info_ipop" : itm.className="info_pop";
}
function focusPop(openMe,oIndex)
{
	var itm="";
	
	for(var i=0; i<openMe.length; i++)
	{
		itm= document.getElementById ? document.getElementById(openMe[i]) : document.all[openMe[i]];
		if(oIndex != -1)
		{
			itm.className=(openMe[i]!=openMe[oIndex]) ? "info_pop" : "info_pop_open";
		}
		else {
			itm.className="info_pop"
			itm= document.getElementById ? document.getElementById("y") : document.all["y"];
			itm.innerHTML="[Expand all now]";
		}
	}
}


function sidePop(id1,id2)
{
	id1=itemValue(id1);
	id2=itemValue(id2);
	
	//from main.js
	styleSet(id2,"top",(id1.offsetTop-1)+"px",0);
	styleSet(id2,"left",(id1.offsetLeft+id1.offsetWidth+2)+"px",0);

	id2.style.display=="block" ? 
		styleSet(id2,"display","none",0) : styleSet(id2,"display","block",0);
}

function hideOrShowLI(currentItem) {
	var showTxt="[Expand all now]";
	var hideTxt="[Hide all now]";
	
	var doc=document.getElementById ? document.getElementsByTagName('a') : document.all;

	for(var i=0; i<doc.length; i++)
	{
		if(doc[i].onclick)
		{		
			var ocStr=doc[i].onclick+"";
			if(ocStr.indexOf("linkInjector")>-1)
			{
				var linkInjId=itemValue(doc[i].id);
				linkInjector(linkInjId);
			}
		}
	}
	currentItem.innerHTML = (currentItem.innerHTML==showTxt ? hideTxt : showTxt);
}

function changeInner(currentItem,text1,text2,setThisTitle)
{
	var children=currentItem.parentNode.childNodes;	
	var correctInner=true;

	for(var i=0; i<children.length; i++)
	{		
		if(currentItem.innerHTML==text2 && children[i].className=="info_pop_open")
		{
			correctInner=false;
		}
		if(currentItem.innerHTML==text1 && children[i].className=="info_pop")
		{
			correctInner=false;
		}
	}
		currentItem.innerHTML=(currentItem.innerHTML==text2 && correctInner ? text1 : text2);
}

function hideOrShow(currentItem) {

	var showTxt="[Expand all now]";
	var hideTxt="[Hide all now]";
	var doc=document.getElementById ? document.getElementsByTagName('div') : document.all;
	var newClass=(currentItem.innerHTML==hideTxt ? "info_pop" : "info_pop_open");
	
	for(var i=0; i<doc.length; i++)
	{
		if(doc[i].className)
		{
			if(doc[i].className!="noprint")
			{
				if(doc[i].className.indexOf("info_pop") > -1)
				{
					doc[i].className=newClass;
				}
			}
		}
		
	}
	changeInner(currentItem,showTxt,hideTxt);

}

function setWindowResize(wOffset,hOffset) {
	var consoleContent='<scr';
	consoleContent+='ipt type="text/javascript">';
	/* YUP, THIS IS JAVASCRIPT INSIDE JAVASCRIPT
	   RESIZE WINDOW, USING THE SAME VALUES OF WINDOW SIZE, THIS WILL RESIZE TO WINDOW OUTER SIZE */
	consoleContent+='var hOffset='+hOffset+';';
	consoleContent+='var wOffset='+wOffset+';';
	consoleContent+='top.resizeTo(200,200);';
	//REMEASURE WINDOW INNER SIZE PROPERTIES
	consoleContent+='var imgBH=window.innerHeight ? window.innerHeight : document.body.offsetHeight;';
	consoleContent+='var imgBW=window.innerWidth ? window.innerWidth : document.body.offsetWidth;';
	/* COMPARE THE OUTER AND INNER SIZES TO GET THE DIFFERENCE VALUE OF THE STUFF AROUND THE CONTENT
	    LIKE MENU STUFF GOOGLE SEARCH BAR ETC.*/
	consoleContent+='var hDif=200-imgBH; var wDif=200-imgBW;';
	/* FUNCTION CALLED BY IMAGE ONLOAD.  DETERMINES THE SIZE OF THE CONTENT USING
	   THE IMAGE WIDTH FOR WIDTH AND ALL-ENCOMPASSING DIV TAG FOR HEIGHT 
	   DO *NOT* ADD ANY TAGS BETWEEN DIV AND IMAGE SINCE DIV IS REFERENCED BY PARENT/CHILD */ 
	consoleContent+='function resizeAgain(thisItem,definedValues){';
	consoleContent+='var w; ';
	consoleContent+='var h; ';
	consoleContent+=' if(!definedValues){';
	consoleContent+='  w=thisItem.width+wOffset+wDif; ';
	consoleContent+='  h=document.getElementById ? ';
	consoleContent+='  document.getElementById("mDiv") : document.all["mDiv"];';
	consoleContent+='  h=h.offsetTop+h.offsetHeight+hOffset+hDif;';
	consoleContent+=' }';
	consoleContent+=' else {';
	consoleContent+='  h=thisItem+40; ';
	consoleContent+='  w=definedValues+60; ';
	consoleContent+=' }';
	consoleContent+=' top.resizeTo(w,h); ';
 	consoleContent+='}';
 	consoleContent+='</scr';
	consoleContent+='ipt>';
		
	return consoleContent;
}

function setWindowStyle() {
var consoleContent='';	
	//REMEBER TO MAKE SURE THAT LIKE REL REFERENCES THE RIGHT FILE FOR WEBSITE
	consoleContent+='<link rel="stylesheet" href="/inc_lib/site.css" type="text/css" />';
	consoleContent+='<style type="text/css">';
	consoleContent+='body {margin: 0; background-color: #cccccc; font-size: 100%;} ';
	consoleContent+='a  { ';
	consoleContent+=' width: 150px; ';
	consoleContent+=' border-style: solid; ';
	consoleContent+=' border-width: 2px; ';
	consoleContent+=' border-color: #003366; ';
	consoleContent+=' border-top-color: #ffffff; ';
	consoleContent+=' border-left-color: #ffffff; ';
	consoleContent+=' color: #ffffff;';
	consoleContent+=' font-size: 90%;';
	consoleContent+=' text-decoration: none;';
	consoleContent+=' background-color: #006699;';
	consoleContent+='} ';
	consoleContent+='#clsLinkDiv { ';
	consoleContent+='	text-align: center; ';
	consoleContent+='} ';
	consoleContent+='a:hover { ';
	consoleContent+=' color: #000000;';
	consoleContent+=' background-color: #ccddff;';
	consoleContent+=' border-color: #003366; ';
	consoleContent+=' border-bottom-color: #ffffff; ';
	consoleContent+=' border-right-color: #ffffff; ';
	consoleContent+='} ';
	consoleContent+='object, embed{height: 90%; width: 98%}';
	consoleContent+='@media print { ';
	consoleContent+='body { ';
	consoleContent+='	background-color: #ffffff ';
	consoleContent+='} ';
	consoleContent+='#clsLinkDiv { ';
	consoleContent+='	display:none; ';
	consoleContent+='} ';
	consoleContent+='} ';
	consoleContent+='</style>';
	
	return consoleContent;
}




function mediaFormat(capLinkTitle,mContent){
//KEEP IN MIND THAT STYLESHEETS FOR THIS SPECIFIC SITE ARE BEING USED	

var wOffset=0;
var hOffset=(capLinkTitle[0]== '' ? 20 : 0);
window_name='view';

if(top.consoleRef){top.consoleRef.close()}

	//SET WINDOW PROPERTIES HERE. WIDTH AND HEIGHT REFER TO INNER WIDTH AND INNER HEIGHT
	windowProps=' top=10,left=10,width=200,height=200,status=1,'+
		'menubar=1,resizable=1,scrollbar=0,toolbar=0 ';

	top.consoleRef=window.open('',window_name,windowProps);
	if(top.consoleRef)
	{	
		consoleContent='';
		consoleContent+=' <html>';
		consoleContent+='<head><title>'+capLinkTitle[2]+'</title>';
		consoleContent+=setWindowStyle();
		consoleContent+='</head><body onload="self.focus()">';	
		consoleContent+=setWindowResize(wOffset,hOffset);
		consoleContent+='<div id="mDiv" class="center" style="width: inherit; height: inherit"> ';
		consoleContent+=mContent;
		consoleContent+='<div id="curCap">'+capLinkTitle[0]+'</div>';	
		consoleContent+='<br />';
		consoleContent+='<div id="clsLinkDiv"><a id="clsLink" class="noprint bold" href="#" onclick="window.close(); return false">';
		consoleContent+='Close Window</a>&nbsp;</div></div>';
		consoleContent+='</body></html>';
		top.consoleRef.document.writeln(consoleContent)
		top.consoleRef.document.close();
	}
	else
	{
		if(capLinkTitle[1].indexOf(".swf") > -1)
		{
			location.href="/media/large_video.html?"+capLinkTitle[1];
		}
		else
		{
			location.href=capLinkTitle[1];
		}
	}
}

function setLink(link)
{
	var caption='';
	var title=link;

	if(link.indexOf(';') > -1){
		caption=link.split(';');
		title=caption[0];
		caption[0]="<div class='pad2 center bold border noT noL noR' " +
			"style='width: 90%; margin: auto; margin-top: 5px; border-color: #aa6600'>" + 
			caption[0]+ "</div>";
		link=caption[1];
		caption=caption[0];
		hOffset=0;		
	}
	var capLink=new Array(caption,link,title);
	return capLink;
	
}

function stopPop(link)
{
	var fileType=link.substring(link.length-3);
	if(fileType=="swf")
	{
		link="http://www.azroc.gov/media/large_video.html?"+link;
	}
	if(link.indexOf(";") > -1)
	{
		link=link.substring(link.indexOf(";")+1);
	}
	location.href=link;
}

function doc_pop(link){
var caption;
var linkValues;

	if(link.indexOf(";") >-1)
	{
		var linkValues=link.split(";");
		caption=linkValues[0];
		link=linkValues[1];
	}
	else
	{
		caption="";
	}
	
	popup(link,caption);
	
	
		

		//DETERMINE IF THIS IS A PICTURE OR NOT
 		/*var is_a_picture=link.substring(link.length-3)=='jpg' || 
			link.substring(link.length-3)=='gif' ||
			link.substring(link.length-3)=='png';

 		if(is_a_picture){
	 		var capLinkTitle=setLink(link);

			mContent='<img src="'+capLinkTitle[1]+'" border="0" '+
				' style="border: 2px solid #666666; margin: auto " '+
				' onerror="this.style.visibility=\'hidden\'" '+
				' onload="if(this.height >'+maxH+') {this.height='+maxH+'}'+
				' if(this.width < '+minW+') {this.width='+minW+'} '+
				' resizeAgain(this,false) " alt="'+capLinkTitle[2]+'" '+
				' /><br />';
	
			mediaFormat(capLinkTitle,mContent);*/
 		//}
	
		//else {
			
			/*
			windowProps=' top=10,left=10,width=800,height=400,status=1,'+
				'menubar=1,resizable=1,scrollbars=1,toolbar=1 ';
		
			if(!poppedWindow || poppedWindow.closed)
			{
				poppedWindow=window.open(link,'documentWindow',windowProps);
				if(poppedWindow)
				{
					poppedWindow.focus();	
				}
				else
				{
					location.href=link;
				}
			}
			else
			{
				poppedWindow.location.href=link;
				poppedWindow.focus();	
			}*/
			
		//}
	
}

function flashPop(link,mediaHeight,mediaWidth){
	doc_pop(link);
	
	//if(getCookie("nopop")){
		//stopPop(link);
	//}
	//else {
	
 		/*var capLinkTitle=setLink(link);
 		var mContent='';

		mContent+='<scr';
		mContent+='ipt type="text/javascript">';
		mContent+=' top.resizeTo('+(mediaWidth)+','+(mediaHeight)+');';
 		mContent+='</scr';
		mContent+='ipt>';
		mContent+='<div class="font80">';
		mContent+='Resize window to resize video</div>';
		mContent+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
		mContent+='codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/';
		mContent+='swflash.cab#version=8,0,0,0" id="AZROCVideo" align="middle">';
		mContent+='<param name="allowScriptAccess" value="sameDomain" />';
		mContent+='<param name="movie" value="'+capLinkTitle[1]+'" />';
		mContent+='<param name="quality" value="high" />';
		mContent+='<param name="bgcolor" value="#000000" />';
		mContent+='<embed src="'+capLinkTitle[1]+'" quality="high" bgcolor="#000000" ';
		mContent+='name="AZROCVideo" align="middle" ';
		mContent+='allowScriptAccess="sameDomain" type="application/x-shockwave-flash"';
		mContent+='pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		mContent+='</object>';
		mediaFormat(capLinkTitle,mContent);
	}*/
}


