function WM_preloadImages() {

  if (document.images) {
    if (typeof(document.WM) == 'undefined'){
      document.WM = new Object();
    }
    document.WM.loadedImages = new Array();
    // Loop through all the arguments.
    var argLength = WM_preloadImages.arguments.length;
    for(arg=0;arg<argLength;arg++) {
      // For each arg, create a new image.
      document.WM.loadedImages[arg] = new Image();
      // Then set the source of that image to the current argument.
      document.WM.loadedImages[arg].src = WM_preloadImages.arguments[arg];
    }
  }	
}

function getData() {
	var hora, minut, mes, dia, dia_setmana, any, segon;
	var data
	var browser = navigator.appName.substring(0,8);
    var version = parseInt(navigator.appVersion);
		
	data = "";
	var avui = new Date();
	dia_setmana = avui.getDay();
	mes = avui.getMonth();
	dia = avui.getDate();
	any = avui.getYear();
	
	avui = null;
	
if (dia_setmana==0) dia_setmana = "Diumenge";
    else if (dia_setmana==1) dia_setmana = "Dilluns";
    else if (dia_setmana==2) dia_setmana = "Dimarts";
    else if (dia_setmana==3) dia_setmana = "Dimecres";
    else if (dia_setmana==4) dia_setmana = "Dijous";
    else if (dia_setmana==5) dia_setmana = "Divendres";
    else if (dia_setmana==6) dia_setmana = "Dissabte";

    if(mes==0) mesn ="Gener";
    if(mes==1) mesn ="Febrer"; 
    if(mes==2) mesn ="Març"; 
    if(mes==3) mesn ="Abril";
    if(mes==4) mesn ="Maig"; 
    if(mes==5) mesn ="Juny";
    if(mes==6) mesn ="Juliol";
    if(mes==7) mesn ="Agost";
    if(mes==8) mesn ="Setembre"; 
    if(mes==9) mesn ="Octubre"; 
    if(mes==10) mesn ="Novembre";
    if(mes==11) mesn ="Desembre";

    if (mes==3 || mes==7 || mes==9) inicial = " d' "
    else inicial = " de ";

    if  (version < 4)
        segle = 1900 + any;
    else
        if  (any < 100)
            segle = 1900 + any;
        else
            segle = any;

    data += dia_setmana+ "  "+dia+inicial+mesn+" de "+segle;

    data += "&nbsp;&nbsp;";	

    return(data);
}

function canvia_banner() {
BanActual++
if (BanActual>2) {
	BanActual = 1	
}	
document.all.banner.src = 'banner/banner' + BanActual + '.gif'	
switch (BanActual) {
	case 1:
		document.all.link_banner.href = 'javascript:load(\'extra/publicitat/publicitat.asp\')';
		break;
	case 2:
		document.all.link_banner.href = 'javascript:obrir(\'http://www.sol.es\')';
		break;			
}
setTimeout('canvia_banner()',8000); 
}

function canvia_foto() {
	var num

	num = 1 + Math.floor(Math.random() * 10);
	document.foto.src = 'cat/imatges_principal/imatge' + num + '.jpg';
}

function addbookmark(){
if (document.all)
window.external.AddFavorite("http://www.stafe.net","Pàgina web de Santa Fe del Penedès")
}

function load(page) {
	parent.web.location = page
//	parent.web.location.replace(page)
}

function obrir(page, name, height, width) {
	open(page, name, "toolbar=no,menubar=no,status=no,location=no,scrollbars=no,resizable=no,height=" + height + ",width=" + width +"")
}


