function GetWidth()
  {
		  var x = 0;
		  if (self.innerHeight)
		  {
				  x = self.innerWidth;
		  }
		  else if (document.documentElement && document.documentElement.clientHeight)
		  {
				  x = document.documentElement.clientWidth;
		  }
		  else if (document.body)
		  {
				  x = document.body.clientWidth;
		  }
		  return x;
  }

  function GetHeight()
  {
		  var y = 0;
		  if (self.innerHeight)
		  {
				  y = self.innerHeight;
		  }
		  else if (document.documentElement && document.documentElement.clientHeight)
		  {
				  y = document.documentElement.clientHeight;
		  }
		  else if (document.body)
		  {
				  y = document.body.clientHeight;
		  }
		  return y;
  }
  
  function disableEnableInput(id)
  {
	  var input = getObjectFromID(id);
	  
	  if (input.disabled)
		  input.disabled=false;
	  else
		  input.disabled=true;
  }


 /* This method supports any method that needs to grab the object from the
   * ID Name */
   function getObjectFromID()
   {
		var contextItemName = (arguments[0]==null) ? "" : arguments[0]
		var contextItem = ''

		if (document.getElementById) { // DOM3 = IE5, NS6
		contextItem = document.getElementById(contextItemName)
		}
		else {
			if (document.layers) { // Netscape 4
				contextItem = document.contextItemName
			}
			else { // IE 4
				contextItem = document.all.contextItemName
			}
		}

		return contextItem

   }
   
   
   /* ROLLOVER EVENT FOR SUBMENU ITEM */
   function subMenuRollOver() {
   	// alert("yo");
   	// the object should send in itself (this)
   	var contextItem = (arguments[0] == null) ? "" : arguments[0]
   	var className = (arguments[1] == null) ? "" : arguments[1]

   	// make sure we have an object
   	if (contextItem) {
   		if (contextItem.className == 'subMenuButtonNotSelected'
   				&& className.length == 0) {
   			className = 'subMenuButtonOver';
   		} else if (contextItem.className == 'subMenuButtonOver'
   				&& className.length == 0) {
   			className = 'subMenuButtonNotSelected';
   		} else if (contextItem.className == 'subMenuDDButtonNotSelected'
   				&& className.length == 0) {
   			className = 'subMenuDDButtonSelected'
   		} else if (contextItem.className == 'subMenuDDButtonSelected'
   				&& className.length == 0) {
   			className = 'subMenuDDButtonNotSelected'
   		} else if (contextItem.className == 'subMenuSmallDDButtonNotSelected'
   				&& className.length == 0) {
   			className = 'subMenuSmallDDButtonHover'
   		} else if (contextItem.className == 'subMenuSmallDDButtonHover'
   				&& className.length == 0) {
   			className = 'subMenuSmallDDButtonNotSelected'
   		}

   		// we only want to show rollover state if it is expected
   		if (contextItem.className == 'subMenuButtonNotSelected'
   				|| contextItem.className == 'subMenuDDButtonNotSelected'
   				|| contextItem.className == 'subMenuButtonOver'
   				|| contextItem.className == 'subMenuDDButtonSelected'
   				|| contextItem.className == 'subMenuSmallDDButtonNotSelected'
   				|| contextItem.className == 'subMenuSmallDDButtonHover') {
   			contextItem.className = className;
   		}
   	}

   }
   
   
   function toggleLayer(whichLayer)
   {
	   var sObject = getObjectFromID(whichLayer);
	   
	   sObject.style.display = sObject.style.display? "":"none";

   }
   
   
   /* ROLLOVER EVENT FOR SUBMENU ITEM */
   function mainMenuRollOver() {

   	// the object should send in itself (this)
   	var contextItem = (arguments[0] == null) ? "" : arguments[0]
   	var className = (arguments[1] == null) ? "" : arguments[1]

   	if (className.length == 0) {
   		className = 'mainButtonHover';
   	}

   	if (contextItem) {
   		if (contextItem.className.length > 0) {
   			contextItem.className = '';
   		} else {
   			contextItem.className = className;
   		}

   	}

   }



   /* ROLLOVER EVENT FOR Context Button MENU ITEM */
   function actionButtonRollOver() {

   	// the object should send in itself (this)
   	var contextItem = (arguments[0] == null) ? "" : arguments[0]
   	var className = (arguments[1] == null) ? "" : arguments[1]

   	if (className.length == 0) {
   		className = 'contextButtonHover';
   	}

   	if (contextItem) {

   		if (contextItem.className.length > 0) {
   			contextItem.className = '';
   		} else {
   			contextItem.className = className;
   		}

   	}

   }

   /* ROLLOVER EVENT FOR A TAB ITEM ITEM */
   function tabButtonRollOver() {

   	// the object should send in itself (this)
   	var contextItem = (arguments[0] == null) ? "" : arguments[0]
   	var className = (arguments[1] == null) ? "" : arguments[1]

   	if (className.length == 0) {
   		className = 'formTabHover';
   	}

   	if (contextItem) {
   		if (contextItem.className.length > 0) {
   			if (contextItem.className != 'formTabSelected') {
   				contextItem.className = '';
   			}
   		} else {
   			contextItem.className = className;
   		}

   	}
   }

   function tabSectionShowByName(name) {
   	var item = document.getElementById(name);
   	tabSectionShow(item);
   }

   /* function */
   function tabSectionShow() {
   	// the object should send in itself (this)
   	var contextTabItem = (arguments[0] == null) ? "" : arguments[0];
   	var tabpage;
   	var marker;

   	var parent = contextTabItem.parentNode;
   	for ( var t in parent.childNodes) {
   		var node = parent.childNodes[t];
   		if (node == contextTabItem) {
   			node.className = 'formTabSelected';
   			tabpage = getObjectFromID(node.id + "_tabpage");
   			if (tabpage) {
   				tabpage.className = "formTabFormShow";
   			}
   			marker = getObjectFromID(node.id + "_marker");
   			if (marker) {
   				marker.value = "1";
   			}
   		} else {
   			node.className = '';
   			tabpage = getObjectFromID(node.id + "_tabpage");
   			if (tabpage) {
   				tabpage.className = "formTabFormHide";
   			}
   			marker = getObjectFromID(node.id + "_marker");
   			if (marker) {
   				marker.value = "0";
   			}
   		}
   	}
   }

   /* brainerror.net/scripts/javascript/blendtrans/ */
   function opacity(id, opacStart, opacEnd, millisec) {
   	// speed for each frame
   	var speed = Math.round(millisec / 100);
   	var timer = 0;
   	
   	// determine the direction for the blending, if start and end are the same
   	// nothing happens
   	if (opacStart > opacEnd) {
   		for (i = opacStart; i >= opacEnd; i--) {
   			setTimeout("changeOpac(" + i + ",'" + id + "')", (timer * speed));
   			timer++;
   		}
   	} else if (opacStart < opacEnd) {
   		for (i = opacStart; i <= opacEnd; i++) {
   			setTimeout("changeOpac(" + i + ",'" + id + "')", (timer * speed));
   			timer++;
   		}
   	}
   }

   // change the opacity for different browsers
   function changeOpac(opacity, id) {
   	var object = document.getElementById(id).style;
   	object.opacity = (opacity / 100);
   	object.MozOpacity = (opacity / 100);
   	object.KhtmlOpacity = (opacity / 100);
   	object.filter = "alpha(opacity=" + opacity + ")";
   }

   function shiftOpacity(id, millisec) {
   	// if an element is invisible, make it visible, else make it ivisible
   	if (document.getElementById(id).style.opacity == 0) {
   		opacity(id, 0, 100, millisec);
   	} else {
   		opacity(id, 100, 0, millisec);
   	}
   }

   function blendimage(divid, imageid, imagefile, millisec) {
   	var speed = Math.round(millisec / 100);
   	var timer = 0;

   	// set the current image as background
   	document.getElementById(divid).style.backgroundImage = "url("
   			+ document.getElementById(imageid).src + ")";

   	// make image transparent
   	changeOpac(0, imageid);

   	// make new image
   	document.getElementById(imageid).src = imagefile;

   	// fade in image
   	for (i = 0; i <= 100; i++) {
   		setTimeout("changeOpac(" + i + ",'" + imageid + "')", (timer * speed));
   		timer++;
   	}
   }

   function currentOpac(id, opacEnd, millisec) {
   	// standard opacity is 100
   	var currentOpac = 100;

   	// if the element has an opacity set, get it
   	if (document.getElementById(id).style.opacity < 100) {
   		currentOpac = document.getElementById(id).style.opacity * 100;
   	}

   	// call for the function that changes the opacity
   	opacity(id, currentOpac, opacEnd, millisec)
   }
  