function setCookie( name, value, expires, path, domain, secure ) { var today = new Date(); today.setTime( today.getTime() ); if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name+'='+escape( value ) + ( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString() ( ( path ) ? ';path=' + path : '' ) + ( ( domain ) ? ';domain=' + domain : '' ) + ( ( secure ) ? ';secure' : '' ); } function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "=") if (c_start!=-1) { c_start=c_start + c_name.length+1 c_end=document.cookie.indexOf(";",c_start) if (c_end==-1) c_end=document.cookie.length return unescape(document.cookie.substring(c_start,c_end)) } } return "" } function popup(url,id,w,h) { var l = eval(screen.width/2 - w/2); var t = eval(screen.height/2 - h/2); var data = "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=0,directories=no,location=no,width="+w+",height="+h+",left="+l+",top="+t; window.open(url, id, data); } function next_foto(url) { secs = document.forma.secs.options[document.forma.secs.selectedIndex].value; if(secs < 3) secs =3; setCookie('secs',secs,7,'/'); t=setTimeout("next('"+url+"')",secs*1000); } function setSelectedIndex(s, v) { for ( var i = 0; i < s.options.length; i++ ) { if ( s.options[i].value == v ) { s.options[i].selected = true; return; } } } function activate_redirect(url) { secs = getCookie('secs'); if(secs == '') { setSelectedIndex(document.forma.secs,20); t=setTimeout("next('"+url+"')",20*1000); } else { if(secs < 3) secs =3; setSelectedIndex(document.forma.secs,secs); t=setTimeout("next('"+url+"')",secs*1000); } } function next(url) { window.location = url; } var i=0,interval_id,total,default_thumb; function thumbs(id,total_thumbs,default_thumb) { total = total_thumbs-1; i = default_thumb - 1; interval_id = setInterval ( "changeThumbs(\'"+id+"\')", 500 ); } function changeThumbs (id) { i++; img = document.getElementById(id); if(i>total) { img.src = img.src.replace((i)+".jpg", (1)+".jpg"); i=0; } else { img.src = img.src.replace((i)+".jpg", (i+1)+".jpg"); } } function stop_thumbs(id,old) { if(old == undefined) old = 1; img = document.getElementById(id); img.src = img.src.replace((i+1)+".jpg", (old)+".jpg"); i=0; clearInterval(interval_id); }