// Abrir ventana
function abrirVentana(el_url) { 
//var especificaciones="top=0, left=0, toolbar=yes, location=no, status=yes,menubar=yes,scrollbars=no, resizable=no, width=400,height=400" 
var especificaciones="top=100, left=100, toolbar=no,location=no, status=no,menubar=no,scrollbars=no, resizable=no, width=625,height=450"
var titulo="Mapa"
window.open(el_url,titulo,especificaciones); 
//window.open("http://www.benicalap.com",titulo,especificaciones); 
}


// display decision alert box
function decision(message, url){
	if(confirm(message)) location.href = url;
}



// open browser window
function miOpenPopUp(cod) {
		   var w = 600;
		   var h = 450;
		   var windowName = 'SolicitarInfo'
		   var url = 'programacion/solicitarInfo.php?prod='+cod;
           var winl = (screen.width - w) / 2;
           var wint = (screen.height - h) / 2;
           winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=no,location=no, status=no,menubar=no,scrollbars=no, resizable=no' ;
		   win = window.open(url, windowName, winprops);
           if (parseInt(navigator.appVersion) >= 4) { 
              	win.window.focus(); 
           } 
}
function miOpenPopUpIngles(cod) {
		   var w = 600;
		   var h = 450;
		   var windowName = 'SolicitarInfo'
		   var url = 'programacion/solicitarInfoIngles.php?prod='+cod;
           var winl = (screen.width - w) / 2;
           var wint = (screen.height - h) / 2;
           winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=no,location=no, status=no,menubar=no,scrollbars=no, resizable=no' ;
		   win = window.open(url, windowName, winprops);
           if (parseInt(navigator.appVersion) >= 4) { 
              	win.window.focus(); 
           } 
}

// open browser window
function openPopUp(url, windowName, w, h, scrollbar) {

           var winl = (screen.width - w) / 2;
           var wint = (screen.height - h) / 2;
           winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scrollbar ;
		   win = window.open(url, windowName, winprops);
           if (parseInt(navigator.appVersion) >= 4) { 
              	win.window.focus(); 
           } 
}

function jumpMenu(target,object,restore){ 
  eval(target+".location='"+object.options[object.selectedIndex].value+"'");
  if (restore) object.selectedIndex=0;
}

function findObj(n, d) {
  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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function getImage(imageName)
{
		findObj('img').src = imageName;
}

function submitDoc(formName) { 
  var obj;
 
	if (obj=findObj(formName)!=null) 
	{
		findObj(formName).submit(); 
	}
	else 
	{
		alert('The form you are attempting to submit called \'' + formName + '\' couldn\'t be found. Please make sure the submitDoc function has the correct id and name.');
	}

}