var maxiwin="width="+(screen.width-10)+",height="+(screen.height-50)+",scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes";

/*if(document.referrer==''){
 open('/','_blank',maxiwin);
}
*/
function fullscreen() {
window.moveTo(0, 0)
if(navigator.appName=="Netscape") {
window.outerWidth = screen.availWidth;
window.outerHeight = screen.availHeight;
}
else
{
window.resizeTo(screen.availWidth,
screen.availHeight);
}
}


var host="http://www.eyesonsky.com/", cn=0, cn2=0, pnb=40, ou=0, c, img;
function ini(){ c=""; img='vueprev'; url=host+'img/prevcam'; }

function chi(p){ document.images[img].src=url+p+".jpg"; }

function dec(a){
ini();if(a==1){cn+=-1; c=cn;if(cn<0){cn=pnb; c=pnb;}if(cn==0) c="";}else{
cn2+=-1; c=cn2; img+='z'; url+='z';if(cn2<0){cn2=pnb; c=pnb;}if(cn2==0) c="";}if(cn2<10 && cn2!=0 && a==2) c="0"+c;chi(c);}

function inc(a){ini();if(a==1){cn+=1;if(cn>=(pnb+1)) cn=0;else c=cn;}else{cn2+=1; img+='z'; url+='z';
if(cn2>=(pnb+1)) cn2=0;else c=cn2;}if(cn2<10 && cn2!=0 && a==2) c="0"+c;chi(c);}

function va(a,ou){ini();if(a==1) cn=ou;else{ cn2=ou; img+='z'; url+='z'; }if(ou==0) ou="";chi(ou);}

function openmeteo(v){if(v==1){myWin=open(host+"curtps.htm", "m","scrollbars,width=600,height=220,status=no,toolbar=no,menubar=no");}
else{myWin=open("http://www.meteoschweiz.ch/de/wetter/aktuell/wind.gif", "n","width=630,height=450,status=no,toolbar=no,menubar=no");}}

function ow(f,w,h){
 var mi=open(f,'_blank','width='+w+',height='+h+'status=no,toolbar=no,menubar=no,scrollbars=1'); mi.focus();
}
function openall(url){
 w=840;h=400;
 leftp=(screen.width)?(screen.width-w)/2:100;topp=(screen.height)?(screen.height-h)/2:100;
 settings='width='+w+',height='+h+',top='+topp+',left='+leftp+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
 var mi=open(url, 'm',settings); mi.focus();
}
function openmig(url,w,h){
 iw=w; w = w+20;
 ih=h; h = h+20;
 leftp=(screen.width)?(screen.width-w)/2:100;
 topp=(screen.height)?((screen.height-h)/2)-30:100;

 if(w>screen.width){ w=screen.width-10; leftp=0;}
 if(h>screen.height){ h=screen.height-55;  topp=0;}

 settings='width='+w+',height='+h+',top='+topp+',left='+leftp+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
 var mi=open(url, 'm',settings); mi.focus();
}

function gobird(action, param, page){
	var lang=getlangue();
	var ph=getphoto();
	var tri=document.fbirds.tri.value;

	var url = "/?page_id=491&langue="+lang+"&action="+action+"&avecphoto="+ph+"&tri="+tri+"&r="+Math.random();
	if(page){
		url += "&page="+page;
  }

  if(param){
    url += "&param="+param;
  }
	document.location.href=url;
}

function getlangue(){
	var f=document.fbirds;
  return f.langue.value;
    //no langue
    //alert('Language - langue ?');
}
function getphoto(){
	if(document.fbirds.avecphoto[1].checked){
	return 'yes';
	}else{
	return 'no';
	}
}
