/**samson tools js*/
function method1( value ){
    $("#myTable").html('');
	$.ajax(
		{
			type:"POST",  
			url:"/admin/employunit.jhtml?method=liandong&id="+value , 
	 		success:function (response) {
		 		 var data = eval('('+response+')');
	 		     var sel = document.getElementById("proManagerId");
	 		     $("#proManagerId").empty();
	 		     for( var p in data ){
	 		     	sel.appendChild( new Option(data[p],p) );
	 		     }
		 	}
		 }
	  );
	  method2( value );
}

function method2( value ){
    var yixuandanwei = 
	$.ajax(
		{
			type:"POST",  
			url:"/admin/employunit.jhtml?method=canyudanwei&unit="+value , 
	 		success:function (response) {
		 		var data = eval('('+response+')');
		 		for( var p in data ){
		 		   $("#myTable").append("<tr><td><input type='checkbox' value='"+p+"' name='proCyworkId' id='proCyworkId>"+data[p]+"</td></tr>")
		 		}
		 	}
		 }
	  );
}

function method3(){
    var value = document.getElementById("proWordId").value;
    $('#myTable').empty();
    $('#myTable').show('slow');
	method2(value)
}

function method4( param ){
	$.ajax(
		{
			type:"POST",  
			url:"/admin/userAdmin.jhtml?method=leftTree" , 
	 		beforeSend:function(){
	 			$("#"+param).html("<img src='/images/loading1.gif'/>");
	 		},
	 		success:function (response) {
	 		    var data = eval('('+response+')');
		 		$("#"+param).empty();
	 		     for( var p in data ){
	 		        var str = "<li><a href='/admin/project.jhtml?method=showProjectByIndustry&industryId="+p+"' target='iframe_right'>"+data[p]+"</a></li>";
	 		     	$("#"+param).append(str);
	 		     }
		 	}
		 }
	  );
}


function changeClassDisplay(eId) {
	for ( var i = 1; i < 4; i++) {
		var element = document.getElementById('index_' + i);
		
		element.className = "menu_off";
		if( element.style.filter ){
			element.setAttribute( "oldFilter" , element.style.filter );
		}
		element.style.filter="";
		//document.getElementById('index' + i).style.display = 'none';
		var ff = document.getElementById("iframe_left");
		if (ff.contentDocument) {
			ff.contentDocument.getElementById('index' + i).style.display = 'none';
			//alert("ff");
		}else {
			frames['iframe_left'].document.getElementById('index' + i).style.display = 'none';
			//alert("ie");
		}
	
	}

	//var element = document.getElementById('index' + eId);
	var element = null;
	var ff = document.getElementById("iframe_left");
	if (ff.contentDocument) {
		element = ff.contentDocument.getElementById('index' + eId);
		//alert("ff");
	}else {
		element =  frames['iframe_left'].document.getElementById('index' + eId);
		//alert("ie");
	}
	element.className = "menu_on";
	if( element.getAttribute( "oldFilter") ){
		element.style.filter = element.getAttribute( "oldFilter");
	}
	//document.getElementById('index' + eId).style.display = '';
	element.style.display = '';
	//pngfix();
}

function method5(proId,tid,industryId){
	$.ajax(
		{
			type:"POST",  
			url:"/admin/user_admin/ajax/info.jsp?id="+proId+"&industryId="+industryId, 
	 		error:function(xhr){
	 			$("#"+tid).html(
	 				"<table width='100%'><tr><td align='center'><font color='red'>对不起，服务器正忙，请稍候在试</font></td></tr></table>"
	 			);
	 		},
	 		beforeSend:function(){
	 			$("#"+tid).html("<table width='100%'><tr><td align='center'><img src='/images/loading2.gif'/>加载中...</td></tr></table>");
	 		},
	 		success:function (response) {
	 		    $("#"+tid).html(response);
	 		    $("#"+tid).show("slow");
		 	}
		 }
	  );
}

function method6(ulid,rootId){
	$.ajax(
		{
			type:"POST",  
			url:"/project.jhtml?method=indexLoadProject&rootId="+rootId, 
	 		beforeSend:function(){
	 			$("#"+ulid).html("<li><img src='/images/red-loading.gif'/></li>");
	 		},
	 		success:function (response) {
	 		    var data = eval('('+response+')');
	 		    $("#"+ulid).empty();
	 		    var i = 1;
	 		    for( var p in data ){
	 		        var str = "<li><span>•</span><a href='/project.jhtml?method=indexGetProject&id="+p+"' title='"+data[p].substr(0,20)+"'>"+data[p]+"</a></li>";
	 		     	$("#"+ulid).append(str);
	 		     	i = i+1;
	 		     	if( i>6 )break;
	 		     }
	 		    $("#"+ulid).show("slow");
		 	}
		 }
	  );
}

function method7(ulid,murl){
	$.ajax(
		{
			type:"POST",  
			url:murl, 
	 		success:function (response) {
	 		    $("#"+ulid).append(response);
	 		    $("#"+ulid).show("slow");
		 	}
		 }
	  );
}


