 var prev_val;
 function OrderBy() {
 	if(form1.check1.checked) {
 		for (i=0;i<document.form1.elements.length;i++)
 			if(document.form1.elements[i].name.substr(0,5) == "Orden" ) {
 				document.form1.elements[i].disabled = true;
 			}
 	} else {
 		for (i=0;i<document.form1.elements.length;i++)
 			if(document.form1.elements[i].name.substr(0,5) == "Orden" ) {
 				document.form1.elements[i].disabled = false;
 			}
 	}
 }
 function Setprev_val(val) {
 	prev_val = val;
 }
 
 
 
 function ReOrdenar(obj) {
 real_val = prev_val;
 for (i=0;i<document.form1.elements.length;i++) {
 if(document.form1.elements[i].name.substr(0,5)=="Orden" && Number(document.form1.elements[i].value) >= Number(obj.value) && Number(document.form1.elements[i].value) < Number(real_val) && document.form1.elements[i].name!=obj.name)
   {
    document.form1.elements[i].value = Number(document.form1.elements[i].value) + 1;
    document.form1.elements[i].text=document.form1.elements[i].value;
   }
 }
 for (i=0;i<document.form1.elements.length;i++) {
 if(document.form1.elements[i].name.substr(0,5)=="Orden" && Number(document.form1.elements[i].value) > Number(real_val) && Number(document.form1.elements[i].value) <= Number(obj.value) && document.form1.elements[i].name!=obj.name)
   {
    document.form1.elements[i].value = Number(document.form1.elements[i].value) - 1;
    document.form1.elements[i].text=document.form1.elements[i].value;
   }
 }
 prev_val = obj.value;
 }
 

function admNotaVid(tid) {
	miPopup = window.open('index.php?p=&padmin=admNota&Teo_ID=' + tid +'&esVideo=1','_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=admNota&Teo_ID=' + tid +'&esVideo=1';
 miPopup.opener=self; 
}

function admNota(tid) {
	miPopup = window.open('index.php?p=&padmin=admNota&Teo_ID=' + tid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=admNota&Teo_ID=' + tid;
 miPopup.opener=self; 
}

function editNota(tid,nid) {
	miPopup = window.open('index.php?p=&padmin=editNota&Teo_ID=' + tid + '&Not_ID=' + nid,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editNota&Teo_ID=' + tid + '&Not_ID=' + nid;
 miPopup.opener=self; 
}

function addNota(tid,nid) {
	miPopup = window.open('index.php?p=&padmin=editNota&Teo_ID=' + tid + '&Not_ID=0','_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editNota&Teo_ID=' + tid + '&Not_ID=0';
 miPopup.opener=self; 
}

function buscarNota(tid) {
	miPopup = window.open('index.php?p=&padmin=buscarNota&Teo_ID=' + tid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=500,height=400');
	//location='index.php?p=&padmin=buscarNota&Teo_ID=' + tid;
 miPopup.opener=self; 
}

function admBann(tid) {
	miPopup = window.open('index.php?p=&padmin=admBann&Teo_ID=' + tid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=admBann&Teo_ID=' + tid;
 miPopup.opener=self; 
}

function editBann(tid,bid) {
	miPopup = window.open('index.php?p=&padmin=editBann&Teo_ID=' + tid + '&Ban_ID=' + bid,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editBann&Teo_ID=' + tid + '&Ban_ID=' + bid;
 miPopup.opener=self; 
}

function addBann(tid,bid) {
	miPopup = window.open('index.php?p=&padmin=editBann&Teo_ID=' + tid + '&Ban_ID=0','_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editBann&Teo_ID=' + tid + '&Ban_ID=0';
 miPopup.opener=self; 
}

function admGal(tid) {
	miPopup = window.open('index.php?p=&padmin=admGal&Teo_ID=' + tid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=admGal&Teo_ID=' + tid;
 miPopup.opener=self; 
}

function editGal(tid,bid) {
	miPopup = window.open('index.php?p=&padmin=editGal&Teo_ID=' + tid + '&Not_ID=' + bid,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editGal&Teo_ID=' + tid + '&Not_ID=' + bid;
 miPopup.opener=self; 
}

function addGal(tid,bid) {
	miPopup = window.open('index.php?p=&padmin=editGal&Teo_ID=' + tid + '&Not_ID=0','_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editGal&Teo_ID=' + tid + '&Not_ID=0';
 miPopup.opener=self; 
}

function admBanCat() {
	miPopup = window.open('index.php?p=&padmin=admBanCat' ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=admBanCat';
 miPopup.opener=self; 
}

function editBanCat(cid) {
	miPopup = window.open('index.php?p=&padmin=editBanCat&Bac_ID=' + cid,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editBanCat&Bac_ID=' + cid;
 miPopup.opener=self; 
}

function addBanCat() {
	miPopup = window.open('index.php?p=&padmin=editBanCat&Bac_ID=0','_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editBanCat&Bac_ID=0';
 miPopup.opener=self; 
}

function admBanImg() {
	miPopup = window.open('index.php?p=&padmin=admBanImg' ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=admBanImg';
 miPopup.opener=self; 
}

function editBanImg(fid) {
	miPopup = window.open('index.php?p=&padmin=editBanImg&Img_ID=' + fid,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editBanImg&Img_ID=' + fid;
 miPopup.opener=self; 
}

function editBanImg() {
	miPopup = window.open('index.php?p=&padmin=editBanImg&Img_ID=0','_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin=editBanImg&Img_ID=0';
 miPopup.opener=self; 
}

function popup(pos) {
	window.open('index.php?p=&padmin='+pos,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location='index.php?p=&padmin='+pos;
 //miPopup.opener=self; 
}

function popupbann(url,target,w,h,resize) {
	if(!w) w = 550;
	if(!h) h = 500;
	if(!resize) Sresize = '';
	else Sresize = 'resizable = '+ resize +',';
	miPopup = window.open(url,target,Sresize + 'scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=500');
	//location=url;
 miPopup.opener=self; 
}

function verGaleria(nid,type) {
	miPopup = window.open('index.php?p=galeria-fotos&NotGal='+ type +'&Not_ID=' + nid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=680,height=500');
	//location='index.php?p=galeria-fotos&NotGal='+ type +'&Not_ID=' + nid;
 miPopup.opener=self; 
}

function verVideos(nid) {
	miPopup = window.open('index.php?p=videos&Not_ID=' + nid ,'_self','scrollbars=auto,titlebar=yes,top=30,left=30,width=680,height=600');
	//location='index.php?p=videos&Not_ID=' + nid;
 miPopup.opener=self; 
}

function viewPrint(nid) {
	miPopup = window.open('index.php?p=imprimir&Not_ID=' + nid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=680,height=600');
	//location='index.php?p=imprimir&Not_ID=' + nid;
 miPopup.opener=self; 
}

function sendFriend(nid) {
	miPopup = window.open('index.php?p=enviar&Not_ID=' + nid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=680,height=400');
	//location='index.php?p=enviar&Not_ID=' + nid;
 miPopup.opener=self; 
}

function addObj(tim,tid) {
	miPopup = window.open('index.php?p=&padmin=addObj&Tem_ID_Old=' + tim + '&Ted_ID_Old=' + tid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=250');
	//location='index.php?p=&padmin=addObj&Tem_ID_Old=' + tim + '&Ted_ID_Old=' + tid;
 miPopup.opener=self; 
}

function editObj(tim,tid) {
	miPopup = window.open('index.php?p=&padmin=editObj&Tem_ID_Old=' + tim + '&Ted_ID_Old=' + tid ,'_self','scrollbars=yes,titlebar=yes,top=30,left=30,width=550,height=250');
	//location='index.php?p=&padmin=editObj&Tem_ID_Old=' + tim + '&Ted_ID_Old=' + tid;
 miPopup.opener=self; 
}
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

FUENTE_DEFAULT = 9;
FUENTE_ACTUAL = 9;
FUENTE_MASPEQUENA = 7;
FUENTE_MASGRANDE = 18;

function MasTxt(div) {
FUENTE_ACTUAL = FUENTE_ACTUAL+2;
if (FUENTE_ACTUAL > FUENTE_MASGRANDE) { FUENTE_ACTUAL = FUENTE_MASGRANDE }
var divID = document.getElementById(div);
divID.style.fontSize = FUENTE_ACTUAL+"pt";
}
function MenosTxt(div) {
FUENTE_ACTUAL = FUENTE_ACTUAL-2
if (FUENTE_ACTUAL < FUENTE_MASPEQUENA) { FUENTE_ACTUAL = FUENTE_MASPEQUENA }
var divID = document.getElementById(div);
divID.style.fontSize = FUENTE_ACTUAL+"pt";
}
//-->
