function abrirpopup(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function agregarFavoritos ()
{
   if (navigator.ie5 || navigator.ie6 || navigator.ie4)
   	window.external.AddFavorite("http://www.sanrafael-mendoza.com.ar","SanRafael-Mendoza.com.ar");
   else 
   	window.sidebar.addPanel("SanRafael-Mendoza.com.ar","http://www.sanrafael-mendoza.com.ar","");
} 
//browser check
ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
inum = 0;
function bigSwitch(im,id,alt_src,num)
{	
	inum = inum + num;
	if(ns4){
		document.images['bigPic' + id].src.src = im + "_" + inum + ".jpg";
		if (document.images['bigPic' + id].onerror != "undefined")
		{
			document.images['bigPic' + id].onerror = function()
			{
				document.images['bigPic' + id].src = alt_src;
				inum = 0;
			}
		}
	}
	else{
		document.images['bigPic' + id].src = im + "_" + inum + ".jpg";
		if (document.images['bigPic' + id].onerror != "undefined")
		{			
			document.images['bigPic' + id].onerror = function()
			{
				document.images['bigPic' + id].src = alt_src;
				inum = 0;
			}
		}
	}
}
function aleatorio(inferior,superior)
{	
	numPosibilidades = superior - inferior
	aleat = Math.random() * numPosibilidades
	return Math.round(parseInt(inferior) + aleat)	
}
function submitit(){
var nombre = document.form1.nombre.value
var provincia = document.form1.provincia.value
var pais = document.form1.pais.value
var email = document.form1.email.value
if (nombre==""){
alert("Escribe tu nombre")
document.form1.nombre.focus()
return false;
}
if (email.indexOf('@', 0) == -1 || email.indexOf('.', 0) == -1){ 
alert("No es un e-mail valido!");
document.form1.email.focus()
return false;
}
if (provincia==""){
alert("Escribe tu provincia")
document.form1.provincia.focus()
return false;
}
if (pais==""){
alert("Escribe tu pais")
document.form1.pais.focus()
return false;
}
document.form1.nombre.focus()
return true
                        
}

function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
  
  //para llamar nuevamente a la promo despues de unos 60 segundos
  setTimeout("showPromo(5000)",60000);
}

function showPromo(time)
{
	setTimeout("toggleLayer(\'c12\')",time);
}