//Cal Xim.js ----- Versió 29-11-02 -----

///////////////////////////////////////////////////////
// Elimina la marca de puntos de links en IE         //
//////////////////////////////////////////////////////
function ExplorerFix() {
for (a in document.links) document.links[a].onfocus = document.links[a].blur; }
if (document.all) {
document.onmousedown = ExplorerFix; 
}

//function errorsuppressor(){
//return true
//}
//window.onerror=errorsuppressor

///////////////////////////////////////////////////////
// Funciones de mouse (over-out)                    //
//////////////////////////////////////////////////////

function mouseOver(banner) { self.status=banner; }
function mouseOut() { self.status="Restaurant Cal Xim"; }

//////////////////////////////////////////////////////
// Función para precarga y rollover                 //
//////////////////////////////////////////////////////

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}
function changeImage(layer,imgName,imgObj) {
	if (document.images) {
		if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
		else document.images[imgName].src = eval(imgObj+".src")
	}
}

//////////////////////////////////////////////////////
// Función de ventana nueva para novedad            //
//////////////////////////////////////////////////////
var ahora = new Date();
function getWinNm() {
  var now = new Date();
  var hr = new String(now.getHours());
  var mn = new String(now.getMinutes());
  var sc = new String(now.getSeconds());
  var winNm = hr + mn + sc;
  return winNm;
}

function doFinestraNova(url) {
var altura = screen.height; 
var anchura = screen.width;
var x = 600;
var y = 350;
var posx = (screen.width/2)-300;
var posy = (screen.height/2)-221;
var winNm = getWinNm();
var cgi = 'http://' + url;
var messWin = window.open(cgi,winNm,'resizable=1,toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,width='+x+',height='+y+',screenX='+posx+',screenY='+posy+',left='+posx+',top='+posy+'');
}

//////////////////////////////////////////////////////
// Función de ventana nueva para mail               //
//////////////////////////////////////////////////////

function doMAIL(who,lang){
var altura=screen.height; 
var anchura=screen.width;
var x=600;
var y=400;
var posx=(screen.width/2)-300;
var posy=(screen.height/2)-221;
if((who=='1') && (lang=='cat')) url = 'http://www.calxim.com/mail/ca_restaurant.htm';
if((who=='2') && (lang=='cat')) url = 'http://www.calxim.com/mail/ca_webmaster.htm';
if((who=='1') && (lang=='esp')) url = 'http://www.calxim.com/mail/es_restaurant.htm';
if((who=='2') && (lang=='esp')) url = 'http://www.calxim.com/mail/es_webmaster.htm';
var winNm = getWinNm();
var messWin = window.open(url,winNm,'resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width='+x+',height='+y+',screenX='+posx+',screenY='+posy+',left='+posx+',top='+posy+'');
}


/////////////////////////////////////////////////////////////
// Función de ventana nueva desde formulario p.e.          //
/////////////////////////////////////////////////////////////

function doFORM(url) {
var smallWindow = window.open(url, 'presenta','toolbar=0,directories=0,location=0,status=0,menubars=0,width=600,height=490,resizable=0,scrollbars=1');
	if(smallWindow.moveTo)
		smallWindow.moveTo( (screen.width / 2 - 260), (screen.height / 2 - 280) );
}


/////////////////////////////////////////////////////////////
// Función para mostrar y esconder capas V.4x              //
/////////////////////////////////////////////////////////////

function hide(id,nest){
	if(document.layers){
		if(nest) document.layers[nest].document.layers[id].visibility="hidden"
		else document.layers[id].visibility="hidden"
	}else if(document.all) document.all[id].style.visibility="hidden"
}
function show(id,nest){
	if(document.layers){
		if(nest) document.layers[nest].document.layers[id].visibility="visible"
		else document.layers[id].visibility="visible"
	}else if(document.all) document.all[id].style.visibility="visible"
}


/////////////////////////////////////////////////////////////
// Función para imprimir nuevas ventanas                   //
/////////////////////////////////////////////////////////////

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

function visible(){
		self.focus();
	    setTimeout('visible()',200);
}

/////////////////////////////////////////////////////////////
// Función de modelado colores fondo y contenido           //
/////////////////////////////////////////////////////////////

function modela01(content,peu) {
    parent.content.location.href = content;
    parent.peu.location.href = peu;
}

function modela02(color,content) {
	parent.res01.location.href = "blanco" + color + ".html";
	parent.res02.location.href = "blanco" + color + ".html";
	parent.res03.location.href = "blanco" + color + ".html";
	parent.res04.location.href = "blanco" + color + ".html";
	document.location.href = content;
	parent.res05.location.href = "dcha" + color + ".html";
	parent.res06.location.href = "blanco" + color + ".html";
    parent.peu.location.href = "bottom" + color + ".html";
	parent.res07.location.href = "blanco" + color + ".html";
}

function modela02B(color) {
	parent.res01.location.href = "blanco" + color + ".html";
	parent.res02.location.href = "blanco" + color + ".html";
	parent.res03.location.href = "blanco" + color + ".html";
	parent.res04.location.href = "blanco" + color + ".html";
	parent.res05.location.href = "dcha" + color + ".html";
	parent.res06.location.href = "blanco" + color + ".html";
    parent.peu.location.href = "bottom" + color + ".html";
	parent.res07.location.href = "blanco" + color + ".html";
}

function modela03(color,content) {
	parent.res01.location.href = "../blanco" + color + ".html";
	parent.res02.location.href = "../blanco" + color + ".html";
	parent.res03.location.href = "../blanco" + color + ".html";
	parent.res04.location.href = "../blanco" + color + ".html";
	document.location.href = content;
	parent.res05.location.href = "../dcha" + color + ".html";
	parent.res06.location.href = "../blanco" + color + ".html";
    parent.peu.location.href = "../bottom" + color + ".html";
	parent.res07.location.href = "../blanco" + color + ".html";
}

function modela03B(color) {
	parent.res01.location.href = "../blanco" + color + ".html";
	parent.res02.location.href = "../blanco" + color + ".html";
	parent.res03.location.href = "../blanco" + color + ".html";
	parent.res04.location.href = "../blanco" + color + ".html";
	parent.res05.location.href = "../dcha" + color + ".html";
	parent.res06.location.href = "../blanco" + color + ".html";
    parent.peu.location.href = "../bottom" + color + ".html";
	parent.res07.location.href = "../blanco" + color + ".html";
}

var win = null;
function openIMP(url,nomfin,w,h,scroller){
esquerra = (screen.width) ? (screen.width-w)/2 : 0;
tope = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+tope+',left='+esquerra+',scrollbars='+scroller+',resizable=no'
win = window.open(url,nomfin,settings)
}

function openFOTO(url,nomfin,w,h){
esquerra = (screen.width) ? (screen.width-w)/2 : 0;
tope = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+tope+',left='+esquerra+',scrollbars=no,resizable=no'
win = window.open(url,nomfin,settings)
}

