﻿/***********************************************
* Always Visible Combo Box- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
***********************************************/

function alertWinSize(whichWinSize){
	var myWidth = 0;
	var myHeight = 0;
	if(typeof( window.innerWidth ) == 'number'){
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	if(whichWinSize == 'height'){
		return myHeight;
	}else if(whichWinSize == 'width'){
		return myWidth;
	}else{
		return false;
	}
}

//function isOldBrowser(){
//	if(typeof document.body.style.maxHeight != "undefined"){
//		// IE 7, mozilla, safari, opera 9
//		return false;
//	}else{
//		return true;
//	}
//}
function isOldBrowser(){	
	if(window.XMLHttpRequest){
		if(window.ActiveXObject){
			// IE 7
			return false;
		}else{
			// Opera, Safari, Firefox
			return false;
		}
	}else{
		//IE 6 and below
		return true;
	}
}
var alwayscombo={
	location: ["top", "right"], //Position of com box from window edge ["top|bottom", "left|right"]
	addoffset: [230, 5], //Additional offset from specified location above [vertical_offset, horizontal offset]
	comboid: "visiblecombo", //ID of div containing floating combo

	////////Stop editing past here///////////////////

	navigate:function(){
	var selectobj=this.comboref.getElementsByTagName("select")[0]
	if (selectobj.options[selectobj.selectedIndex].value!="default")
		window.location=selectobj.options[selectobj.selectedIndex].value
	},

	floatcombo:function(){
	var docElement=(document.compatMode=='CSS1Compat')? document.documentElement: document.body
	if (this.location[0]=="top")
		this.comboref.style.top=0+this.addoffset[0]+"px"
	else if (this.location[0]=="bottom")
		this.comboref.style.bottom=0+this.addoffset[0]+"px"
	if (this.location[1]=="left")
		this.comboref.style.left=0+this.addoffset[1]+"px"
	else if (this.location[1]=="right")
		this.comboref.style.right=0+this.addoffset[1]+"px"
	},

	init:function(){
	this.comboref=document.getElementById(this.comboid)
	this.comboref.style.visibility="visible"
	this.floatcombo()
	}
}
