///---- SITE --------------------------------

function Creditos () {
	win = window.open ('../contacto/creditos.php', "Creditos", "top=80,left=80,width=350,height=250,scrollbars=yes,toolbars=yes,resizable=no");
	win.focus();	
}

function Compra (url) {
	win = window.open ('http://' + url, "Compra", "top=80,left=20,width=780,height=460,scrollbars=yes,toolbars=yes,resizable=yes");
	win.focus();	
}

///---- ADMIN -------------------------------

function EditChart (id) {
	win = window.open ('carta_edit.php?id='+id, "Carta", "top=80,left=80,width=550,height=460,scrollbars=yes");
	win.focus();	
}

function AddChart () {
	win = window.open ('carta_edit.php', "Carta", "top=80,left=80,width=550,height=460,scrollbars=yes");
	win.focus();	
}
////////////////////////////////////////////////////////
function EditDocente (id) {
	win = window.open ('docente_edit.php?id='+id, "Docente", "top=80,left=80,width=550,height=430,scrollbars=yes");
	win.focus();	
}

function AddDocente () {
	win = window.open ('docente_edit.php', "Docente", "top=80,left=80,width=550,height=430,scrollbars=yes");
	win.focus();	
}
////////////////////////////////////////////////////////
function EditArticulo (id) {
	win = window.open ('articulo_edit.php?id='+id, "Articulo", "top=80,left=80,width=650,height=460,scrollbars=yes");
	win.focus();	
}

function AddArticulo () {
	win = window.open ('articulo_edit.php', "Articulo", "top=80,left=80,width=650,height=460,scrollbars=yes");
	win.focus();	
}
////////////////////////////////////////////////////////

function EditArticuloCat (id) {
	win = window.open ('articulo_cat_edit.php?id='+id, "ArticuloCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}

function AddArticuloCat () {
	win = window.open ('articulo_cat_edit.php', "ArticuloCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}

////////////////////////////////////////////////////////

function EditDownload (id) {
	win = window.open ('download_edit.php?id='+id, "Download", "top=80,left=80,width=540,height=330,scrollbars=yes");
	win.focus();	
}

function AddDownload () {
	win = window.open ('download_edit.php', "Download", "top=80,left=80,width=540,height=330,scrollbars=yes");
	win.focus();	
}


////////////////////////////////////////////////////////

function EditDownloadCat (id) {
	win = window.open ('download_cat_edit.php?id='+id, "DownloadCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}

function AddDownloadCat () {
	win = window.open ('download_cat_edit.php', "DownloadCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}

////////////////////////////////////////////////////////

function EditPublicacionCat (id) {
	win = window.open ('publicacion_cat_edit.php?id='+id, "PublicacionCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}

function AddPublicacionCat () {
	win = window.open ('publicacion_cat_edit.php', "PublicacionCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}
////////////////////////////////////////////////////////
function EditNoticia (id) {
	win = window.open ('noticia_edit.php?id='+id, "Noticia", "top=50,left=80,width=550,height=470,scrollbars=yes");
	win.focus();	
}

function AddNoticia () {
	win = window.open ('noticia_edit.php', "Noticia", "top=50,left=80,width=550,height=470,scrollbars=yes");
	win.focus();	
}
////////////////////////////////////////////////////////
function EditNoticiaCat (id) {
	win = window.open ('noticia_cat_edit.php?id='+id, "NoticiaCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}

function AddNoticiaCat () {
	win = window.open ('noticia_cat_edit.php', "NoticiaCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}
////////////////////////////////////////////////////////
function EditCurso (id) {
	win = window.open ('curso_edit.php?id='+id, "Curso", "top=80,left=80,width=500,height=460,scrollbars=yes");
	win.focus();	
}

function AddCurso () {
	win = window.open ('curso_edit.php', "Curso", "top=80,left=80,width=500,height=460,scrollbars=yes");
	win.focus();	
}
////////////////////////////////////////////////////////
function EditCursoCat (id) {
	win = window.open ('curso_cat_edit.php?id='+id, "CursoCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}

function AddCursoCat () {
	win = window.open ('curso_cat_edit.php', "CursoCat", "top=80,left=80,width=500,height=210,scrollbars=yes");
	win.focus();	
}
////////////////////////////////////////////////////////
function EditLink (id) {
	win = window.open ('link_edit.php?id='+id, "Links", "top=80,left=80,width=500,height=310,scrollbars=yes");
	win.focus();	
}

function AddLink () {
	win = window.open ('link_edit.php', "Links", "top=80,left=80,width=500,height=310,scrollbars=yes");
	win.focus();	
}

////////////////////////////////////////////////////////
function AddUserAdmin() {
	win = window.open("usuarioadmin_edit.php","UsrAdmin","top=80,left=80,width=500,height=310,scrollbars=yes");
	win.focus();
}

function EditUserAdmin(id) {
	win = window.open("usuarioadmin_edit.php?id=" + id,"UsrAdmin",",top=80,left=80,width=500,height=310,scrollbars=yes");
	win.focus();
}

////////////////////////////////////////////////////////
function AddUser() {
	win = window.open("usuario_edit.php","Usr","top=80,left=80,width=500,height=310,scrollbars=yes");
	win.focus();
}

function EditUser(id) {
	win = window.open("usuario_edit.php?id=" + id,"Usr",",top=80,left=80,width=500,height=310,scrollbars=yes");
	win.focus();
}

////////////////////////////////////////////////////////


function MostrarEncuesta (id) {
	win = window.open("encuesta_ver.php?id=" + id,"Encuesta","width=560,height=250,top=50,left=150,scrollbars=yes");
	win.focus();
}
////////////////////////////////////////////////////////
function changeImage (img1, img2) {
  img = getElementById(img1); 
  img.src = img2
  //return true;
}

function upload(type, rename, field, field_img, dest){
	window.open("upload.php?dest=" + dest + "&field=" + field + "&field_img=" + field_img + "&rename=" + rename + "&type=" + type,"Upload","width=400,height=300,top=150,left=150");
}

function movepic(img_name,img_src) {
	document[img_name].src=img_src;
}

function borrar(img, field) {
	window.open("upload.php?borrar=" + img + "&field=" + field,"Borrar","width=366,height=300,top=150,left=150");
}



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_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_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];}
}

