var cur_format='all';
var cur_type='title';
var cur_page=0;
var cur_mxp=0;
var cur_authorid=0;
var musicid=0;
var musica='nothing special';
var musict='';
var append="&pl=op";
var callbackison=false;
var liveconnectTimer;
var newopt2=0;
var newopt3=0;
var keyl="";
var plistid=0;
var plindex=0;
var uploadflag=false;
var plfirstitem=0;
var cur_list=0;
var cur_filter=0;
var cur_order=0;
var lastsauthor="";

function gosubmittune()
{
    jahpost('submit.php','dmain','last='+encodeURIComponent(lastsauthor));   
}

function updauthor(autid)
{
    var comment=document.getElementById("authcomment").value;
    var web=document.getElementById("authurl").value;
    jahpost('addauthor.php','sendlink','id='+encodeURIComponent(autid)+'&comment='+encodeURIComponent(comment)+'&web='+encodeURIComponent(web)+'&action=docomment',9);
}

function switchList()
{
    cur_list=document.getElementById("cf1").value;
    cur_filter=document.getElementById("cf2").value;
    cur_order=document.getElementById("cf3").value;
    if (cur_list==1) {
        if ((cur_filter==12) || (cur_filter==13)) cur_filter=0;
        if ((cur_order==4) || (cur_order==5)) cur_order=0;
    }
    if (cur_list!=11) { document.getElementById('searchbox').value="<enter search string>"; }
    cur_authorid=0;
    cur_page=0;
    dosearch();
}

function playtune(path)
{
	document.getElementById("playermain").playzik(path);
}

function spawnforum()
{
    document.getElementById('dmain').innerHTML='<iframe name="minibb" id="minibb" scrolling="auto" frameborder="0" marginwidth="0" marginheight="0" hspace="0" vspace="0" height="504" width="598" src="minibb/index.php">&nbsp;</iframe>';
}

function doAction(actionid,zeid)
{
    if (actionid==1) jahpost('admin.php','dmain','action=edit&id='+musicid,0);
    if (actionid==2) window.open("download.php?id="+musicid,"_self","toolbar=no");
    if (actionid==3) jahpost('sendlink.php','sendlink','id='+musicid,0);
    if (actionid==4) jahpost('playlist.php','pldiv','a=add&id='+musicid,0);
}

function openCom(zemusicid,divnum)
{
    jahpost('comments.php','mcom'+divnum,'id='+zemusicid+'&d='+divnum);
    document.getElementById("mcom"+divnum).style.display="block";
}

function uploadfinished()
{
    uploadflag=false;
    document.getElementById('uploadbar').style.visibility = "hidden";
}

function postCom(musicid,divnum)
{
    content=document.getElementById('comment'+divnum).value;
    jahpost('comments.php','mcom'+divnum,'id='+musicid+'&d='+divnum+'&content='+encodeURIComponent(content));
    document.getElementById("mcom"+divnum).style.display="block";
}

function trycallback()
{
	if (callbackison)
		return;
	callbackison=true;
	var liveconnectislive=document.getElementById("playermain").appletCallback();
	if (liveconnectislive==1)
	{
		liveconnectTimer=0;
	}
	callbackison=false;
}
function initCallback()
{
 setTimeout("trycallback()", 100);
}
function sendmail(subject)
{
	var email='mailto:cont';
	email=email+'act@pl';
	email=email+'opbox.net';
	window.frames.uploadfrm.location.href=email+subject;
}
function killsendlink() {
	document.getElementById('sendlink').innerHTML='';
}

function addauthor(musicid) {
	authname=document.getElementById('addauthorname').value;
	jahpost('admin.php','dmain','action=addauthor&authorname='+encodeURIComponent(authname)+'&id='+musicid,0);
	killsendlink();
}

function submittune(subtype) {
    if (uploadflag)
    {
        alert('A file is beeing transfered. please wait a bit before submitting a new one');
        return;
    }
    uploadflag=true;
	document.getElementById('uploadbar').style.visibility = "visible";
	jahpost('submit.php','dmain','action='+subtype,0);
	lastsauthor=document.getElementById('subtuneauthor').value;
	document.submitform.submit();
}

function updatetuneinfo(tunetitle,duration)
{
	document.getElementById('duration').value=tunetitle;
	document.getElementById('title').value=duration;
	var getmid=document.getElementById('hiddenmid').innerHTML;
}

function plplayzmain(zzid,zzplid)
{
	plistid=zzid;
	musica=document.getElementById('adp'+plistid).innerHTML;
	musict=document.getElementById('mdp'+plistid).innerHTML;
	document.getElementById('tuneoptname').innerHTML=document.getElementById('adp'+plistid).innerHTML+" - "+document.getElementById('mdp'+plistid).innerHTML;
	document.getElementById('tuneopt').style.display="block";
	plplayz(zzid,zzplid);
}

function plplayz(id,plid)
{
	document.getElementById('playermain').setPLindex(plid);
	plindex=plid;
	musica=document.getElementById('adp'+id).innerHTML;
	musict=document.getElementById('mdp'+id).innerHTML;
	document.getElementById('advote').innerHTML=musica;
	document.getElementById('mdvote').innerHTML=musict;
	document.title="Plopbox> "+musica+" - "+musict;
	document.getElementById('votem1').style.display='none';
	document.getElementById('votem2').style.display='block';
	document.getElementById('votem3').style.display='block';
	document.getElementById('votem4').style.display='none';
	musicid=id;
    jahpostPLupd('playlist.php','pldiv','a=pl&plid='+plid,0);
	document.getElementById("playermain").playzik('getfile.php?id='+id);
    refreshcurtune();
}

function addtopl(mid)
{
	jahpost('playlist.php','pldiv','a=add&id='+mid,0);
}

function pldel()
{
	jahpost('playlist.php','pldiv','a=del&id='+plistid,7);
}
function pladd()
{
	jahpost('playlist.php','pldiv','a=add&id='+plistid,0);
}
function plgetlink() 
{
	jahpost('sendlink.php','sendlink','id='+plistid,0);	
}
function pldlitem() 
{
	document.location.href="download.php?id="+plistid;	
}

function updSongInfo(appmusicid,pl_index)
{
    plindex=pl_index;
    musicid=appmusicid;
	var poststr = "a=upd&m="+musicid;
    refreshcurtune();
	jahpostVote("vote.php","votediv",poststr);
}

function playz(path,id) {
	if (path.indexOf('calc=true')!=-1) { document.getElementById('duration').value="* Please wait *"; }
	musica=document.getElementById('ad'+id).innerHTML;
	musict=document.getElementById('md'+id).innerHTML;
	document.title="Plopbox> "+musica+" - "+musict;

	document.getElementById('advote').innerHTML=document.getElementById('ad'+id).innerHTML;
	document.getElementById('mdvote').innerHTML=document.getElementById('md'+id).innerHTML;
	document.getElementById('votem1').style.display='none';
	document.getElementById('votem2').style.display='block';
	document.getElementById('votem3').style.display='block';
	document.getElementById('votem4').style.display='none';
	musicid=id;
	document.getElementById("playermain").playzik(path);
    refreshcurtune();
}

function showallauthors()
{
	document.getElementById('searchbox').value='';
	s_type('title');
	cur_list=0;
	dosearch();
}

function dovote(note)
{
	var poststr = "a=vote&m="+musicid+"&n="+note;
	jahpost("vote.php","votediv",poststr,0);
}

function goauthor(authorid)
{
	s_type('authorid');
	cur_authorid=authorid;
	cur_list=10;
    dosearch();
}

function goplaylist()
{
	var poststr = "sl=999&sf=0&so=0&p=0&mxp=0";
	jahpost("list.php","dmain",poststr,1);
}

function setplaylist()
{
    jahpost('playlist.php','sendlink','a=newpl&sl='+cur_list+'&sf='+cur_filter+'&so='+cur_order+'&optidx=0',10);
}

function dospsearch()
{
    dosearch();
}

var aletter="a";
function authletter(letter)
{
    aletter=letter;
    dosearch();
}

function dosearch() {
	searchstring="";
	if (cur_type=='title') 
	{
		var searchstring=document.getElementById('searchbox').value;
		if (searchstring.indexOf('enter search')!=-1) { searchstring=""; }
		if (searchstring.length<2) { searchstring="" } else { if (cur_list!=11) { cur_filter=0; cur_order=0; }  };
	}
	if (cur_type=='author') 
	{
		var searchstring=document.getElementById('searchbox').value;
		if (searchstring.indexOf('enter search')!=-1) { searchstring=""; }
		if (searchstring.length<2) { searchstring="" } else { cur_list=13; };
	}
	if (cur_list==10) { searchstring=cur_authorid; }
	if (cur_list==12) { searchstring=aletter; }
	var poststr = "sl=" + encodeURI(cur_list) + "&sf=" + encodeURIComponent(cur_filter) + "&so=" + encodeURIComponent(cur_order) + "&p=" + encodeURIComponent(cur_page) + "&mxp=" + encodeURIComponent(cur_mxp)+"&ss="+encodeURIComponent(searchstring);
	
	poststr=poststr+append;
	append="";
	jahpost("list.php","dmain",poststr,1);
}

function dologin() {
	var login=document.getElementById('loginfield').value;
	var passw=document.getElementById('passwfield').value;
	var poststr = "l=" + encodeURIComponent(login) + "&p=" + encodeURIComponent(passw) + "&a=login";
	jahpost("login.php","logbox",poststr,2);
}

function dodisconnect() {
	EffaceCookie("ploplog");
	EffaceCookie("ploppwd");
	jahpost("login.php","logbox","a=disc",2);
}

function doupdateprofile() {
	var f1=document.getElementById('opt1').value;
	var f2=document.getElementById('firstname').value;
	var f3=document.getElementById('lastname').value;
	var f4=document.getElementById('pass1').value;
	var f5=document.getElementById('pass2').value;
	var f6=document.getElementById('email').value;
	var f7=document.getElementById('country').value;
	var f8=document.getElementById('action').value;
	var f9=document.getElementById('opt2').value;
	var f10=document.getElementById('opt3').value;
	var poststr = "opt2=" + encodeURIComponent(f9) + "&opt3=" + encodeURIComponent(f10) + "&opt1=" + encodeURIComponent(f1) + "&firstname=" + encodeURIComponent(f2) + "&lastname=" + encodeURIComponent(f3) + "&pass1=" + encodeURIComponent(f4) + "&pass2=" + encodeURIComponent(f5) + "&email=" + encodeURIComponent(f6) + "&country=" + encodeURIComponent(f7) + "&action=" + encodeURIComponent(f8);
	jahpost("profile.php","dmain",poststr,0);
}

function dologforayear() {
	var f1=document.getElementById('pass3').value;
	var f2=document.getElementById('login3').value;
	date=new Date;
	date.setFullYear(date.getFullYear()+1);
	EcrireCookie("ploppwd", f1, date);
	EcrireCookie("ploplog", f2, date);
	dosearch();
}

function EcrireCookie(nom, valeur)
{
	var argv=EcrireCookie.arguments;
	var argc=EcrireCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=nom+"="+escape(valeur)+
	((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((path==null) ? "" : ("; path="+path))+
	((domain==null) ? "" : ("; domain="+domain))+
	((secure==true) ? "; secure" : "");
}
function getCookieVal(offset)
{
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1) endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function LireCookie(nom)
{
	var arg=nom+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen)
	{
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
		i=document.cookie.indexOf(" ",i)+1;
		if (i==0) break;
	}
	return null;
}
function EffaceCookie(nom)
{
	date=new Date;
	date.setFullYear(date.getFullYear()-1);
	EcrireCookie(nom,null,date);
}

function doownpl()
{
	var poststr = "action=changepl&opt2=1&opt3=0";
	newopt2="1";
	newopt3="0";
	jahpost("list.php","dmain",poststr,6);
}

function doupdateplsettings(newpl) 
{
	var poststr = "action=changepl&opt2=" + encodeURIComponent(newpl);
	newopt2=encodeURIComponent(newpl);
	jahpost("plmanager.php","dmain",poststr,0);
}
function doupdatefilter(newfilter) 
{
	var poststr = "action=changefilter&opt3=" + encodeURIComponent(newfilter);
	newopt3=encodeURIComponent(newfilter);
	jahpost("plmanager.php","dmain",poststr,0);
}

function doregister() {
	var f1=document.getElementById('login').value;
	var f2=document.getElementById('firstname').value;
	var f3=document.getElementById('lastname').value;
	var f4=document.getElementById('pass1').value;
	var f5=document.getElementById('pass2').value;
	var f6=document.getElementById('email').value;
	var f7=document.getElementById('country').value;
	var f8=document.getElementById('action').value;
	var poststr = "login=" + encodeURIComponent(f1) + "&firstname=" + encodeURIComponent(f2) + "&lastname=" + encodeURIComponent(f3) + "&pass1=" + encodeURIComponent(f4) + "&pass2=" + encodeURIComponent(f5) + "&email=" + encodeURIComponent(f6) + "&country=" + encodeURIComponent(f7) + "&action=" + encodeURIComponent(f8);
	jahpost("register.php","dmain",poststr,0);
}

var lastedit=0;
function updatetune(pproc) {
	var f1=document.getElementById('title').value;
	var f2=document.getElementById('author').value;
	var f3=document.getElementById('duration').value;
	var f4=document.getElementById('statustune').value;
	var f5=document.getElementById('musicid').value;
    lastedit=f5;
	var poststr = "action=update&title=" + encodeURIComponent(f1) + "&id=" + encodeURIComponent(f5) + "&author=" + encodeURIComponent(f2) + "&duration=" + encodeURIComponent(f3) + "&statustune=" + encodeURIComponent(f4);
	jahpost("admin.php","dmain",poststr,pproc);
}

function validatetune(tuneid) {
	var poststr = "action=validate&id=" + encodeURIComponent(tuneid);
	jahpost("admin.php","dmain",poststr,5);
}
function rejecttune(tuneid) {
	var poststr = "action=delete&id=" + encodeURIComponent(tuneid);
	jahpost("admin.php","dmain",poststr,5);
}

function gopage(newpage)
{
	if (newpage<0)
		return;
	if (cur_page==newpage)
		return;		
	cur_page=newpage;
	dosearch();
}

function checkEnter(e){
	
	
}

function searchboxsubmit(evt) {
	if(document.all)evt = event;
  var characterCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
  if (characterCode == 13)
  {
		cur_page=0;
		dosearch();
		return false;
	}
  else
    return true;
}

function loginsubmit(evt) {
	if(document.all)evt = event;
  var characterCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
  if (characterCode == 13)
  {
		dologin();
		return false;
	}
  else
    return true;
}

function onelinersubmit(evt) {
	if(document.all)evt = event;
  var characterCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
  if (characterCode == 13)
  {
		var content=document.getElementById('onltext').value;
		if (content=='')
			return true;
		document.getElementById('onljp').style.display='block';
		document.getElementById('onllp').style.display='none';
		document.getElementById('onljp1').innerHTML=content;
		var poststr = "t=" + encodeURIComponent(content);
		document.getElementById('onltext').value="";
		jahpostONL("oneliner.php","oneliner",poststr,0);
		return false;
	}
  else
    return true;
}

function searchorder(neworder)
{
	if (cur_order==neworder) { return; }
	cur_order=neworder;
	cur_page=0;
	dosearch();
}

function s_type(seltype) {
		cur_type=seltype;
		cur_page=0;
   	document.getElementById('st_title').className='sel2z'; 
   	document.getElementById('st_author').className='sel2z'; 
	if (seltype=='authorid') return;
   	document.getElementById('st_'+seltype).className='sel2zb'; 
}

function jah(url,ztarget) {
    document.getElementById('loadtext').innerHTML = "LOADING...";
    document.getElementById('loadbar').style.visibility = "visible";

    // native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {jahDone(ztarget,0);};
        req.open("GET", url, true);
        req.send(null);
    // IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = function() {jahDone(ztarget,0);};
            req.open("GET", url, true);
            req.send();
        }
    }
}

function jahpost(url,ztarget,params,postaction) {
    document.getElementById('loadtext').innerHTML = "LOADING...";
    if (ztarget!="oneliner")
    {
    	document.getElementById('loadbar').style.visibility = "visible";
    }
    // native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {jahDone(ztarget,postaction);};
        req.open("POST", url, true);
				req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				req.setRequestHeader("Content-length", params.length);
				req.setRequestHeader("Connection", "close");
				req.send(params);
    // IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = function() {jahDone(ztarget,postaction);};
            req.open("POST", url, true);
						req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
						req.setRequestHeader("Content-length", params.length);
						req.setRequestHeader("Connection", "close");
						req.send(params);
        }
    }
}

function jahpostVote(url,ztarget,params) {
    // native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req3 = new XMLHttpRequest();
        req3.onreadystatechange = function() {jahDoneVote(ztarget);};
        req3.open("POST", url, true);
				req3.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				req3.setRequestHeader("Content-length", params.length);
				req3.setRequestHeader("Connection", "close");
				req3.send(params);
    // IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req3 = new ActiveXObject("Microsoft.XMLHTTP");
        if (req3) {
            req3.onreadystatechange = function() {jahDoneVote(ztarget);};
            req3.open("POST", url, true);
						req3.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
						req3.setRequestHeader("Content-length", params.length);
						req3.setRequestHeader("Connection", "close");
						req3.send(params);
        }
    }
}
function jahpostPLupd(url,ztarget,params) {
    // native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req4 = new XMLHttpRequest();
        req4.onreadystatechange = function() {jahDonePLupd(ztarget);};
        req4.open("POST", url, true);
				req4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				req4.setRequestHeader("Content-length", params.length);
				req4.setRequestHeader("Connection", "close");
				req4.send(params);
    // IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req4 = new ActiveXObject("Microsoft.XMLHTTP");
        if (req4) {
            req4.onreadystatechange = function() {jahDonePLupd(ztarget);};
            req4.open("POST", url, true);
						req4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
						req4.setRequestHeader("Content-length", params.length);
						req4.setRequestHeader("Connection", "close");
						req4.send(params);
        }
    }
}

function jahDone(ztarget,postprocess) {
    // only if req is "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            results = req.responseText;
            document.getElementById(ztarget).innerHTML = results;
            document.getElementById('loadbar').style.visibility = "hidden";
            if (postprocess==1) {
							if (cur_page==0)
								cur_mxp=document.getElementById('mxp').value;
						        }
            if (postprocess==2) {
								jahpost("vote.php","votediv","a=0",4);
						        }
            if (postprocess==4) {
								jahpost("playlist.php","pldiv","a=0",5);
						        }
            if (postprocess==5) {
								dosearch();
						        }
            if (postprocess==6) {
            		            dosearch();
								document.getElementById("playermain").playzik('getfile.php?playlist=true&id=1&opt2' + encodeURI(newopt2) + '&opt3=' + encodeURI(newopt3));
						        }
            if (postprocess==7) {
								dosearch();
						        }
            if (postprocess==8) {
								jahpost('admin.php','dmain','action=edit&id='+musicid,0);
						        }
            if (postprocess==9) {
	                            killsendlink();
                                switchList();
						        }
            if (postprocess==10) {
                                plfirstitem=document.getElementById('newplid').innerHTML;
                                plplayz(plfirstitem,1)
						        }
            if (postprocess==11) {
                	            getmid=document.getElementById('hiddenmid').innerHTML;
                                playz('getfile.php?calc=true&id='+getmid,getmid);
						        }
            if (ztarget=='dmain')
            {
                refreshcurtune();
            }
        } else {
            document.getElementById('loadtext').innerHTML = "ERROR!";
                req.statusText;
        }
    }
}

var lastlistdivid=0;
function refreshcurtune()
{
    if (document.getElementById(lastlistdivid)!=null)
        document.getElementById(lastlistdivid).style.background="";
    var listdivid='li'+musicid;
    if (document.getElementById(listdivid)!=null)
        document.getElementById(listdivid).style.background="#fce2e1";
    lastlistdivid=listdivid;
}

var adcount=0;
function onelinerKA() {
    adcount++;
    if ((adcount%240)==0)
        document.getElementById('diva').src="c/extra.php?k="+adcount;
	jahpostONL("oneliner.php","oneliner","t=KA&lsa="+encodeURIComponent(musica)+"&lst="+encodeURIComponent(musict)+"&lsid="+musicid,0);
}

function jahpostONL(url,ztarget2,params,postaction) {
    // native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req2 = new XMLHttpRequest();
        req2.onreadystatechange = function() {jahDoneONL(ztarget2,postaction);};
        req2.open("POST", url, true);
				req2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				req2.setRequestHeader("Content-length", params.length);
				req2.setRequestHeader("Connection", "close");
				req2.send(params);
    // IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req2 = new ActiveXObject("Microsoft.XMLHTTP");
        if (req2) {
            req2.onreadystatechange = function() {jahDoneONL(ztarget2,postaction);};
            req2.open("POST", url, true);
						req2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
						req2.setRequestHeader("Content-length", params.length);
						req2.setRequestHeader("Connection", "close");
						req2.send(params);
        }
    }
}

function jahDoneONL(ztarget2,postprocess) {
    // only if req is "loaded"
    if (req2.readyState == 4) {
        // only if "OK"
        if (req2.status == 200) {
            results = req2.responseText;
            document.getElementById(ztarget2).innerHTML = results;
        } else {
            req2.statusText;
        }
    }
}

function jahDoneVote(ztarget2) {
    // only if req is "loaded"
    if (req3.readyState == 4) {
        // only if "OK"
        if (req3.status == 200) {
            results = req3.responseText;
            document.getElementById(ztarget2).innerHTML = results;
        	musica=document.getElementById('advote').innerHTML;
        	musict=document.getElementById('mdvote').innerHTML;
	        document.title="Plopbox> "+musica+" - "+musict;
		    jahpostPLupd('playlist.php','pldiv','a=pl&plid='+plindex,0);
        } else {
            req3.statusText;
        }
    }
}

function jahDonePLupd(ztarget2) {
    // only if req is "loaded"
    if (req4.readyState == 4) {
        // only if "OK"
        if (req4.status == 200) {
            results = req4.responseText;
            document.getElementById(ztarget2).innerHTML = results;
        } else {
            req4.statusText;
        }
    }
}
function clrdmain()
{
    document.getElementById('dmain').innerHTML="&nbsp;";
}


