function isDefined(varCheck)
{ return (typeof(window[varCheck])!="undefined"); }
function submitButtonFix(oForm){
	if(document.all||document.getElementById){
		for (i=0;i<oForm.length;i++){var elObj=oForm.elements[i];if(elObj.type.toLowerCase()=="submit"||elObj.type.toLowerCase()=="button"||elObj.type.toLowerCase()=="reset") elObj.disabled=true}}}
function submitOnce(oForm){
	if(! isDefined('_submit')){_submit=1;submitButtonFix(oForm);return true;}
	else {return false;}}
function doSubmit(oForm){
	if(! isDefined('_submit')){_submit=1;submitButtonFix(oForm);oForm.submit();}}
function setOpacity(sEl,val){
	oEl=document.getElementById(sEl);
	if(oEl){oEl.style.opacity = val/10;
	oEl.style.filter = 'alpha(opacity=' + val*10 + ')';}}
function togBox(cName){
  var obj = document.getElementById(cName);
  if(obj.style.display == 'none' || obj.style.display == ''){showBox(obj);}
  else{hideBox(obj);}}
function showBox(oName){oName.style.display='block';}
function hideBox(oName){oName.style.display='none';}
function addAttributeName(node) {if(node.type&&!(node.className&&node.className.indexOf(node.type)>=0)) {node.className = node.type;}}
function togCell(cName){
  var obj = document.getElementById(cName);
  if(obj.style.display == 'none' || obj.style.display == ''){showCell(obj);}
  else{hideCell(obj);}}
function showCell(oName){
  dispType = (oName.tagName.toLowerCase()=='tr') ? 'table-row':'table-cell';
  try{oName.style.display=dispType;}
  catch(e){oName.style.display = 'block';}}
function hideCell(oName){oName.style.display='none';}
function parseQueryString(q){
	if(q.length > 1) this.q = q.substring(1, q.length);
	else this.q = null;
	this.keyValuePairs = new Array();
	if(q){
		for(var i=0; i < this.q.split("&").length; i++)
		{this.keyValuePairs[i] = this.q.split("&")[i]; }}
	this.getKeyValuePairs = function() { return this.keyValuePairs;}
	this.getValue = function(s){
		for(var j=0; j < this.keyValuePairs.length; j++){
			if(this.keyValuePairs[j].split("=")[0] == s)
			return this.keyValuePairs[j].split("=")[1];} return false;}
	this.getParameters = function(){
		var a = new Array(this.getLength());
		for(var j=0; j < this.keyValuePairs.length; j++)
		{a[j] = this.keyValuePairs[j].split("=")[0];} return a;}
	this.getLength = function() { return this.keyValuePairs.length;}}
function getQueryString(key){
	if(! isDefined('_urlVarAS'))
	{ _urlVarAS = new parseQueryString(window.location.search); }
	return unescape(_urlVarAS.getValue(key));}
