	function EID(id) {
		return document.getElementById(id);
	}

	function xmlHtmlStart() {
		var xmlhttp=false;
		try {xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');}
		catch(e) {
			try {
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP');
			}
			catch(E) {xmlhttp = false;}
		}
		if (!xmlhttp && typeof XMLHttpRequest!='undefined') {xmlhttp = new XMLHttpRequest();}
		return xmlhttp;
	}

	function divFill(uri, divID){
		var xmlhttp = divID;
		xmlhttp = xmlHtmlStart();
		xmlhttp.open('GET', uri, true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				var content = xmlhttp.responseText;
				if(content){
					EID(divID).innerHTML = content;
				}
			}
		}
		xmlhttp.send(null);
	}

	
	function urlDo(url){
		var xmlhttp = xmlHtmlStart();
		xmlhttp.open('GET', url, true);
		xmlhttp.send(null);
	}
	

	function divFillPI(uri, divID){
		EID('PI').style.display = '';
		var xmlhttp = xmlHtmlStart();
		xmlhttp.open('GET', uri, true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				var content = xmlhttp.responseText;
				hide('PI');
				if(content){
					EID(divID).innerHTML = content;
				}
			}
		}
		xmlhttp.send(null);
	}

	function divFillPIe(uri, divID){
		EID('PI'+divID).style.display = '';
		var xmlhttp = xmlHtmlStart();
		xmlhttp.open('GET', uri, true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				var content = xmlhttp.responseText;
				hide('PI'+divID);
				if(content){
					EID(divID).innerHTML = content;
				}
			}
		}
		xmlhttp.send(null);
	}
		
	function show(sfield) {
		EID(sfield).style.display = "";
	}           	

	function hide(hfield) {
		EID(hfield).style.display = "none";
	}           	
	function st(sfield) {
		EID(sfield).style.display = "";
	}           	
	function ht(hfield) {
		EID(hfield).style.display = "none";
	}           	
	function postFillPI(url, str, divID) {
		show('PI');
		var xmlhttp = xmlHtmlStart();
		xmlhttp.open("POST", url, true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp.send(str);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				hide('PI');
				var content = xmlhttp.responseText;
				if(content){
					EID(divID).innerHTML = content;
				}
			}
		}
	}
	
	function postFillPIe(url, str, divID) {
		show('PI'+divID);
		var xmlhttp = xmlHtmlStart();
		xmlhttp.open("POST", url, true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp.send(str);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				hide('PI'+divID);
				var content = xmlhttp.responseText;
				if(content){
					EID(divID).innerHTML = content;
				}
			}
		}
	}

	function postFill(url, str, divID) {
		var xmlhttp = xmlHtmlStart();
		xmlhttp.open("POST", url, true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp.send(str);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				var content = xmlhttp.responseText;
				if(content){
					EID(divID).innerHTML = content;
				}
			}
		}
	}

	function getValuesByClass(classID) {
		var getstr = '';
		obj = getElementsByClass(classID);
		for (i=0; i<obj.length; i++) {
			if (obj[i].tagName == "INPUT" || obj[i].tagName == "TEXTAREA" || obj[i].tagName == "HIDDEN") {
				if (obj[i].type == "text" ||obj[i].type == "password" || obj[i].type == "submit" || obj[i].type == "textarea" || obj[i].type == "hidden") {
					getstr += obj[i].name + "=" + encodeURIComponent(obj[i].value) + "&";
				}
				if (obj[i].type == "checkbox") {
					if (obj[i].checked) {
						getstr += obj[i].name + "=" + encodeURIComponent(obj[i].value) + "&";
					} else {
						getstr += obj[i].name + "=&";
					}
				}
				if (obj[i].type == "radio") {
					if (obj[i].checked) {
						getstr += obj[i].name + "=" + encodeURIComponent(obj[i].value) + "&";
					}
				}
			}

			if (obj[i].tagName == "SELECT") {
				var sel = obj[i];

				for (var is=0; is < sel.length; is++) {
					if(sel.options[is].selected) {
						getstr += sel.name + "=" + encodeURIComponent(sel.options[is].value) + "&";
					}
				}
			}
		}
		return getstr;
	}
	
	
	function getElementsByClass(searchClass,node,tag) {
		var classElements = new Array();
		if (node == null)
		node = document;
		if (tag == null)
		tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
		for (i = 0, j = 0; i < elsLen; i++) {
			if (pattern.test(els[i].className) ) {
				classElements[j] = els[i];
				j++;
			}
		}
		return classElements;
	}

	function checkUnCheck(id) {
		if(EID(id).checked == true) {
			EID(id).checked = false;
		}else{
			EID(id).checked = true;
		}
	}

	function dhPrev(obj) {
	    obj.style.backgroundColor = obj.style.backgroundColor? "":"#12679B";
	    obj.style.backgroundImage = "url('/img/prev_hover_icn.png')";
	    obj.onmouseout = function() { dhPrev(this);obj.style.backgroundImage = "url('/img/prev_icn.png')"; };
	}


	function dhNext(obj) {
	    obj.style.backgroundColor = obj.style.backgroundColor? "":"#12679B";
	    obj.style.backgroundImage = "url('/img/next_hover_icn.png')";
	    obj.onmouseout = function() { dhNext(this);obj.style.backgroundImage = "url('/img/next_icn.png')"; };
	}
	
	function buttonHover(obj) {
	    obj.style.backgroundColor = obj.style.backgroundColor? "":"#eeeeee";
	    obj.onmouseout = function() { buttonHover(this); };
	}
	
	