
function confirmurl(url,message) 
{
	url = url+'&pc_hash='+pc_hash;
	if(confirm(message)) redirect(url);
}
function redirect(url) {
	location.href = url;
}
function loadData() {
	window.location.reload();
}



function createObjPos(id)
{	
/*
	var width = document.body.clientWidth;				
	var height = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight);	
	var m_left = $("#"+id).offset().left;	
	if((m_left+185)>width)
		m_left-=50
	if((m_left-185)<0)
		m_left+=50		
 	var m_top = $("#"+id).offset().top;	
	*/
	var m_left = document.documentElement.clientWidth /2;
	var m_top = document.documentElement.clientHeight/2;
	
	var obj = new Object();
	obj.left = m_left;
	obj.top = m_top;
	
	return obj;
	
}


//������
$(function(){
	$(":text").addClass('input-text');
})

/**
 * ȫѡcheckbox,ע�⣺��ʶcheckbox id�̶�ΪΪcheck_box
 * @param string name �б�check���,�� uid[]
 */
function selectall(name) {
	if ($("#check_box").attr("checked")==false) {
		$("input[name='"+name+"']").each(function() {
			this.checked=false;
		});
	} else {
		$("input[name='"+name+"']").each(function() {
			this.checked=true;
		});
	}
}
function openwinx(url,name,w,h) {
	if(!w) w=screen.width-4;
	if(!h) h=screen.height-95;
	url = url+'&pc_hash='+pc_hash;
    window.open(url,name,"top=100,left=400,width=" + w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
}
//�����Ի���
function omnipotent(id,linkurl,title,close_type,w,h) {
	if(!w) w=700;
	if(!h) h=500;
	art.dialog({id:id,iframe:linkurl, title:title, width:w, height:h, lock:true},
	function(){
		if(close_type==1) {
			art.dialog({id:id}).close()
		} else {
			var d = art.dialog({id:id}).data.iframe;
			var form = d.document.getElementById('dosubmit');form.click();
		}
		return false;
	},
	function(){
			art.dialog({id:id}).close()
	});void(0);
}

function checkFormSearch() {
    if ($.trim($("#keyword").val()) == "") {
        alert("请输入查询关键字！");
        return false;
    }
    return true;
}

function searchDisplay(){
	var searchId = $("#searchId").val();
	if(searchId == 1){
	  $("#search").show();
	  $("#searchId").val(2);
	}
	if(searchId == 2){
	  $("#search").hide();
	  $("#searchId").val(1);
	}
}

function loginOut(id){
	var backUrl = window.location.href;
		backUrl = backUrl.substr(backUrl.indexOf("/", 8),backUrl.length);
	var str = encodeURIComponent(backUrl);
    var url = "/ui/user/loginOutUser?url="+str+"&mobile=get&id="+id+"";
    window.location.href = url;
	/*$("#url").val(backUrl);
	$("#outId").submit();*/
}
