﻿function getElement(id){
	if(document.getElementById && document.getElementById(id)){
		return document.getElementById(id);
	}else{
		return null;
	}
}
function getElementFromEvent(evt){
	if(evt && evt.srcElement){
		return evt.srcElement;
	}else if(evt && evt.target){
		return evt.target;
	}else{
		return null;
	}
}
function getEvent(e){
	return e || window.event;
}
function isChildOf(parent, child, recursive){
	var children = parent.childNodes;
	for(var i=0; i<children.length; i++){
		if(children[i] == child){
			return true;
		}else if(!recursive){
			if(isChildOf(children[i], child, recursive)){
				return true;
			}
		}
	}
	return false;
}
function EncodeQS(str){
	str = encodeURIComponent(""+str);
	while(str.indexOf("-") > -1){ str = str.replace("-", "%2D"); } 
	return str;
}
