Template:WarNotebook

.hide { display:none }



/* <![CDATA[ */

Array.prototype.indexOf = function( v, b, s ) { for( var i = +b || 0, l = this.length; i < l; i++ ) { if( this[i]===v || s ) if ( this[i]==v ) { return i; } } return -1; };

document.getElementById("prev_fil").style.display = 'none'; document.getElementById("next_fil").style.display = 'none'; document.getElementById("next_ajax").style.display = 'none'; document.getElementById("back_ajax").style.display = 'none';

var months=['January','February','March','April','May','June','July','August','September','October','November','December'];

var adresbase='http://2008.igem.org/Team:Warsaw/Calendar-Main/';

function longmonth(mon) { var long=['May','July','August','October']; if (long.indexOf(mon,0,false)>=0) return true; return false; }

function nextday(date) { date=date.replace(' ','_'); date=date.replace(' ','_'); var date_array=date.split('_'); var d=parseInt(date_array[0]); var m=date_array[1]; //var y="2008"; var y=parseInt(date_array[2]); var next_day;

if (d+1<31) { next_day=(d+1)+'_'+m+'_'+y; } else { var next_month=months[(parseInt(months.indexOf(m,0,false))+1)]; next_day='1'+'_'+next_month+'_'+y; } if (longmonth(m)) if((d+1)==31) { next_day=(d+1)+'_'+m+'_'+y; }

return next_day; }

function prevday(date) { date=date.replace(' ','_'); date=date.replace(' ','_'); var date_array=date.split('_'); var d=parseInt(date_array[0]); var m=date_array[1]; var y="2008"; var prev_day="";

if (d-1>0) { prev_day=(d-1)+'_'+m+'_'+y; } else { var prev_month=months[(parseInt(months.indexOf(m,0,false))-1)]; if (longmonth(prev_month)) { prev_day='31'+'_'+prev_month+'_'+y; } else { prev_day='30'+'_'+prev_month+'_'+y; } }

return prev_day; }

var nazwa=" "; var tokeny=nazwa.split('/'); document.getElementById("zz").innerHTML=tokeny[tokeny.length-1]; var next_adr; var prev_adr;

document.getElementById("next").href=adresbase+nextday(tokeny[tokeny.length-1].replace('/ /g','_')); document.getElementById("back").href=adresbase+prevday(tokeny[tokeny.length-1].replace('/ /g','_'));

var eday="empty"; eday=eday.replace("y","yday");

function next_fil(day) {

var nday=nextday(day);

document.getElementById("next_ajax").innerHTML=document.getElementById("next_ajax").innerHTML+" Call: "+day;

if (window.XMLHttpRequest) { // Mozilla, Safari, Opera ... var req = new XMLHttpRequest; } else if (window.ActiveXObject) { // IE  var req = new ActiveXObject("Microsoft.XMLHTTP"); } var ans; if (window.overrideMimeType) req.overrideMimeType('text/xml'); req.onreadystatechange = function { //początek wewnętrznej funkcji if (req.readyState == 4) { if (req.status == 200) { ans=req.responseText; if(ans.search(eday)>0) next_fil(nday); else {               document.getElementById("next_ajax").innerHTML=document.getElementById("next_ajax").innerHTML+" Hit: "+nday; document.getElementById("next_fil").href=adresbase+nday; document.getElementById("next_fil").style.display = 'block'; document.getElementById("next_progress").style.display = 'none'; }           } }

}; //koniec wewnętrznej funkcji

req.open('GET', adresbase+nday, true); req.send(null); }

next_fil(tokeny[tokeny.length-1].replace('/ /g','_'));

function prev_fil(day) {

var pday=prevday(day);

document.getElementById("back_ajax").innerHTML=document.getElementById("back_ajax").innerHTML+" Call: "+day;

if (window.XMLHttpRequest) { // Mozilla, Safari, Opera ... var req = new XMLHttpRequest; } else if (window.ActiveXObject) { // IE  var req = new ActiveXObject("Microsoft.XMLHTTP"); } var ans; if (window.overrideMimeType) req.overrideMimeType('text/xml'); req.onreadystatechange = function { //początek wewnętrznej funkcji if (req.readyState == 4) { if (req.status == 200) { ans=req.responseText; if(ans.search(eday)>0) prev_fil(pday); else {               document.getElementById("back_ajax").innerHTML=document.getElementById("back_ajax").innerHTML+" Back Hit: "+pday; document.getElementById("prev_fil").href=adresbase+pday; document.getElementById("prev_fil").style.display = 'block'; document.getElementById("prev_progress").style.display = 'none'; }           } }

}; //koniec wewnętrznej funkcji

req.open('GET', adresbase+pday, true); req.send(null); }

prev_fil(tokeny[tokeny.length-1].replace('/ /g','_'));

/* ]]> */