﻿//---------------------------------------
function clearText(thefield)
	{
		if (thefield.defaultValue==thefield.value)
		thefield.value = ""
	} 

//---------------------------------------
function SimpleSwapSetup()
	{
		var x = document.getElementsByTagName("img");
		for (var i=0;i<x.length;i++)
		{
			var oversrc = x[i].getAttribute("oversrc");
			if (!oversrc) continue;

			// preload image
			// comment the next two lines to disable image pre-loading
			x[i].oversrc_img = new Image();
			x[i].oversrc_img.src=oversrc;
			// set event handlers
			x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
			x[i].onmouseout = new Function("SimpleSwap(this);");
			// save original src
			x[i].setAttribute("origsrc",x[i].src);	
		}
	}

//---------------------------------------	
function SimpleSwap(el,which)
	{
		//rollover in IE6 below disabled - el is returned as just [object] rather than [object HTMLImageElement] in IE6
		if (msieversion() == 0)
			{el.src=el.getAttribute(which || "origsrc");}
		else
			{
			if (msieversion() < 7){} 
			else{el.src=el.getAttribute(which || "origsrc");}
			}
	}

//---------------------------------------
function msieversion()
	{
		var ua = window.navigator.userAgent
		var msie = ua.indexOf ( "MSIE " )

		if ( msie > 0 )      // If Internet Explorer, return version number
			{return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))}
		else                 // If another browser, return 0
			{return 0}
	}

	function showworkinggif() {
	    if (window.innerHeight && window.scrollMaxY) // Firefox 
	    {
	        pageWidth = window.innerWidth + window.scrollMaxX;
	        pageHeight = window.innerHeight + window.scrollMaxY;
	    }
	    else if (document.body.scrollHeight > document.body.offsetHeight) // all but Explorer Mac
	    {
	        pageWidth = document.body.scrollWidth;
	        pageHeight = document.body.scrollHeight;
	    }
	    else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
	    {
	        pageWidth = document.body.offsetWidth + document.body.offsetLeft;
	        pageHeight = document.body.offsetHeight + document.body.offsetTop;
	    }

	    document.getElementById('divWaitingCont').style.visibility = 'visible';
	    document.getElementById('divWaitingCont').style.height = pageHeight + "px"
	    document.getElementById('divWaiting').style.display = 'block';
	}

	function hideworkinggif() {
	    document.getElementById('divWaitingCont').style.visibility = 'hidden';
	    document.getElementById('divWaiting').style.display = 'none';
	}


	function showworkinggifmain() {
	    if (window.innerHeight && window.scrollMaxY) // Firefox 
	    {
	        pageWidth = window.innerWidth + window.scrollMaxX;
	        pageHeight = window.innerHeight + window.scrollMaxY;
	    }
	    else if (document.body.scrollHeight > document.body.offsetHeight) // all but Explorer Mac
	    {
	        pageWidth = document.body.scrollWidth;
	        pageHeight = document.body.scrollHeight;
	    }
	    else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
	    {
	        pageWidth = document.body.offsetWidth + document.body.offsetLeft;
	        pageHeight = document.body.offsetHeight + document.body.offsetTop;
	    }

	    document.getElementById('divWaitingMain').style.visibility = 'visible';
	    document.getElementById('divWaitingMain').style.height = (pageHeight - 160) + "px"
	    document.getElementById('divWaitingMain').style.width = (pageWidth - 152) + "px"
	    document.getElementById('divWaiting').style.display = 'block';
	    
	}

	function hideworkinggifmain() {
	    document.getElementById('divWaitingMain').style.visibility = 'hidden';
	    document.getElementById('divWaiting').style.display = 'none';
	}
