		var defaultMainList = "Home"; //sets active tab on the navigation bar.
		var SWFparams = {
  			menu: "false",
			wmode: "transparent"
		};
		swfobject.embedSWF("images/rotator.swf", "myContent", "145", "45", "9", "/images/expressInstall.swf");
		swfobject.embedSWF("/images/main_splash.swf", "swfArea", "1000", "140", "9.0.0", null , null, SWFparams);
		


function grayOut(vis, options) {
  // Pass true to gray out screen, false to ungray
  // options are optional.  This is a JSON object with the following (optional) properties
  // opacity:0-100         // Lower number = less grayout higher = more of a blackout 
  // zindex: #             // HTML elements with a higher zindex appear on top of the gray out
  // bgcolor: (#xxxxxx)    // Standard RGB Hex color code
  // grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});
  // Because options is JSON opacity/zindex/bgcolor are all optional and can appear
  // in any order.  Pass only the properties you need to set.
  var options = options || {}; 
  var zindex = options.zindex || 500;
  var opacity = options.opacity || 70;
  var opaque = (opacity / 100);
  var bgcolor = options.bgcolor || '#000000';
  var dark=document.getElementById('darkenScreenObject');
  if (!dark) {
    // The dark layer doesn't exist, it's never been created.  So we'll
    // create it here and apply some basic styles.
    // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');           // Create the layer.
        tnode.style.position='absolute';                 // Position absolutely
        tnode.style.top='0px';                           // In the top
        tnode.style.left='0px';                          // Left corner of the page
        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
        tnode.style.display='none';                      // Start out Hidden
        tnode.id='darkenScreenObject';                   // Name it so we can find it later
    tbody.appendChild(tnode);                            // Add it to the web page
    dark=document.getElementById('darkenScreenObject');  // Get the object.
  }
  if (vis) {
    // Calculate the page width and height 
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';
    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }   
    //set the shader to cover the entire page and make it visible.
    dark.style.opacity=opaque;                      
    dark.style.MozOpacity=opaque;                   
    dark.style.filter='alpha(opacity='+opacity+')'; 
    dark.style.zIndex=zindex;        
    dark.style.backgroundColor=bgcolor;  
    dark.style.width= pageWidth;
    dark.style.height= pageHeight;
    dark.style.display='block';
	document.getElementById("loader").style.visibility = "visible"; //our loader animation

  } else {
     dark.style.display='none';
	 document.getElementById("loader").style.visibility = "hidden"; //our loader animation
  }
}


function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
w=window.open(href, windowname, 'width=600,height=600,scrollbars=yes');
window.location.reload(true);
w.focus(); // call focus here, since we can't do it in the called page anymore.
return false;
}




function siteSearch(){
	if(document.getElementById("searchForm").query.value== 'Search!'){
		alert("Please enter a valid query before searching.");
		document.getElementById("searchForm").query.focus();

	}
	else if(document.getElementById("searchForm").searchType[0].checked == true){
		//do cgcc-only search
		window.location.href = 'http://165.235.30.43/search?q=' + document.getElementById("searchForm").query.value;
		return false;
	}
	else if(document.getElementById("searchForm").searchType[1].checked == true){
		//do ca.gov search
		window.location.href = 'http://ca.gov/CaSearch/Default.aspx?type=All&search=' + document.getElementById("searchForm").query.value;
		return false;
	}	


	
}


function loadReport(report){ 
window.location.href = '?pageID=licensees&reportID=' + report;
return false;
}


function setFocus(){ // this function calls our generic Javascript querystring parser (below), retrieves reportID from URL, and sets dropdown list to that report.
	var qs = new Querystring();
	var a=qs.get("reportID");
	for (i=0;i<document.getElementById("DropDownList1").length;i++){
		if (a == document.getElementById("DropDownList1")[i].value)
		{
			document.getElementById("DropDownList1")[i].selected = true;
			return;
		}
	}
}



/* Client-side access to querystring name=value pairs
	Version 1.3
	28 May 2008
	
	License (Simplified BSD):
	http://adamv.com/dev/javascript/qslicense.txt
*/
function Querystring(qs) { // optionally pass a querystring to parse
	this.params = {};
	
	if (qs == null) qs = location.search.substring(1, location.search.length);
	if (qs.length == 0) return;

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ');
	var args = qs.split('&'); // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i = 0; i < args.length; i++) {
		var pair = args[i].split('=');
		var name = decodeURIComponent(pair[0]);
		
		var value = (pair.length==2)
			? decodeURIComponent(pair[1])
			: name;
		
		this.params[name] = value;
	}
}

Querystring.prototype.get = function(key, default_) {
	var value = this.params[key];
	return (value != null) ? value : default_;
}

Querystring.prototype.contains = function(key) {
	var value = this.params[key];
	return (value != null);
}


var RotatingBanner = {
	delayMS: 6000, // Delay before displaying next image, in milliseconds
	bPlaying: 1, // 1 = playing, 0 = paused

	arrayImgs: null, // Array of images
	currentIndex: 0, // Index of current image
	nextIndex: 1, // Index of next image
	mainTimerID: null,
	fadeTimerID: null,
	counterZ: 2, // counter, used for z-index of front image

	fMainLoop:function () {

		RotatingBanner.arrayImgs[RotatingBanner.nextIndex].xOpacity = 0; // Set opacity of next image to 0
		RotatingBanner.fSetOpacity(RotatingBanner.arrayImgs[RotatingBanner.nextIndex]);

		RotatingBanner.counterZ++;
		RotatingBanner.arrayImgs[RotatingBanner.nextIndex].parentNode.style.zIndex = RotatingBanner.counterZ; // Place next <a> on top

		RotatingBanner.fCrossFade(); // do fade

		if (RotatingBanner.bPlaying)
			RotatingBanner.mainTimerID = setTimeout(RotatingBanner.fMainLoop,RotatingBanner.delayMS); // delay, recurse
	},

	fCrossFade:function () {
		RotatingBanner.fadeTimerID = null;
		RotatingBanner.arrayImgs[RotatingBanner.nextIndex].xOpacity += .10; // fade in
		
		RotatingBanner.fSetOpacity(RotatingBanner.arrayImgs[RotatingBanner.nextIndex]);
		
		if (RotatingBanner.arrayImgs[RotatingBanner.nextIndex].xOpacity >= .99) {
			// done with fade

			RotatingBanner.currentIndex = RotatingBanner.nextIndex;
	
			RotatingBanner.nextIndex = (RotatingBanner.currentIndex < RotatingBanner.arrayImgs.length - 1) ? RotatingBanner.currentIndex + 1 : 0; // index of next img

		} else {
			RotatingBanner.fadeTimerID = setTimeout(RotatingBanner.fCrossFade,50); // short pause, recurse to continue fade.
		}

	},

	fSetOpacity:function (obj) {
		if (obj.xOpacity > .99) {
			obj.xOpacity = .99;
		}
		obj.style.opacity = obj.xOpacity; // the CSS3 method, for newer Mozilla, Safari, Opera
		obj.style.MozOpacity = obj.xOpacity; // older Mozilla
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity * 100) + ")"; // for IE
	},

	fControl:function (controlParam) {
	},

	initialize:function () {
		if (document.getElementById && document.getElementById("rotating_banner_container")) { // Make sure browser supports getElementById and div "rotating_banner_container" exists

			document.getElementById("rotating_banner_container").className += " javascript_enabled";
	
			// create array of all img nodes
			RotatingBanner.arrayImgs = document.getElementById("rotating_banner_container").getElementsByTagName("img");
			
			// display first img
			RotatingBanner.arrayImgs[RotatingBanner.currentIndex].parentNode.style.zIndex = RotatingBanner.counterZ; // Place first <a> on top

			RotatingBanner.mainTimerID = setTimeout(RotatingBanner.fMainLoop,RotatingBanner.delayMS);
		}
	}
}

addLoadEvent(RotatingBanner.initialize);


