// JavaScript Document
if (!NetSense) var NetSense = {};
if (!NetSense.Js) NetSense.Js = {};
if (!NetSense.Js.Framework) NetSense.Js.Framework = {};
var maxindex=9999;
var _ReturnObject="";
var Config = {width:"400",
            height:"300",
            status:"false",
            menu:"false",
            resizable:"false",
            timer:800,
            step:100,
            messageType:"static",//system tips custmessage static
            showType:"summury"   //summury immediately
            }
var SysDictionay = {"payitem":"/WebPages/utility/dialog.aspx?type=payitem",
	"example":"Helloworld.aspx"
};
function button(style){   
    this.handler=function(){};
    this.mover=function(){};
    this.mout=function(){};
    this.style=style;
}
function bar(){
    
}
function title(){

}

function o(id){
    //alert(typeof(id));
    if(typeof(id)=="string") return document.getElementById(id);
    if(typeof(id)=="object") return id;
}
function Diver(exp1,exp2)
{
    var n1 = Math.round(exp1);
    var n2 = Math.round(exp2);
    var rslt = n1/n2;
    if(rslt > 0)
        rslt = Math.floor(rslt);    // return value is : 小于等于其数值参数的最大整数值
    else
        rslt = Math.ceil(rslt);     // return value is : 大于等于其数字参数的最小整数
    return rslt;
}

function pageWidth(){
    
        if(document.documentElement)return document.documentElement.clientWidth;
        else{
        return document.body.style.clientWidth;
        }
   
}
function pageHeight(){
    if(document.documentElement)return document.documentElement.clientHeight;
        else{
        return document.body.style.clientHeight;
        }
}
var PageValid       =   true; //提交页面是否检查表单有效性
var DataChanged     =   "Data has been changed and you don't save it before close window,confirm?";
var FormChanged     =   false; //表单是否修改，刷新或半闭页面时提醒
var FormSaveAction  =   false; //是否是提交页面，如果当前页面提交，则不示未保存信息,点击linkbutton有BUG....
var VALID_RESULT    =   true;
var INVALID_MESSAGE =   new Array();
var VALID_STACK     =   new Array();
var CONTROL_STACK   =   new Array();
var CUST_PAGE_VALID =   true;
var Style = function() {
this.width = "200px"; this.height = "22px"; this.borderColor = "#546987";
    this.borderStyle = "solid"; this.borderWidth = "1px";
    this.backgroundColor = "#dedede";
    this.backgroundImage = "";
    this.left = "100px"; this.top = "100px";
    this.zIndex = 100000; this.float = ""; this.clear = "";
    this.position = "fixed";
};

//给url加参数，拼接&或？，如果有同样参数，则替换，否则连接para=value    .aspx?hel=abd&dc=dfs
function addParameter(url, para, value) {
    var connector=url.indexOf("?")==-1?"?":"&";
    if (url.indexOf(para) == -1) {
        url = url + connector + para + "=" + value;
    }
    else{
        var paraIndex = url.indexOf(para);
        var endIndex = url.substring(paraIndex, url.length).indexOf("&");
        if (endIndex = -1) {
            url = url.replace(url.substring(paraIndex, url.length),  para + "=" + value);
        } else {
        url = url.replace(url.substring(paraIndex, endIndex - 1),  para + "=" + value);
        }

    }
    return url;
}
function OnlyDate(dt){	
		    var fulldate = new Date(dt.replace(/-/g,"/"));
		    return fulldate.getFullYear().toString()+"-" +(fulldate.getMonth()+1).toString()+"-"+fulldate.getDate().toString();
		}
function toFix(number,fractionDigits){   
       obj.value= Number(obj.value)?Number(obj.value).toFixed(2) : 0;
}   
function MessageBox(title,info){
	Ext.MessageBox.alert(title,info);
}
function Confirm(title,info,url){
	Ext.Msg.confirm(title,info);
	location.href = url;
}

function modalDialog(rtnObj,type){
    var rtn=window.showModalDialog("/WebPages/utility/frame.html?/WebPages/utility/dialog.aspx?type="+type,"","status=0;scroll=no;dialogHeight=24;resizable=1;edge=sunken")
    if(rtn!=undefined && rtn!=null){
        document.getElementById(rtnObj).innerText=rtn;
    }
}
function custModalDialog(url,width,height,para){
    var rtn=window.showModalDialog("/WebPages/utility/frame.html?../../"+url,para,"status=0;scroll=no;dialogHeight="+height+";dialogWidth="+ width +";resizable=1;edge=sunken")
    if(rtn!=undefined && rtn!=null){
        return rtn;
    }
}

function custReturnModalDialog(obj,url,width,height,para){
    if(typeof("obj")=="string")obj=document.getElementById(obj);
    if(obj.disabled){
        alert("Target field is disabled");
        return;
        }
    var rtn=window.showModalDialog("/WebPages/utility/frame.html?../../"+url,para,"status=0;scroll=no;dialogHeight="+height+";dialogWidth="+ width +";resizable=1;edge=sunken")
    if(rtn!=undefined && rtn!=null){
        obj.innerText=rtn;
    }
}
function custAddModalDialog(obj,url,width,height,para){
    if(typeof("obj")=="string")obj=document.getElementById(obj);
    if(obj.disabled){
        alert("Target field is disabled");
        return;
        }
    var rtn=window.showModalDialog("/WebPages/utility/frame.html?../../"+url,para,"status=0;scroll=no;dialogHeight="+height+";dialogWidth="+ width +";resizable=1;edge=sunken")
    if(rtn!=undefined && rtn!=null){
        obj.value = obj.value+ rtn;
    }
}

function GetParentByTagName(parentTagName, childElementObj) {
    var parent = childElementObj.parentNode;
    while (parent.tagName.toLowerCase() != parentTagName.toLowerCase()) {
        parent = parent.parentNode;
    }
    return parent;
}
// check array IE 7 do not support
Array.prototype.IsElement=function(obj){
    for(var i=0;i<this.length;i++){
        if(obj==this[i]){return true;}
    }
    return false;   
}

// trim
String.prototype.Trim = function() 
{ 
    return this.replace(/(^s*)|(s*$)/g, ""); 
} 

function Trim(str){
    return str.replace(/(^\s*)|(\s*$)/g, ""); 
}
String.prototype.LTrim = function() 
{ 
    return this.replace(/(^s*)/g, ""); 
} 
String.prototype.Rtrim = function() 
{ 
    return this.replace(/(s*$)/g, ""); 
} 
function IsElement(arr,obj){
    for(var i=0;i<arr.length;i++){
        if(obj==arr[i]){return true;}
    }
    return false;
}
function RemoveElement(arr, obj) {
    for (var i = 0; i < arr.length; i++) {
        if (arr[i] == obj) {
            arr.splice(i, 1);
            return arr;
        }
    }
    return arr;
}

function showFilter(srcEl,showTarget,index){
    srcEl= typeof(srcEl)=="string" ? document.getElementById(srcEl):srcEl;
    showTarget = typeof(showTarget)=="string"?document.getElementById(showTarget):showTarget;
    if(showTarget.rows.length==0)return;
    for(var i=1;i<showTarget.rows.length;i++){
        if(showTarget.rows[i].cells[index].innerText.substring(0,srcEl.value.length).toLowerCase()==srcEl.value.toLowerCase()){
            showTarget.rows[i].style.display = "";
        }else{
            showTarget.rows[i].style.display = "none";
        }
    }
}

//window.onload   =   initForm;
//window.onbeforeunload   =  function(){
//    exitalert();
//    if(FormChanged && !FormSaveAction) {
//            return DataChanged;
//        }else{    
//        }
//}

function exitalert(){
    var elements = document.getElementsByTagName("input"); 
        for (var i=0; i<elements.length; i++) { 
             if (elements[i].type == "text" && elements[i].getAttribute("nocheck") != true && elements[i].value != elements[i].defaultValue) {
                FormChanged     =   true;
             }
        }
    
}
function Alert(msg){    
    var s = new Style();
    s.backgroundColor="#ffffff";
    s.height="100px";
    var title="<div style=\"width:"+s.width+"px;height:10px;backgroud-color:#fefefe\">title<span style=\"float:right\">x</span></div>";
    var button="<div style=\"bottom:0px;float:left\"><input type='button' value='Confirm'></div>";
    msg=title+msg+button;
    showObjectCenter("_alertmsg",msg,s);showBack();
}

function showMessage(msg,vo){
    if(vo=="body"){
        alert(msg);
        return false;
    }
    switch(Config.messageType.toLowerCase()){
        case "system":
            alert(msg);
            break;
        case "tips":
            showtips(msg,vo);
            break;
        case "cust":
            showCustMessage(msg,vo);
            break;
        case "static":
            showStaticMessage(msg,vo);
            break;
        default:
            alert(msg);
    }
}
function showtips(msg,vo){
    var tips= getElement("_tips",vo);
    tips.style.position="absolute";
    tips.style.left = vo.getBoundingClientRect().right;
    tips.style.top = vo.getBoundingClientRect().top;
    tips.style.display="";
    tips.innerText=msg;
    tips.className="tipsMessage";    
}
function showStaticMessage(msg,vo){
    getControlID(vo);
    var tips= getElement(vo.id+"_tips",vo);
    tips.setAttribute("onselectstart","return false");
    tips.innerText=msg;
    tips.style.width=120;
    tips.style.position="absolute";
    //alert( document.body.scrollWidth.toString().replace("px","") - tips.style.width.toString().replace("px",""));
    tips.style.left = Math.min(vo.getBoundingClientRect().right +document.body.scrollLeft,document.body.scrollWidth.toString().replace("px","") - tips.style.width.toString().replace("px",""));
    tips.style.top = vo.getBoundingClientRect().top+document.body.scrollTop+3;
    tips.style.display="";    
    tips.className="staticMessage";
}
function getControlID(vo){
    if (vo.id.length>1) return vo.id;
    var rndid="";
    var same=true;
    while(same){
        same=false;
        if(vo.id=="" || vo.id==null || typeof(vo.id)=="undefined" ){
            rndid = "ctrl" + (Math.random()*20000000).toString().substring(0,5);
            if(CONTROL_STACK.length==0){   
                CONTROL_STACK[CONTROL_STACK.length] = rndid;
                    same=false;
                }else{
                for(var i=0;i<CONTROL_STACK.length;i++){
                    if(CONTROL_STACK[i] == rndid){
                      same=true; 
                    }
                 }
            }
        }
    }
    if(CONTROL_STACK.length!=0){   
                CONTROL_STACK[CONTROL_STACK.length]=rndid;
                }
    if(vo.id=="" || vo.id==null || typeof(vo.id)=="undefined")vo.id=rndid;
    else{rndid=vo.id}
    return rndid;
}
function hidetips(obj){
    document.getElementById(obj).style.display="none";
}
function hideStatic(obj){
    var tips = getElement(obj.id+"_tips","body");
    tips.style.display="none";
}
function showBack(id){
    if(id==null||typeof(id)=="string"){id="_background";}else{id=id+"_back";}
    var o =getElement(id,"body");
    o.style.backgroundColor = "#F4F9FF";
    o.style.display =   "";
    o.style.left=0;
    o.style.top = 0;
    o.style.filter = "Alpha(Opacity=80)";
    o.style.MozOpacity = "0.8";  
    o.style.position = "absolute";
    o.style.width   =   document.body.offsetWidth;
    o.style.height  =   Math.max(document.body.offsetHeight + document.body.scrollTop,document.documentElement.offsetHeight);
    o.style.zIndex = maxindex-1;
}
function hideBack() {
    var o = getElement("_background", "body");
    o.style.display = "none";
}
function custMessage(msg,title){
      alert(title+msg);
//    var showDiv=getElement("__custMessage","body");
//    var showDivB=getElement("__custMessageB","body");
//    showDiv.style.position="absolute";
//    showDivB.style.position="absolute";
//    showDiv.innerHTML="<table width=100% border=0><tr><td height='20'><img src='/images/indicator_arrows.gif'><b>"+title+"<b></td></tr><tr><td>"+msg+"</td></tr></table>";
//    showDiv.style.width="200px";
//    showDiv.style.left="200px";//(window.screen.width - showDiv.offsetWidth)/2+"px";
//    showDiv.style.top="120px";//(window.screen.height - showDiv.offsetHeight)/2+"px";
//    showDiv.style.backgroundColor="#dedede";
//    showDiv.style.border="solid 1px #6699ff";
//    showDivB.style.backgroundColor="#dedede";
//    showDivB.style.border="solid 0px #ff0000";
//    showDiv.style.zIndex=9999999;
//    showDivB.style.left     =   showDiv.style.left;
//    showDivB.style.top      =   showDiv.style.top;
//    showDivB.style.width    =   showDiv.style.width;
//    showDivB.style.height   =   showDiv.offsetHeight;
//    showDivB.style.zIndex   =   showDiv.style.zIndex-1;
//    showDivB.style.overflow =   "hidden";
//    
//    showDivB.innerHTML="<iframe id='frm1' width=400 HEIGHT=100% src='/webpages/utility/blank.html'  scrolling=no>";
//    showDiv.style.display="";
//    showDivB.style.display="";
        
   
}
function showProcessMessage(message){
    var showDiv = getElement("__processMessage","body");
    var showDivB = getElement("__processMessageB","body");
    showDiv.style.position="absolute";
    showDivB.style.position="absolute";
    showDiv.innerHTML="<img src='http://www.chinanull.com/image/indicator_arrows.gif'>"+message;
    showDiv.style.width="200px";
    showDiv.style.left=(window.screen.availWidth - showDiv.offsetWidth)/2+"px";
    showDiv.style.top= (window.screen.availHeight - showDiv.offsetHeight)/2-150+"px";
    showDiv.style.height="22px";
    showDiv.style.backgroundColor="#dedede";
    showDiv.style.border = "solid 1px #6699ff";
    showDivB.style.backgroundColor = "#dedede";
    showDivB.style.border = "solid 0px #ff0000";
    showDiv.style.zIndex = 9999999;
    showDivB.style.left     =   showDiv.style.left;
    showDivB.style.top      =   showDiv.style.top;
    showDivB.style.width    =   showDiv.style.width;
    showDivB.style.height   =   showDiv.offsetHeight;
    showDivB.style.zIndex   =   showDiv.style.zIndex-1;
    showDivB.style.overflow =   "hidden";
    showDivB.innerHTML="<iframe id='frm1' width="+showDiv.style.width+" height="+showDiv.style.height+" src='/webpages/utility/blank.html'  scrolling=no>";
    showDiv.style.display="";
    showDivB.style.display="";
}

function showIframe(url, style, obj) {
    if (typeof(style) == "undefined" || style == null) {
        style = new Style();
    }
    var ifr = "<div id=\"_frmHolder_NetSense\"><div style='width:100%;height:22px;cursor:move;background-color:#6699ff;clear:both' onmousedown=\"Javascript:beginDrag('_frmHolder_chinanull',event)\"><span style=\"position:absolute;float:left;color:#dedede;text-decoration:bold;font-size:12pt\" onselectstart=\"return false\">&nbsp;<img src=\"image/icon/fav.png\">&nbsp;ChinaNull.com</span><span style='float:right;cursor:hand;height:22px;color:#ffffff;font-family:Wingdings 2' onclick=\"JavaScript:hideIframe()\">O&nbsp;</span></div><div id='frmbody'><span id='frmloader' style='height:"+parseInt(style.height)+";width:"+parseInt(style.width)+"'><img src='http://www.chinanull.com/image/indicator.gif'>loading...</span><iframe width=100% height="+(parseInt(style.height)-22)+" frameborder=0 src=\"" + url + "\" onload='frmloader.style.display=\"none\"'></iframe></div>"
    if (typeof (obj) == "undefined" || obj == null) {
        //alert(event.srcElement.id);
        showObjectCenter("_frmHolder_chinanull", ifr, style);
    } else {
        showObjectBySrc("_frmHolder_chinanull", ifr, style);
    }
    showBack();
}
function hideIframe() {
    hideObject("_frmHolder_chinanull");
    hideObject("_frmHolder_chinanull_drop");
    hideBack();
    hideProcessMessage();
}
function showObjectBySrc(id, target, style) {
    if (style == null || style == undefined) {
        style = new Style();
    }
    style.left = event.srcElement.getBoundingClientRect().left;
    style.top = event.srcElement.getBoundingClientRect().bottom;
    showObject(id, target, style);
}
function showObjectRight(id, target, style) {
    if (style == null || style == undefined) {
        style = new Style();
    }
    style.left = Math.min(event.srcElement.getBoundingClientRect().right+10,pageWidth()-parseInt(style.width)-5);
    style.top = Math.min( event.srcElement.getBoundingClientRect().top +document.body.scrollTop,pageHeight()-parseInt(style.height)-5);
    showObject(id, target, style);
}
function showObjectCenter(id, target, style) {
    if (style == null || style == undefined) {
        style = new Style();
    }
    style.left = (pageWidth() - style.width.toString().replace("px","")) / 2;
    style.top = (pageHeight() + document.body.scrollTop - style.height)/2;
    showObject(id, target, style);
}
function showObject(id, target, style) {
    if (style == null) {
        style = new Style();
        maxindex++;
        style.width = "200px"; style.height = "22px"; style.borderColor = "#ff0000";
        style.borderStyle = "solid";
        style.position = "absolute";
        style.borderWidth = "1px";
        style.backgroundColor = "#dedede";
        style.backgroundImage = "";
        style.left = "100px"; style.top = "100px";
        style.zIndex = maxindex; style.float = "left"; style.clear = "none";
    }
    var o = new custPanel(id,style);
    o.show(target);
}
function hideObject(id) {
    var o = new custPanel(id);
    o.hide();
    hideBack();
    hideProcessMessage();
}
function toggleObject(id,target,style){
    var o = document.getElementById(id);
    if(o!=undefined && o.style.display!="none"){
        var obj=new custPanel(id,style);
        obj.hide();
        hideBack();
        hideProcessMessage();
    }else{
        showObjectBySrc(id,target,style);
    }
}
function custPanel(id,style) {
    this.id = id;
    this.isShow=false;
    this.show = function(target) {
        var s = new Style();
        var obj = getElement(this.id, "body");
        var o2=getElement(this.id+"_drop","body");
        var s;
        maxindex++;
        for (p in style) {
            if (style[p] != "") {
                s = "obj.style." + p + " = '" + style[p] + "';";
                s=s+"o2.style."+p+"= '"+style[p]+"'";
                eval(s);
            }
        }
        obj.style.zIndex=maxindex;
        o2.style.left = parseInt(obj.style.left)+3;
        o2.style.top = parseInt(obj.style.top)+3;
        o2.style.backgroundColor="#dedede";
        o2.style.borderColor="#dedede";
        o2.style.zIndex=988;
        s = null;
        obj.style.display = "";
        o2.style.display="";
        if (typeof(target) == "string") {
            obj.innerHTML = target;
        }
        else {
            obj.innerHTML = target.innerHTML;            
        }//alert(obj.innerHTML);
        this.isShow=true;
    }
    this.hide = function() {
        var obj = getElement(this.id, "body");
        obj.style.display = "none";
        obj=getElement(this.id+"_drop","body");
        obj.style.display="none";
    };
    
}
function hideProcessMessage(){
    try{
        var showDiv=getElement("__processMessage","body");
        var showDivB=getElement("__processMessageB","body");
        showDiv.style.display="none";
        showDivB.style.display="none";
        showDivB.innerHTML="";
    }catch(e){}
}

function getElement(eName,vo){
    if(typeof(document.getElementById(eName)) == null || document.getElementById(eName)==undefined){
        var o=document.createElement("div");o.id=eName;
        document.body.appendChild(o);
    }
    return document.getElementById(eName);
    if(typeof(document.getElementById(eName)) != null || document.getElementById(eName)==null){
        if((vo==null && typeof(vo)=="undefined" && vo!="") || vo=="body"){
            var o=document.createElement("div");o.id=eName;//o.style="position:absolute;backgroud-color:#efefef";
            document.body.appendChild(o);
            //document.body.insertAdjacentHTML("beforeEnd","<div id=\""+eName+"\" style=\"position:absolute;backgroud-color:#efefef\"></div>");
        }
        else{
            var o = document.createElement(eName);o.id=eName;//o.style="position:absolute;backgroud-color:#efefef";
            document.body.appendChild(o);
          }
    }
    return document.getElementById(eName);
}

//ajax

function doQuery(url,para,fn,asyn){
    var asy=asyn==true?true:false;
    var xmlhttp=new XmlHttpRequestObj();
    var str = xmlhttp.connect(url,"GET",para,fn,asyn);
    //return str;
}

function XmlHttpRequestObj(){
	var xmlhttp, bComplete = false;
	var returnValue = "";
	if(window.ActiveXObject)
	{
		var MS = ["Microsoft", "MSXML2", "MSXML3"];
		for(var i=0; i < MS.length; i++)
		{
			try
			{
				xmlhttp = new ActiveXObject(MS[i] + ".XMLHTTP");
				break;
			}
			catch(e)
			{
				xmlhttp = null;
			}
		}
	}
	else if(window.XMLHttpRequest)
	{
		try
		{
			xmlhttp = new XMLHttpRequest();
		}
		catch(e)
		{
			xmlhttp = null;
		}
	}
	if(xmlhttp == null)
	{
		throw new Error("No XML component installed!")
	}

	this.connect = function(sURL, sMethod, sVars, fnDone, isAsynchronization)
	{
		if (xmlhttp == null)
		{
			return false;
		}
		var returnValue = "";
		if (isAsynchronization == undefined)
			isAsynchronization = true;
		
		bComplete = false;
		sMethod = sMethod.toUpperCase();

		//随机字符串,防止程序调用IE缓存中的内容
		var RandString;
		RandString = "&rand=" + Math.random().toString();

		try
		{
			if (sMethod == "GET")
			{
				xmlhttp.open(sMethod, sURL+(sURL.indexOf("?")==-1? "?" : "&")+sVars + RandString, isAsynchronization);
				sVars = "";
			}
			else
			{
				xmlhttp.open(sMethod, sURL, isAsynchronization);
				xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
				xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			}
			
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState == 4 && !bComplete)
				{
					bComplete = true;
					returnValue = xmlhttp.responseText;
					fnDone(xmlhttp.responseText);
				}
			};
			xmlhttp.send(sVars);
		}
		catch(z)
		{
			return false;
		}
		if (isAsynchronization)
			return true;
		else
			return returnValue;
	};
	return this;
}


        function beginDrag(elementToDrag,event)
        {
          var elementdrop;
          if(typeof(elementToDrag)=="string"){ 
            elementdrop = document.getElementById(elementToDrag +"_drop");
            elementToDrag = document.getElementById(elementToDrag);           
            
          }else{
          
          }
          
          var deltaX=event.clientX - parseInt(elementToDrag.style.left==""?0:elementToDrag.style.left);
          var deltaY=event.clientY - parseInt(elementToDrag.style.top==""?0:elementToDrag.style.top);
          
          document.attachEvent("onmousemove",moveHandler);
          document.attachEvent("onmouseup",upHandler);
           
          event.cancelBubble = true;
          event.returnValue = false;

          function moveHandler(e)  
          {
            //把元素移动到当前的鼠标位置
            e=window.event;
            var posX = event.clientX - deltaX;
            var posY = event.clientY - deltaY ;
            if(posX<0)posX=0;if(posY<0)posY=0;
            if(posX>pageWidth()-5 - parseInt(elementToDrag.style.width)){
                posX = pageWidth()-5  - parseInt(elementToDrag.style.width);
            }
            if(posY >pageHeight()-5  - parseInt(elementToDrag.style.height)){
                posY = pageHeight()-5  - parseInt(elementToDrag.style.height);
            }
            //alert(posX );
            elementToDrag.style.left = posX +"px";
            elementToDrag.style.top =posY +"px";
            try{
            elementdrop.style.left = (posX +3)+"px";
            elementdrop.style.top = (posY +3)+"px";
            }catch(e){}
            //不要让别的元素看到该事件
            event.cancelBubble=true; 
          }
          

          function upHandler(e)
          {
              document.detachEvent("onmouseup",upHandler);
              document.detachEvent("onmousemove",moveHandler);
          }
                event.cancelBubble = true;
         } 
         
function addDebug(str){
    //alert();
    checkDebuger();
    //window.status=str;
    var o=getElement("__debuger","body");
    if(o.innerHTML==""){
        o.innerHTML = "<div style=\"backgroundColor:#6699ff;\" onclick=\"document.getElementById('__debuger').stle.height='20px'\"></div>";
    }
    o.innerHTML = o.innerHTML+"<div style=\"height:22px;z-index:999999;padding:5px\" onmouseover=\"this.style.backgroundColor='#dedede'\" onmouseout=\"this.style.backgroundColor='#ffffff'\">"+str+"</div>";
    //alert(document.getElementById("__debuger").innerHTML);
}
function checkDebuger(){
    var o=document.getElementById("__debuger");
    if( o!=null){
    
    }else{
        var o=document.createElement("DIV")
        o.style.position = "absolute";
        o.style.bottom = "1px";
        o.style.borderColor ="blue";
        o.style.borderStyle="solid";
        o.style.borderWidth="1px";
        o.style.width="100%";
        o.id="__debuger";
        document.appendChild(o);
    }
}
function getCookie(name){
    var pos = document.cookie.indexOf(name+"=");
    var end= document.cookie.indexOf(";",pos)>-1?document.cookie.indexOf(";",pos):document.cookie.length;
    if(pos>-1){
        return document.cookie.substring(pos+name.length+1,end);
    }else{
        return "";
    }
}