
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 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(){
	
	//add the bg color for the odd and even tr 
	$(".table-list tr:even").each(function(){
		$(this).css("background","#f9f9f9");
	})
	
	//add the bg color for the odd and even tr 
	$(".table-list tr").each(function(){
		$(this).click(function(){
			
			var bg = $(this).css("background");
			if(bg == null || bg == "")
			{
				$(this).css("background","#fcf0ca");
			}
			else
			{
				$(this).css("background","");
			}
			
			var checkbox = $(this).find("input[type=checkbox]");
			if($(checkbox).attr("checked"))
			{
				$(checkbox).removeAttr("checked");
			}
			else
			{
				$(checkbox).attr("checked","true");
			}
			
		})
		
	})
	
	
	$(".table-list tr").each(function(){
		$(this).find("input[type=checkbox]").bind("click",function(event){
			
			var flag = $(this).attr("checked");
			if(flag)
			{
				$(this).attr("checked","true")
			}
			else
			{
				$(this).removeAttr("checked")
			}
			
			event.stopPropagation();  
			
		})
	})
	
	
	
})
