
function li_nav_over(li,last) {
	if ( !last ) li.style.borderBottom = "1px solid #7078c2";
	li.style.cursor = "pointer";
	li.style.backgroundColor = "#000033";
	li.style.color = "#FFFFFF";
	li.style.textDecoration = "none";
}

function li_nav_out(li,last) {
	if ( !last ) li.style.borderBottom = "1px solid #DDDDEE";
	li.style.backgroundColor = "";
	li.style.fontWeight = "normal";
	li.style.color = "#1144FF";
	li.style.textDecoration = "none";
}

function onMIF(input,text,pw)
{
	input.style.color = "#000000";
	if ( input.value == text ) input.value = "";
	if ( pw == 1 )
	{
		//input.style.background = "background: #fff none 1px 1px no-repeat;";
		input.style.backgroundImage = "none";
	}
}
function onMIB(input,text,pw)
{
	if ( input.value == "" )
	{
		input.style.color = "#667788";
		if ( pw == 1 )
		{
			input.style.backgroundImage = "url('/content/img/password.gif')";
			input.style.backgroundPosition = "1px 1px";
			input.style.backgroundRepeat = "no-repeat";
		}
		else
		{
			input.value = text;
		}
	}
	else
	{
		input.style.color = "#000000";
	}
}

function hilite_submit(what,yes) {
    if ( yes == "1" ) {
    	//what.className = "submit submit_mover";
    	what.style.cursor = "pointer";
    }
    else {
    	//what.className = "submit";
    	what.style.cursor = "";
    }
}

function simpleOver(what,yes) {
    if ( yes == "1" ) {
    	what.style.cursor = "pointer";
    }
    else {
    	what.style.cursor = "";
    }
}

function are_you_sure(text) {
	if ( confirm(text) ) {
		return true;
	} else return false;
}

function getHeight() {
    var d = document.documentElement;
    var b = document.body;
    var who = d.offsetHeight ? d : b ;
    var iHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ;
    return iHeight;
}

function getScrollTop() {
    var d = document.documentElement;
    var b = document.body;
    var who = d.offsetHeight ? d : b ;
    return who.scrollTop;
}

function nt(obj)
{
	obj.target = '_blank';
}

AIM = {
	frame : function(c) {

		var n = 'f' + Math.floor(Math.random() * 99999);
		var d = document.createElement('DIV');
		d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="AIM.loaded(\''+n+'\')"></iframe>';
		document.body.appendChild(d);

		var i = document.getElementById(n);
		if (c && typeof(c.onComplete) == 'function') {
			i.onComplete = c.onComplete;
		}

		return n;
	},

	form : function(f, name) {
		f.setAttribute('target', name);
	},

	submit : function(f, c) {
		AIM.form(f, AIM.frame(c));
		if (c && typeof(c.onStart) == 'function') {
			return c.onStart();
		} else {
			return true;
		}
	},

	loaded : function(id) {
		var i = document.getElementById(id);
		if (i.contentDocument) {
			var d = i.contentDocument;
		} else if (i.contentWindow) {
			var d = i.contentWindow.document;
		} else {
			var d = window.frames[id].document;
		}
		if (d.location.href == "about:blank") {
			return;
		}

		if (typeof(i.onComplete) == 'function') {
			i.onComplete(d.body.innerHTML);
		}
	}
}









function Layer() {
	this.toggle = toggle;
	this.setHeight = setHeight;

	var layer_toggled = false;
	var current_layer = null;
	var custom_height = -1;

	function setHeight(h) {
		custom_height = h;
	}

	function toggle(show_id) {
        var w = document.body.clientWidth/2;
        var h = custom_height != -1 ? custom_height : getHeight()/2;

        if ( current_layer != null ) {
            document.getElementById(current_layer).style.display = "none";
        }
        if ( layer_toggled == 0 || show_id != '' )
        {
        	var box = document.getElementById(show_id);
        	if ( !box ) return;

            document.getElementById('dark_layer').style.display = "block";
            box.style.top = "-1000px";
            box.style.left = "-1000px";
            box.style.display = "block";
            box.style.top = (getScrollTop()+h-(box.offsetHeight/2))+"px";
            box.style.left = (w-(box.offsetWidth/2))+"px";
            //box.style.left = "100px";
            layer_toggled = true;
            current_layer = show_id;
        }
        else
        {
            layer_toggled = false;
            document.getElementById('dark_layer').style.display = "none";
        }
    }
}

var Layer = new Layer();