function modtd(td0,td2,td4){
	this.td0=td0;
	this.td2=td2;
	this.td4=td4;
};

var bdg_layout=new Array();
bdg_layout[0]=new modtd("100%","0","0");
bdg_layout[1]=new modtd("76%","24%","0");
bdg_layout[2]=new modtd("24%","76%","0");
bdg_layout[3]=new modtd("50%","50%","0");
bdg_layout[4]=new modtd("24%","52%","24%");
bdg_layout[5]=new modtd("20%","40%","40%");


function settd(modtdid){

	var modtdnum=1;
	if(modtdid==0){
		modtdnum=1;
	}
	else if(modtdid<=3){
		modtdnum=2;
		}
		else{
			modtdnum=3;
		};
	document.getElementById("modtd_0").className="c"+modtdnum+"t1 lay"+modtdid+"td0"; //ÉèÖÃÑùÊ½
	document.getElementById("modtd_1").className="c"+modtdnum+"t2 lay"+modtdid+"td1";
	var thistd=document.getElementById("modtd_2");
	if(bdg_layout[modtdid].td2=="0"){
		movenodefromtd("modtd_2");
		thistd.innerHTML="";
	}
	else{
		createfordag("modtd_2");
	};
	thistd.className="c"+modtdnum+"t3 lay"+modtdid+"td2";
	document.getElementById("modtd_3").className="c"+modtdnum+"t4  lay"+modtdid+"td3";
	var thistd=document.getElementById("modtd_4");
	if(bdg_layout[modtdid].td4=="0"){
			movenodefromtd("modtd_4");
			thistd.innerHTML="";
	}
	else{
		createfordag("modtd_4");
	};
	thistd.className="c"+modtdnum+"t5 lay"+modtdid+"td4";
};

function movenodefromtd(tdid){
	var div3=document.getElementById(tdid).getElementsByTagName("div");
	for(var i=0;i<div3.length;i++){
		if(div3[i].getAttribute("rel")=="drag"){
			appendnewmod(div3[i].id,"modtd_0");
		};
	};
};

function createfordag(tdid){
	var div2=document.getElementById(tdid).getElementsByTagName("div");
	var j=0;
	var div3=new Array();
	for(i=0;i<div2.length;i++){
		if(div2[i].getAttribute("rel")=="fordrag"){
			div2[i].parentNode.removeChild(div2[i]);i--;
		};
	};
	var elem=document.createElement("div");
	elem.setAttribute("id","modbottom"+tdid);
	elem.setAttribute("class","mod");
	elem.className="mod";
	elem.setAttribute("rel","fordrag");
	elem.style.width="100%";
	elem.innerHTML="&nbsp;";
	document.getElementById(tdid).appendChild(elem);
};
