// JavaScript Document
var EditorType="editAreaLoader";
$(document).ready(function()	{
	
	 var editor=['DiyContent','outerfor','ForClassContent','LabelContent','content'];
	
	
		function DoEditor(){
		
		if(typeof(editAreaLoader)!="undefined"){
	     
		$(editor).each(function(index, element) {			
           if($("#"+this)[0]){
			editAreaLoader.init({
			id: this	
			,start_highlight: true	
			,allow_resize: "both"
			,allow_toggle: true
			,word_wrap: true
			,syntax: "html"	
		});   
		   }
        });
  
       }else{
		    EditorType="markItUp";
		   $(editor).each(function(index, element) {	
		   if($("#"+this)[0]){
			   $("#"+this).markItUp();
		   }});
	   }
	}
	
	
	DoEditor();
   
});

function SetDiyContent(oTextarea,strText){ 
if(EditorType!="editAreaLoader")  
   $.markItUp({target:'#'+oTextarea, placeHolder:strText});
   else
   editAreaLoader.setSelectedText(oTextarea, strText);
}   

function CheckAll(obj)  
  {  
    //$(obj).parentsUntil("form").find("input:checkbox[checked=true]").attr("checked",$(obj).attr("checked"));
   //涔嬫墍浠ヨ繖鏍峰啓锛坈lick锛夋槸涓轰簡 缁欏悗闈㈡煇涓搷浣滄彁渚涙湇鍔℃敮鎸?涔嬫墍浠ュ姞浜嗕釜c灞炴€ф槸鑰冭檻鍒癹query鐨刢lick涓湪鍒ゆ柇checkbox灞炴€х殑鏃跺€欏拰dom鐨刢lick鏈夐棶棰?
     if($(obj).attr("checked")){$(obj).parentsUntil("form").find("input:checkbox[checked=false]").attr("c",'false').click();}else{
		 $(obj).parentsUntil("form").find("input:checkbox[checked=true]").attr("c",'true').click();
	 }
  }