var CheckHanler = function(){
	list.each(function(i){
		var input = $(this);
		if(this.checked){
			input.parent().parent().addClass("checked");
		}
		else{
			input.parent().parent().removeClass("checked");
		}
	});
}
var checkTb1 = function(selectType){
	CheckInit("tb1",selectType);
}

var CheckInit = function(tabelId,selectType){
	if(list == undefined){
		list = $("#" + tabelId).find("input[type='checkbox']").not("[rel]");
	}
	CheckControl(list,selectType,CheckHanler)
}
var CheckControl = function(childs,selectType,checkHandler){
	for(var i = 0,len = childs.length; i < len; i++){
		switch(selectType){
			case 1:	//全选
			childs[i].checked = true;
			break;
			case 2:	//不选
			childs[i].checked = false;
			break;
			case 3:	//反选
			childs[i].checked = !childs[i].checked;
			break;
		}
	}
	if(checkHandler){
		checkHandler();
	}
}
function InsertFlash (elm,url,link,w,h){
	if(!document.getElementById(elm))
	return;
	var str='';
	str+='<div style="z-index:-1">';
	str+='<object width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
	str+='<param name="movie" value="'+url+'">';
	str+='<param name="wmode" value="transparent">';
	str+='<param name="quality" value="autohigh">';
	str+='<param name="allowScriptAccess" value="always" > ';
	str+='<embed width="'+w+'" height="'+h+'" src="'+url+'" quality="autohigh" wmode="transparent" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
	str+='</object>';
	str+='</div>';
	str+='<a href="'+link+'" style="cursor:hand; display:block;margin-top:-'+h+'px; width:'+w+'px; height:'+h+'px; z-index:10; visibility: visible;" target="_blank"><img src="'+STATIC_URL+'images/blank.gif" width="'+w+'" height="'+h+'" border="0" /></a>';
	document.getElementById(elm).innerHTML = str;
}
