// Include senate_alert.js, senate_confirm.js
//document.write('<scr'+'ipt type="text/javascript" src="/incls82/senate_alert.js" ></scr'+'ipt>');
//document.write('<scr'+'ipt type="text/javascript" src="/incls82/senate_confirm.js" ></scr'+'ipt>');
//* House Website Script Functions *//


/* DHTML Fly-Out Menus (based on menuDropdown by Dave Lindquist) */

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, triggerId) {
    var menu = document.getElementById(menuId);
    var trigger = document.getElementById(triggerId);

    if (menu == null || trigger == null) return;

	// Fix IE mouseout Bug
	menu.style.backgroundColor = "#f4ecd9";


	menu.onmouseout = function() {
		menu.style.visibility = "hidden";
	}
    trigger.onmouseout = function() {
		menu.style.visibility = "hidden";
    }

	menu.onmouseover = function() {
		menu.style.visibility = "visible";
	}
    trigger.onmouseover = function() {
        menu.style.left = this.offsetLeft + "px";
//        menu.style.left = this.offsetLeft + "10px";

		// Right-align last menu
//		if (trigger.className == "rightcol") {
//			menu.style.left = (trigger.offsetLeft + trigger.offsetWidth - menu.offsetWidth) + "px"
//		}

		menu.style.visibility = "visible";
    }
}

window.onload = function() {
	initializeMenu("GeneralMenu", "GeneralNav");
	initializeMenu("DepartmentMenu", "DepartmentNav");
	initializeMenu("SchedulesMenu", "SchedulesNav");
	initializeMenu("PubsMenu", "PubsNav");
	initializeMenu("VideoMenu", "VideoNav");
	initializeMenu("AudioMenu", "AudioNav")}
/******** we brought these functions in *******/

function formHandler( boxname ){
var URL = boxname.options[boxname.selectedIndex].value;
window.location.href = URL; }

function openChamber() {
     window.open("http://ww3.house.leg.state.mn.us/chamber/displaynew.asp",null,
"height=170,width=250,status=no,toolbar=no,menubar=no,location=no")
}

function openChamberW() {
     window.open("http://ww3.house.leg.state.mn.us/chamber/displayWnew.asp",null,
"height=170,width=250,status=no,toolbar=no,menubar=no,location=no")
}

function openScript(url,width,height) {
        var Win = window.open(url,"openScript",'width=' + width + ',height=' + height +
',resizable=0,scrollbars=no,menubar=no,status=no' );
}

function init() {
var strWinProp;
  intWidth = screen.width - 10; //Adjust for the end of screen (don't know why?)
  intHeight = screen.height - 80; //Adjust for the Icon Bar at the bottom of the window.
  
  strWinProp = " toolbar=no"         //Back, Forward, etc...
               + ",location=yes"      //URL field
               + ",directories=no"   //"What's New", etc...
               + ",status=yes"       //Status Bar at bottom of window.
               + ",menubar=no"       //Menubar at top of window.
               + ",resizeable=no"    //Allow resizing by dragging. (Yes - Does not work with Netscape or IE)
               + ",scrollbars=yes"   //Displays scrollbars is document is larger than window.
               + ",titlebar=yes"     //Enable/Disable titlebar resize capability.
               + ",width="+intWidth    //Standard 640,800/788, 800/788
               + ",height="+intHeight  //Standard 480,600/541, 600/566               
               + ",top=0"              //Offset of windows top edge from screen.
               + ",left=0"             //Offset of windows left edge from screen.
               + "";  

}

//* Senate Intranet Script Functions *//


//* <!-----beginning dropmenu code-----> *//
//* <script language=\"JavaScript1.2\"> *//
//reusable/////////////////////////////

var zindex=100
function dropit2(whichone){
if (window.themenu&&themenu.id!=whichone.id)
themenu.style.visibility="hidden"
themenu=whichone
if (document.all){
themenu.style.left=document.body.scrollLeft+event.clientX-event.offsetX-200
themenu.style.top=document.body.scrollTop+event.clientY-event.offsetY+18
if (themenu.style.visibility=="hidden"){
themenu.style.visibility="visible"
themenu.style.zIndex=zindex++
}
else{
hidemenu()
}
}
}

function dropit(e,whichone){
if (window.themenu&&themenu.id!=eval(whichone).id)
themenu.visibility="hide"
themenu=eval(whichone)
if (themenu.visibility=="hide")
themenu.visibility="show"
else
themenu.visibility="hide"
themenu.zIndex++
themenu.left=e.pageX-e.layerX-150
themenu.top=e.pageY-e.layerY+18
return false
}

function hidemenu(whichone){
if (window.themenu)
themenu.style.visibility="hidden"
}

function hidemenu2(){
themenu.visibility="hide"
}
//causes error
//if (document.all)
//document.body.onmouseover=hidemenu
//END causes error

//* <!-----end dropmenu code-----> *//
//reusable/////////////////////////////
//* </script> */

/*********** Begin GO function for forms*********/
	function go(par_name)	{
 //   box = par_name;
		destination = par_name.options[par_name.selectedIndex].value;
		if (destination) location.href = destination;
	}
/*********** End GO function for forms*********/
/*********** Begin showhint function *********/
/***********************************************
* Show Hint script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
		
var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox
/*********** End showhint function *********/
