﻿function load() {
	if(top.location != self.location) {	top.location = self.location; }
}

var activeobject;
var posx;
var posy ;
var xoffset;
var yoffset;
var MouseOverTimeOut;

function GetMousePosition(e) 
{
	posx = 0;
	posy = 0;

	if (!e) var e = window.event;
	
	if (e.pageX || e.pageY) 
	{
		posx = e.pageX;
		posy = e.pageY;
	} 
	else if (e.clientX || e.clientY) 
	{
		if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) 
		{				
			posx = parseInt(e.clientX) + parseInt(document.documentElement.scrollLeft);
			posy = parseInt(e.clientY) + parseInt(document.documentElement.scrollTop);
		} 
		else 
		{				
			posx = parseInt(e.clientX) + parseInt(document.body.scrollLeft);
			posy = parseInt(e.clientY) + parseInt(document.body.scrollTop);
		}
	}

	if(activeobject!=null)
	{
		activeobject.style.top = (posy+yoffset) + "px";
		activeobject.style.left = (posx+xoffset) + "px";
	}
}

function InformationPopupOn(information, aWidth, aXoffset, aYoffset, bgColor)
{
    activeobject = document.createElement("div");
    activeobject.style.width = aWidth + "px";
    activeobject.className = "onmouseoverpopup";
    activeobject.innerHTML = information;
    activeobject.style.backgroundColor = bgColor;
    document.body.appendChild(activeobject);

    xoffset = aXoffset;
    yoffset = aYoffset;
}

function InformationPopupOff()
{
    document.body.removeChild(activeobject);
    activeobject = null;
}

function AlternativeColorTable(TableName, Color, AltColor, FirstRowIncluded)
{
    if(document.getElementById(TableName) != null)
    {
	    var trs = document.getElementById(TableName).getElementsByTagName("tr");

	    for (var i = 0; i < trs.length; i++)
	    {
		    if(i > 0)
		    {
				var mytr = trs[i];
								
				if(mytr.className != "me")
				{
					if(i%2 == 0)
					{
						mytr.style.background = AltColor;
					}
					else
					{
						mytr.style.background = Color;
					}
				}
		    }
		    else if(FirstRowIncluded)
		    {
			    if(i%2 == 0)
			    {
				    var mytr = trs[i];
				    mytr.style.background = AltColor;
			    }
			    else
			    {
				    var mytr = trs[i];
				    mytr.style.background = Color;
			    }
		    }
		}
	}
}

/*function SetBackground(img) {
	document.getElementById("w").style.backgroundImage = "url("+img+")";
	document.getElementsByTagName("body")[0].style.background = "#b2b2b2";
}*/

document.onmousemove = GetMousePosition;

//if(window.addEvent){
//window.addEvent('domready', function() {

//var versionFull = navigator.userAgent || navigator.appVersion;
//var index = versionFull.indexOf("MSIE");
//if(index != -1) { var version = parseFloat(versionFull.substring(index + 4)); }
//var doit = version && version == 6 ? false : true;
//focus username if browser != IE6
//if(doit && !document.getElementById('inoutformanchor')) { if(document.getElementById('ctl00_txtUsername')) { document.getElementById('ctl00_txtUsername').focus(); }}

/*if(document.getElementById('btn')) {
	var effect = $('btn').effect('background-color', {duration: 800});
	 
	var fx = function() {
		effect.start('#f4f4f4').chain(function() {
			effect.start('#bcd965');
		});
	}
	 
	fx();	
	fx.periodical(1700);

}*/

//});}

function activate_input(el)	{ el.className = "focused"; }
function clear_input(el,def) { if(el.value.toLowerCase() == def.toLowerCase()) { el.value = ""; } }