var DHTML = (document.getElementById || document.all || document.layers);

function getObj(id)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(id);
	this.style = document.getElementById(id).style;
  }
  else if (document.all)
  {
	this.obj = document.all[id];
	this.style = document.all[id].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[id];
   	this.style = document.layers[id];
  }
}

function changeDisplay(id, displayType)
{
	if (!DHTML) return;
	var x = new getObj(id);	
	x.style.display = displayType;
}

function changeSize(id, size)
{
	if (!DHTML) return;
	
	var x = new getObj(id);
	x.style.fontSize = size;	
}

function changeFont(id, font)
{
	if (!DHTML) return;
	var x = new getObj(id);
	x.style.fontFamily = font;
}

		
function popWindow(url, target, features) {	
 	var open = window.open(url, target, features);
}

function getVId() {					
	var viewId = getRequestParameter("View");
	return viewId;
}

function getMode() {					
	var mode = getRequestParameter("Mode");
	return mode;
}




function getRequestParameter(param) {
	var q = document.location.search || document.location.hash;
	if(q) {
		var pairs = q.substring(1).split("&");
		for (var i=0; i < pairs.length; i++) {
			if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
				return pairs[i].substring((pairs[i].indexOf("=")+1));
			}
		}
	}
	return "";
}

function onInit() {
}

function addLoadEvent(fn) {	
	if (!window.loadEvents) {
		window.loadEvents = [];
		var loadFn = function() { for (var i=0,f;(f=window.loadEvents[i]);i++) f(); }
		if (window.addEventListener) 
			window.addEventListener('load', loadFn, false)
		else if (window.attachEvent) 
			window.attachEvent('onload', loadFn);
	}
	
	window.loadEvents.push(fn);
}


addLoadEvent(onInit);		

	
