// validate change password
function changepass(form)
{     
   if (form.newpass.value == "")
   { alert("Invalid password. pass may contain from 5 to 15 characters in size"); form.newpass.focus(); return; }
   
   if (form.newpass2.value == "")
   { alert("Invalid confirm password. pass may contain from 5 to 15 characters in size"); form.newpass2.focus(); return; } 
   
   if (form.newpass.value.length < 5)
   { alert("Error: Invalid password. pass may contain from 5 to 15 characters in size"); form.newpass.focus(); return; }
   
   if (form.newpass.value.length > 15)
   { alert("Error: Invalid password. pass may contain from 5 to 15 characters in size"); form.newpass.focus(); return; }
   
   if (form.newpass.value != form.newpass2.value)
   { alert("The Passwords Dont Match. Try Again"); form.newpass.focus(); return; }
			
    form.submit();

}

// change box imagen
   	var DHTML = (document.getElementById || document.all || document.layers);
	
	function getObj(name)
	{
	  if (document.getElementById)
	  {
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	  }
	  else if (document.all)
	  {
		this.obj = document.all[name];
		this.style = document.all[name].style;
	  }
	  else if (document.layers)
	  {
		this.obj = document.layers[name];
		this.style = document.layers[name];
	  }
	}

	function invi(flag,field)
	{
		if (!DHTML) return;
		var x = new getObj(field);
		x.style.visibility = (flag) ? 'hidden' : 'visible'
	}

	function checkTitle(cont){
		if(document.getElementById('useext'+cont).checked==true){
			invi(1,'torrent'+cont);document.getElementById('torrent'+cont).disabled=true;
			invi(0,'torrent_ext'+cont);document.getElementById('torrent_ext'+cont).disabled=false;
		} else {
			invi(0,'torrent'+cont);document.getElementById('torrent'+cont).disabled=false;
			invi(1,'torrent_ext'+cont);document.getElementById('torrent_ext'+cont).disabled=true;
		}
	}
	
	function checkTitle1(){
		if(document.frm.useextimg.checked==1){
			invi(1,'imagen');document.frm.imagen.disabled=true;
			invi(0,'imagen_ext');document.frm.imagen_ext.disabled=false;
		} else {
			invi(0,'imagen');document.frm.imagen.disabled=false;
			invi(1,'imagen_ext');document.frm.imagen_ext.disabled=true;
		}
	}