// JavaScript Document jQuery().ready(function(flag){ $("#auto").click(function () { var hora=07; if (hora>=20 || hora<=8) { if ($.cookie("fondo")=="ground" || $.cookie("fondo")==null) $("body").css("background","#040809 url(img/estructura/ground_n.jpg) repeat-x"); if ($.cookie("fondo")=="groundV1") $("body").css("background","#071518 url(img/estructura/groundV1_n.jpg) repeat-x"); if ($.cookie("fondo")=="groundV2") $("body").css("background","#072025 url(img/estructura/groundV2_n.jpg) repeat-x"); $("#infoTiempo").attr('src','lang/es/img/botones/noche.gif'); } else { if ($.cookie("fondo")=="ground" || $.cookie("fondo")==null) $("body").css("background","#B0D9F7 url(img/estructura/ground.jpg) repeat-x"); if ($.cookie("fondo")=="groundV1") $("body").css("background","#90CBF5 url(img/estructura/groundV1.jpg) repeat-x"); if ($.cookie("fondo")=="groundV2") $("body").css("background","#6ABCEC url(img/estructura/groundV2.jpg) repeat-x"); $("#infoTiempo").attr('src','lang/es/img/botones/dia.gif'); } $(this).attr('class','botCustoSelected' ); $("#dia").attr('class','botCusto' ); $("#noche").attr('class','botCusto' ); $.cookie("tiempo", 'auto', { path: '/', expires: 30 }); }); $("#dia").click(function () { if ($.cookie("fondo")=="ground" || $.cookie("fondo")==null) $("body").css("background","#B0D9F7 url(img/estructura/ground.jpg) repeat-x"); if ($.cookie("fondo")=="groundV1") $("body").css("background","#90CBF5 url(img/estructura/groundV1.jpg) repeat-x"); if ($.cookie("fondo")=="groundV2") $("body").css("background","#6ABCEC url(img/estructura/groundV2.jpg) repeat-x"); $(this).attr('class','botCustoSelected' ); $("#auto").attr('class','botCusto' ); $("#noche").attr('class','botCusto' ); $.cookie("tiempo", 'dia', { path: '/', expires: 30 }); $("#infoTiempo").attr('src','lang/es/img/botones/dia.gif'); }); $("#noche").click(function () { if ($.cookie("fondo")=="ground" || $.cookie("fondo")==null) $("body").css("background","#040809 url(img/estructura/ground_n.jpg) repeat-x"); if ($.cookie("fondo")=="groundV1") $("body").css("background","#071518 url(img/estructura/groundV1_n.jpg) repeat-x"); if ($.cookie("fondo")=="groundV2") $("body").css("background","#072025 url(img/estructura/groundV2_n.jpg) repeat-x"); $(this).attr('class','botCustoSelected' ); $("#auto").attr('class','botCusto' ); $("#dia").attr('class','botCusto' ); $.cookie("tiempo", 'noche', { path: '/', expires: 30 }); $("#infoTiempo").attr('src','lang/es/img/botones/noche.gif'); }); //-------------------------------------------- $("#hierba").click(function () { if ($.cookie("tiempo")=="auto" || $.cookie("tiempo")==null) { var hora=07; if (hora>=20 || hora<=8) $("body").css("background","#040809 url(img/estructura/ground_n.jpg) repeat-x"); else $("body").css("background","#B0D9F7 url(img/estructura/ground.jpg) repeat-x"); } if ($.cookie("tiempo")=="dia") $("body").css("background","#B0D9F7 url(img/estructura/ground.jpg) repeat-x"); if ($.cookie("tiempo")=="noche") $("body").css("background","#040809 url(img/estructura/ground_n.jpg) repeat-x"); $(this).attr('class','botCustoSelected' ); $("#flores").attr('class','botCusto' ); $("#montanas").attr('class','botCusto' ); $("#f1").attr('src','img/fondo1_diaNoche.jpg'); $("#f1").attr('alt','Fondo hierba - día y noche'); $("#f2").attr('src','img/fondo1_dia.jpg'); $("#f2").attr('alt','Fondo hierba - día'); $("#f3").attr('src','img/fondo1_noche.jpg'); $("#f3").attr('alt','Fondo hierba - noche'); $.cookie("fondo", 'ground', { path: '/', expires: 30 }); }); $("#flores").click(function () { if ($.cookie("tiempo")=="auto" || $.cookie("tiempo")==null) { var hora=07; if (hora>=20 || hora<=8) $("body").css("background","#071518 url(img/estructura/groundV1_n.jpg) repeat-x"); else $("body").css("background","#90CBF5 url(img/estructura/groundV1.jpg) repeat-x"); } if ($.cookie("tiempo")=="dia") $("body").css("background","#90CBF5 url(img/estructura/groundV1.jpg) repeat-x"); if ($.cookie("tiempo")=="noche") $("body").css("background","#071518 url(img/estructura/groundV1_n.jpg) repeat-x"); $(this).attr('class','botCustoSelected' ); $("#hierba").attr('class','botCusto' ); $("#montanas").attr('class','botCusto' ); $("#f1").attr('src','img/fondo2_diaNoche.jpg'); $("#f1").attr('alt','Fondo flores - día y noche'); $("#f2").attr('src','img/fondo2_dia.jpg'); $("#f2").attr('alt','Fondo flores - día'); $("#f3").attr('src','img/fondo2_noche.jpg'); $("#f3").attr('alt','Fondo flores - noche'); $.cookie("fondo", 'groundV1', { path: '/', expires: 30 }); }); $("#montanas").click(function () { if ($.cookie("tiempo")=="auto" || $.cookie("tiempo")==null) { var hora=07; if (hora>=20 || hora<=8) $("body").css("background","#072025 url(img/estructura/groundV2_n.jpg) repeat-x"); else $("body").css("background","#6ABCEC url(img/estructura/groundV2.jpg) repeat-x"); } if ($.cookie("tiempo")=="dia") $("body").css("background","#6ABCEC url(img/estructura/groundV2.jpg) repeat-x"); if ($.cookie("tiempo")=="noche") $("body").css("background","#072025 url(img/estructura/groundV2_n.jpg) repeat-x"); $(this).attr('class','botCustoSelected' ); $("#hierba").attr('class','botCusto' ); $("#flores").attr('class','botCusto' ); $("#f1").attr('src','img/fondo3_diaNoche.jpg'); $("#f1").attr('alt','Fondo montañas - día y noche'); $("#f2").attr('src','img/fondo3_dia.jpg'); $("#f2").attr('alt','Fondo montañas - día'); $("#f3").attr('src','img/fondo3_noche.jpg'); $("#f3").attr('alt','Fondo montañas - noche') $.cookie("fondo", 'groundV2', { path: '/', expires: 30 }); }); });