

function $(id){return document.getElementById(id);};function $T(tagName){return document.getElementsByTagName(tagName);};function $N(name){return document.getElementsByName(name);};function bind(obj,eventHandler,fun){isIEbrowser()?obj.attachEvent('on'+eventHandler,fun):obj.addEventListener(eventHandler,fun,false);};function isIEbrowser(){if(document.all)return true;return false;};function isHide(obj){objStyle=obj.currentStyle||window.getComputedStyle(obj,false);if(objStyle.display=='none')return true;return false;};function hide(obj){obj.style.display='none';};function show(obj){var showType='block';if(arguments[1])showType=arguments[1];obj.style.display=showType;};function remove(obj){isIEbrowser()?obj.removeNode(true):obj.parentNode.removeChild(obj);};function html(obj,inhtml){if(arguments[1])obj.innerHTML=inhtml;else return obj.innerHTML;};function $ajax(){var ajaxObj=arguments[0];var xmlHttp;try{xmlHttp=new XMLHttpRequest();}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){return false;}}};xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==1&&typeof ajaxObj.beforeSend=='function')ajaxObj.beforeSend(xmlHttp);if(xmlHttp.readyState==4&&xmlHttp.status==200&&typeof ajaxObj.success=='function')ajaxObj.success(xmlHttp.responseText);};var async=true;if(typeof ajaxObj.async=='boolean')async=ajaxObj.async;var contentType='application/x-www-form-urlencoded';if(typeof ajaxObj.contentType=='string')contentType=ajaxObj.contentType;if(typeof ajaxObj.timeout=='number')setTimeout(function(){xmlHttp.abort();if(typeof ajaxObj.timeoutCallback=='function')ajaxObj.timeoutCallback();},ajaxObj.timeout);switch(ajaxObj.type){case 'GET':xmlHttp.open("GET",ajaxObj.url+'?'+ajaxObj.data,async);xmlHttp.setRequestHeader("Content-Type",contentType);xmlHttp.send(null);break;case 'POST':xmlHttp.open("POST",ajaxObj.url,async);xmlHttp.setRequestHeader("Content-Type",contentType);xmlHttp.send(ajaxObj.data);break;default:return;}};function getFormValues(frm){var objForm,submitDisabledElements=false,prefix="",preUnfix="",valStr="";if(arguments.length>1&&arguments[1]==true)submitDisabledElements=true;if(arguments.length>2)prefix=arguments[2];if(arguments.length>3)preUnfix=arguments[3];if(typeof(frm)=="string")objForm=document.getElementById(frm);else objForm=frm;if(objForm&&objForm.tagName=='FORM'){var formElements=objForm.elements;for(var i=0;i<formElements.length;i++){if(!formElements[i].name)continue;if(formElements[i].name.substring(0,prefix.length)!=prefix)continue;if(preUnfix.length&&formElements[i].name.substring(0,preUnfix.length)==preUnfix)continue;if(formElements[i].type&&(formElements[i].type=='radio'||formElements[i].type=='checkbox')&&formElements[i].checked==false)continue;if(formElements[i].disabled&&formElements[i].disabled==true&&submitDisabledElements==false)continue;var name=formElements[i].name;if(name){if(valStr!="")valStr+='&';if(formElements[i].type=='select-multiple'){for(var j=0;j<formElements[i].length;j++){if(formElements[i].options[j].selected==true)valStr+=name+"="+encodeURIComponent(formElements[i].options[j].value)+"&";}}else valStr+=name+"="+encodeURIComponent(formElements[i].value);}}};return valStr;};function dimensions(obj){var width,height,innerWidth,innerHeight,left,top,offsetX,offsetY,scrollHeight,scrollWidth,scrollLeft,scrollTop;if(obj==window||obj==document){width=innerWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;height=innerHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;left=top=offsetX=offsetY=0;scrollHeight=document.body.scrollHeight;scrollWidth=document.body.scrollWidth;scrollLeft=self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;scrollTop=self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;}else{width=obj.offsetWidth||obj.clientWidth;height=obj.offsetHeight||obj.clientHeight;styleObj=obj.currentStyle||window.getComputedStyle(obj,false);innerWidth=width-parseInt(styleObj.borderLeftWidth||0)-parseInt(styleObj.borderRightWidth||0);innerHeight=height-parseInt(styleObj.borderTopWidth||0)-parseInt(styleObj.borderBottomWidth||0);left=obj.offsetLeft;top=obj.offsetTop;offsetX=offsetY=0;newObj=obj;while(newObj){offsetX+=newObj.offsetLeft;offsetY+=newObj.offsetTop;newObj=newObj.offsetParent;};scrollHeight=obj.scrollHeight;scrollWidth=obj.scrollWidth;scrollLeft=obj.scrollLeft;scrollTop=obj.scrollTop;};return{'width':width,'height':height,'innerWidth':innerWidth,'innerHeight':innerHeight,'left':left,'top':top,'offsetX':offsetX,'offsetY':offsetY,'scrollHeight':scrollHeight,'scrollWidth':scrollWidth,'scrollLeft':scrollLeft,'scrollTop':scrollTop}};function trim(str){return str.replace(/^\s+|\s+$/g,'');};function preg_match(regE,str,returnType){if(!arguments[2])return regE.test(str);return str.match(regE);};function _GET(key){gets=new Array();if(!window.location.search.length)return gets;querystring=window.location.search.substring(1);var getarr=querystring.split("&");for(var i=0;i<getarr.length;i++){if(typeof key!='undefined'){if(getarr[i].substring(getarr[i].indexOf('='),0)==key)return getarr[i].substring(getarr[i].indexOf('=')+1);}else{gets[getarr[i].substring(getarr[i].indexOf('='),0)]=getarr[i].substring(getarr[i].indexOf('=')+1);}};if(typeof key!='undefined')return null;return gets;};function _COOKIE(key){cookies=new Array();if(document.cookie){var cookiearr=document.cookie.split("; ");for(var i=0;i<cookiearr.length;i++){if(typeof key!='undefined'){if(cookiearr[i].substring(cookiearr[i].indexOf('='),0)==key)return cookiearr[i].substring(cookiearr[i].indexOf('=')+1);}else{cookies[cookiearr[i].substring(cookiearr[i].indexOf('='),0)]=cookiearr[i].substring(cookiearr[i].indexOf('=')+1);}}};if(typeof key!='undefined')return null;return cookies;};function _SERVER(key){var servers=new Array();servers['HTTP_HOST']=window.location.host;servers['PHP_SELF']=window.location.pathname;servers['SCRIPT_NAME']=window.location.pathname;servers['REQUEST_URI']=window.location.pathname+window.location.search;servers['QUERY_STRING']=window.location.search.substring(1);servers['HTTP_COOKIE']=document.cookie;servers['SERVER_PROTOCOL']=document.protocol;servers['HTTP_USER_AGENT']=navigator.userAgent;(typeof document.referrer!='undefined'&&document.referrer!='')?servers['HTTP_REFERER']=document.referrer:'';if(typeof key!='undefined'){if(typeof servers[key]!='undefined')return servers[key];return null;};return servers;};function in_array(needle,haystack){for(var key in haystack){if(haystack[key]==needle)return true;};return false;};function count(mixed_var){var len=0;for(var key in mixed_var)len++;return len;};function sizeof(mixed_var){return count(mixed_var);};function is_array(mixed_var){if(mixed_var.constructor==Array)return true;return false;};function is_object(mixed_var){if(mixed_var.constructor==Object)return true;return false;};function is_bool(mixed_var){if(mixed_var.constructor==Boolean)return true;return false;};function is_null(mixed_var){if(mixed_var==null)return true;return false;};function is_string(mixed_var){if(mixed_var.constructor==String)return true;return false;};function is_numeric(mixed_var){if(mixed_var.constructor==Number)return true;return false;};function function_exists(function_name){if(typeof function_name=="function")return true;return false;};function intval(mixed_var){return parseInt(mixed_var);};function floatval(mixed_var){return parseFloat(mixed_var);};function strval(mixed_var){return mixed_var.toString();};function time(){return new Date().getTime();};function explode(separator,string){return string.split(separator);};function implode(glue,array){return array.join(glue);};function urlencode(str){return encodeURI(str);};function urldecode(str){return decodeURI(str);};function strpos(haystack,needle){if(haystack.indexOf(needle)==-1)return false;return haystack.indexOf(needle);};function strtoupper(str){return str.toUpperCase();};function strtolower(str){return str.toLowerCase();}