function pop(cgi,name,scroll,tool,loc,stat,resize,width,height) {
  return window.open(cgi,escape(name),'menubar=0,directories=0,scrollbars='+escape(scroll)+',toolbar='+escape(tool)+',location='+escape(loc)+',status='+escape(stat)+',resizable='+escape(resize)+',width='+escape(width)+',height='+escape(height));
}

function go(form) {
  if(form.navpop.options[form.navpop.selectedIndex].value!='') {
    location.href=form.navpop.options[form.navpop.selectedIndex].value;
  }
}

function popup(url,name,mb,tb,lo,pb,ds,sb,st,rs,w,h) {
  var win=pop(url,name,sb,tb,lo,sb,rs,w,h);
  if(!win) return win;
  win.moveTo(Math.round((screen.availWidth-w)/2),Math.round((screen.availHeight-h)/2));
  win.focus();
}
	//	Form functies

function goSelect(veld,url) {
  //alert("goSelect("+veld+","+url+")");
  if(veld.selectedIndex)
       location=url+veld.options[veld.selectedIndex].value;
  else location=url+veld.options[0].value;
}

function mySelect(veld,url) {
  //alert("mySelect("+veld+","+url+")");
  location=url+veld.options[veld.selectedIndex].value;
}

function login() {
  var w=window.open('/?action=login','login',
	 'titlebar=0,menubar=0,toolbar=0,location=0,directories=0,personalbar=0'
	+',status=0,hotkeys=0,scrollbars=0,resizable=0,alwaysRaised=1'
	+',dependent=1,width=400,height=300');
  w.moveTo(Math.round((screen.availWidth-w.outerWidth)/2),
	   Math.round((screen.availHeight-w.outerHeight)/2));
  w.focus();
  return false;
}

function ckVeld(veld,text) {
  var v=veld.value;

  if(v=="" || v==null) {
    alert("Vul alstublieft "+text+" in!");
    veld.focus();
    veld.select();
    return false;
  }
  return true;
}

function ckCommentaar(form) {
  if(!ckVeld(form.T,"Uw commentaar")) return false;
  if(!ckVeld(form.M,"Uw e-mail adres")) return false;
  return true;
}

	//	Popup new browser, load page

function popup(url,name,t,s,r,w,h)
{ var x=Math.round((screen.availWidth-w)/2);
  var y=Math.round((screen.availHeight-h)/2);

  var win=window.open(url,name,
   'titlebar=0,menubar=0,toolbar='+t+',location=0,directories=0,personalbar=0,status=0,scrollbars='+s+',resizable='+r+',width='+w+',height='+h+',screenY='+y+',screenX='+x);
  win.focus();
  return(win);
}

function popPage(url,name,tools,scroll,resize,width,height,center,href)
{ var x=Math.round((screen.availWidth-width)/2);
  var y=Math.round((screen.availHeight-height)/2);
  var opts ='titlebar=no,menubar=no,location=no,directories=no';
      opts+=',personalbar=no,status=no,hotkeys=no';
      opts+=',alwaysRaised=yes,dependent=yes,modal=yes,dialog=yes';
      opts+=',toolbar='+tools+',scrollbars='+scroll+',resizable='+resize+',width='+width+',height='+height;
  if(center) opts+=',screenX='+x+',screenY='+y;

  var win=window.open(url,name,opts);
  if(center) win.moveTo(x,y);
  win.focus();
  return(href?false:win);
}

function popFoto(img,width,height)
{ var x=Math.round((screen.availWidth-width)/2);
  var y=Math.round((screen.availHeight-height)/2);
  var opts ='titlebar=0,menubar=0,location=0,directories=0,personalbar=0,status=0,statusbar=0,';
      opts+='alwaysRaised=1,dependent=1,hotkeys=0,toolbar=1,scrollbars=0,resizable=1,';
      opts+='width='+width+',height='+height+',screenX='+x+',screenY='+y;
  var win=window.open('/blog/foto.php?file='+escape(img),'foto',opts);
  return(false);
}

// Fix for bug in IE6.0 float handling (don't ask, don't tell ;)

if(document.all && window.attachEvent) window.attachEvent("onload",fixWinIE);

function fixWinIE() {
  try {
    document.getElementById('content').style.display='block';
  } catch(er) {}
}

function fadeSet(img,opa) {
  img.style.MozOpacity=opa;
  img.style.filter=('alpha(opacity='+opa*100+')');
  return true;
}

function fadeIn(img) {
  fadeSet(img,1.0);
  return true;
}

function fadeOut(img) {
  fadeSet(img,0.8);
  return true;
}

function none() {
  return(false);
}

function pops(link,name,opts,x,y) {
  var s=window.open(link,name,opts);
  s.moveTo(x,y);
  s.focus();
}

function rave(n) {
  var w=180;
  var h=50;
  var x=Math.round((screen.availWidth-w)/2);
  var y=Math.round((screen.availHeight-h)/2);
  var o='titlebar=0,statusbar=0,status=0,menubar=0,toolbar=0,location=0,personalbar=0,directories=0,resizable=0,scrollbars=0,width='+w+',height='+h+',left='+x+',top='+y;
  
  pops('/Rave/?r='+n,'Rave',o,x,y);
}

function giro() {
  var w=1024;
  var h=768;
  var x=Math.round((screen.availWidth-w)/2);
  if(x<0) { x=0; w=screen.availWidth-16; }
  var y=Math.round((screen.availHeight-h)/2);
  if(y<0) { y=0; h=screen.availHeight-24; }

  var o='titlebar=0,status=1,menubar=0,toolbar=0,location=0,personalbar=0,directories=0,resizable=1,scrollbars=1,width='+w+',height='+h+',left='+x+',top='+y;
  
  // pops('https://gto.postbank.nl/GTO/','Giro',o,x,y);
  pops('https://www.p3.postbank.nl/sesam/SesamLoginServlet','Giro',o,x,y);
}

var ie=navigator.userAgent.indexOf("MSIE")!=-1;
var ns=((navigator.userAgent.indexOf("Mozilla")!=-1) && !ie);
ie=(ie && document.all)?1:0;
ns=(ns && document.layers)?1:0;

