﻿if (window.top.location != window.location)
    window.top.location = window.location;

//屏蔽输入，显示蒙板 
        function showMask(id) { 
            var obj = document.getElementById(id); 
            obj.style.width = document.body.clientWidth; 
            obj.style.height = document.body.clientHeight; 
            obj.style.display = "block"; 
        } 
        //隐藏蒙板 
        function hideMask(id) { 
            document.getElementById(id).style.display = "none"; 
        } 
        
        function centerwh(obj,NotShowBack)
{
    var h1 = document.body.clientHeight;
    var h2 = document.documentElement.clientHeight;
    var isXhtml = (h2<=h1&&h2!=0)?true:false; 
    var body = isXhtml?document.documentElement:document.body;
    
    var wh={left:0,top:0,display:"block"};
    var vwh={w:0,h:0};
    vwh.w=$.browser.msie?parseInt(body.clientWidth):parseInt(window.innerWidth);
    vwh.h=$.browser.msie?parseInt(body.clientHeight):parseInt(window.innerHeight);
    wh.left=(vwh.w/2)-parseInt($(obj).css("width"))/2;
    wh.top=body.scrollTop+(vwh.h/2)-parseInt($(obj).css("height"))/2;
    $(obj).css("top",wh.top);
    $(obj).css("left",wh.left);
    $(obj).css("display",wh.display);
    //return wh;
    if(!NotShowBack){
showMask("mask");}
}
function drag(id){
this.obj = $('#'+id);
this._o = "";
this._x = this._y = 0;
$(this.obj).bind("mousedown", {fobj:this}, function(oEvent){oEvent.data.fobj.start(oEvent)});
}
drag.prototype.start = dragStart;
drag.prototype.stop = dragStop;
drag.prototype.move = dragMove;
function dragStart(oEvent){
this._o = this.obj.offset();
this._x = oEvent.clientX - this._o.left;
this._y = oEvent.clientY - this._o.top;
$(document).bind("mousemove.drag", {fobj:this}, function(oEvent){oEvent.data.fobj.move(oEvent)});
$(document).bind("mouseup.drag", {fobj:this}, function(oEvent){oEvent.data.fobj.stop(oEvent)});
}
function dragStop(oEvent){
$(document).unbind("mousemove.drag");
$(document).unbind("mouseup.drag");
}
function dragMove(oEvent){
$(this.obj).css('left',(oEvent.clientX-this._x));
$(this.obj).css('top',(oEvent.clientY-this._y));
}
var ts=new drag("pic_contact1");
function showcontact(){centerwh('#pic_contact1');hideSelect();}
function showProgress(){centerwh('#pic_progress',true);}
function closecontact(){
document.getElementById('pic_contact1').style.display='none';hideMask('mask');showSelect();}


var elms = document.getElementsByTagName("select"); 

function showSelect(){ 
for (var i=0;i<elms.length;i++) 
elms.item(i).style.display=""; 
} 
function hideSelect(){ 
for (var i=0;i<elms.length;i++) 
elms.item(i).style.display="none"; 
} 

