  Sortable.create("firstlist",
     {dropOnEmpty:true,containment:["firstlist","secondlist","topdrop"],constraint:false,tag:"div"});
   Sortable.create("secondlist",
     {dropOnEmpty:true,handle:'handle',containment:["firstlist","secondlist","topdrop"],constraint:false,tag:"div"});
   Sortable.create("topdrop",
     {dropOnEmpty:true,handle:'handle',containment:["firstlist","secondlist","topdrop"],constraint:false,tag:"div",onUpdate:function(){writeResult()}});
     
     
   
     exc = 0;
     
     function writeResult(){
     
		var elem;
 	
	 elem = Sortable.findElements($('topdrop'),{tag:"div"});

 	 if (elem == null) {exc=0; $('secondlist').innerHTML = ""; return ;}
 //	 if ((elem.length == 2) && (exc==0) ) {alert("Sorry!! You can Drop Only One!! Back All Items"); $('secondlist').innerHTML = "";}
	// if((elem.length==1) && (exc==0))
//	 {
	
			//url = $('topdrop').childNodes.item(0).name+".html";
			url = $('topdrop').firstChild.name+".html";
			
			var myAjax = new Ajax.Updater(
					'secondlist',
					url,
					{method: 'get', success: suc_r, onFailure: 'err_r'});				
//			return ;
//	 }
	 exc += 1;	
	 
	 	if($('topdrop').childNodes.length > 1)
	 	{
	 		$('firstlist').appendChild($('topdrop').lastChild);
	 	}
	 
}
	 
	 function drag()
	{
		$('topdrop').innerHTML = "";
	
	}



function write(fname)
{

	//url = fname+".html";
		//	url = $('topdrop').firstChild.name+".html";
			
			var myAjax = new Ajax.Updater(
					'secondlist',
					fname,
					{method: 'get', success: suc_r, onFailure: 'err_r'});				

}


	 function suc_r()
{
alert("success");
//alert($('secondlist').childNodes.item(0).id );
//		$('result').innerHTML = myAjax.responseTEXT;
			
}

function err_r()
{
alert("miss");
}

