function none(){
}

// querystring functions
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
  return false;
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function setOpacity(obj, opacity) {
	if(typeof(obj) == "string"){
		obj = document.getElementById(obj);
	}
	obj.style.filter = "alpha(style=0,opacity:" + opacity + ")";	// IE
	obj.style.KHTMLOpacity = opacity / 100;						// Konqueror
	obj.style.MozOpacity = opacity / 100;							// Mozilla (old)
	obj.style.opacity = opacity / 100;							// Mozilla (new)
}

function changeOpacity(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("setOpacity('" + id + "'," + i + ")",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++){
            setTimeout("setOpacity('" + id + "'," + i + ")",(timer * speed));
            timer++;
        }
    }
}


function getStyle(obj,styleProp){

	if (obj.currentStyle)
		var y = obj.currentStyle[styleProp];

	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);


	return y;
}

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function clearDropDown(OptionList) {

   // Always clear an option list from the last entry to the first
   for (x = OptionList.length; x >= 0; x--) {
      OptionList[x] = null;
   }
}


function addToDropDown(OptionList, OptionValue, OptionText) {
   // Add option to the bottom of the list
   OptionList[OptionList.length] = new Option(OptionText, OptionValue);
}


function numberFormat(num,decimals){
	decimals = (decimals == null) ? 2 : decimals;
	num = Math.round(num*Math.pow(10,decimals))/Math.pow(10,decimals);
	num = String(num);
	decimals = false;
	
	if(num.indexOf(".") != -1){
		num = num.split(".");
		decimals = num[1];
		num = num[0];
	}
	var str = "";
	var p;
	while(num.length > 3){
		str = ","+num.substr(-3)+str;
		num = num.substr(0,num.length-3);
	}
	if(num.length > 0){
		str = num+str;
	}
	
	if(decimals){
		str = str + "." + decimals;
		
	}
	
	return str;
		
}
