//prevent google images frame
if (parent.frames.length > 0) top.location.replace(document.location);

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_callJS(jsStr) { //v2.0
	return eval(jsStr)
}

function MM_displayStatusMsg(msgStr) { //v1.0
	status=msgStr;
	document.MM_returnValue = true;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
	if ((obj=MM_findObj(objName))!=null) with (obj)
	if (document.layers) {document.write(unescape(newText)); document.close();}
	else innerHTML = unescape(newText);
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_goToURL() { //v3.0
	var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function submitonce(frm) {
	if (document.all || document.getElementById) {
		for (i=0;i<frm.length;i++) {
			var tempobj=frm.elements[i];
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="button") {
				tempobj.disabled=true;
			}
		}
	}
}

function submitForm(what) {
	try {
		what.submit.disabled = true;	
		document.body.cursor = "wait";
	}
		catch (e) { }
}

function send(){document.frmNews.submit()}

function BreakItUp(fieldname) {
	//Set the limit for field size.
	var FormLimit = 102399
	
	//Get the value of the large input object.
	var TempVar = new String
	TempVar = document.frm.fieldname.value
	
	//If the length of the object is greater than the limit, break it into multiple objects.
	if (TempVar.length > FormLimit) {
		document.frm.fieldname.value = TempVar.substr(0, FormLimit)
		TempVar = TempVar.substr(FormLimit)
		
		while (TempVar.length > 0) {
			var objTEXTAREA = document.createElement("TEXTAREA")
			objTEXTAREA.name = fieldname
			objTEXTAREA.value = TempVar.substr(0, FormLimit)
			document.frm.appendChild(objTEXTAREA)
			
			TempVar = TempVar.substr(FormLimit)
		}
	}
}

function YY_checkform() { //v4.65
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'||myObj.type=='textarea'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(parseInt(myV))||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert(myErr)}
  document.MM_returnValue = (myErr=='')
  
}

function GP_AdvOpenWindow(theURL,winName,ft,pw,ph,wa,il,aoT,acT,bl,tr,trT,slT,pu) { //v3.08
  // Copyright(c) George Petrov, www.dmxzone.com member of www.DynamicZones.com
  var rph=ph,rpw=pw,nlp,ntp,lp=0,tp=0,acH,otH,slH,w=480,h=340,d=document,OP=(navigator.userAgent.indexOf("Opera")!=-1),IE=d.all&&!OP,IE5=IE&&window.print,NS4=d.layers,NS6=d.getElementById&&!IE&&!OP,NS7=NS6&&(navigator.userAgent.indexOf("Netscape/7")!=-1),b4p=IE||NS4||NS6||OP,bdyn=IE||NS4||NS6,olf="",sRes="";
  imgs=theURL.split('|'),isSL=imgs.length>1;aoT=aoT&&aoT!=""?true:false;
  var tSWF='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ##size##><param name=movie value="##file##"><param name=quality value=high><embed src="##file##" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ##size##></embed></object>'
  var tQT='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" ##size##><param name="src" value="##file##"><param name="autoplay" value="true"><param name="controller" value="true"><embed src="##file##" ##size## autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>'
  var tIMG=(!IE?'<a href="javascript:'+(isSL?'nImg()':'window.close()')+'">':'')+'<img id=oImg name=oImg '+((NS4||NS6||NS7)?'onload="if(isImg){nW=pImg.width;nH=pImg.height}window.onload();" ':'')+'src="##file##" border="0" '+(IE?(isSL?'onClick="nImg()"':'onClick="window.close()"'):'')+(IE&&isSL?' style="cursor:pointer"':'')+(!NS4&&isSL?' onload="show(\\\'##file##\\\',true)"':'')+'>'+(!IE?'</a>':'')
  var tMPG='<OBJECT classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" ##size## type="application/x-oleobject"><PARAM NAME="FileName" VALUE="##file##"><PARAM NAME="animationatStart" VALUE="true"><PARAM NAME="transparentatStart" VALUE="true"><PARAM NAME="autoStart" VALUE="true"><PARAM NAME="showControls" VALUE="true"><EMBED type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" SRC="##file##" ##size## AutoStart=true></EMBED></OBJECT>'
  omw=aoT&&IE5;bl=bl&&bl!=""?true:false;tr=IE&&tr&&isSL?tr:0;trT=trT?trT:1;ph=ph>0?ph:100;pw=pw>0?pw:100;
  re=/\.(swf)/i;isSwf=re.test(theURL);re=/\.(gif|jpg|png|bmp|jpeg)/i;isImg=re.test(theURL);re=/\.(avi|mov|rm|rma|wav|asf|asx|mpg|mpeg)/i;isMov=re.test(theURL);isEmb=isImg||isMov||isSwf;
  if(isImg&&NS4)ft=ft.replace(/resizable=no/i,'resizable=yes');if(b4p){w=screen.availWidth;h=screen.availHeight;}
  if(wa&&wa!=""){if(wa.indexOf("center")!=-1){tp=(h-ph)/2;lp=(w-pw)/2;ntp='('+h+'-nWh)/2';nlp='('+w+'-nWw)/2'}if(wa.indexOf("bottom")!=-1){tp=h-ph;ntp=h+'-nWh'} if(wa.indexOf("right")!=-1){lp=w-pw;nlp=w+'-nWw'}
    if(wa.indexOf("left")!=-1){lp=0;nlp=0} if(wa.indexOf("top")!=-1){tp=0;ntp=0}if(wa.indexOf("fitscreen")!=-1){lp=0;tp=0;ntp=0;nlp=0;pw=w;ph=h}
    ft+=(ft.length>0?',':'')+'width='+pw;ft+=(ft.length>0?',':'')+'height='+ph;ft+=(ft.length>0?',':'')+'top='+tp+',left='+lp;
  } if(IE&&bl&&ft.indexOf("fullscreen")!=-1&&!aoT)ft+=",fullscreen=1";
  if(omw){ft='center:no;'+ft.replace(/lbars=/i,'l=').replace(/(top|width|left|height)=(\d+)/gi,'dialog$1=$2px').replace(/=/gi,':').replace(/,/gi,';')}
  if (window["pWin"]==null) window["pWin"]= new Array();var wp=pWin.length;pWin[wp]=(omw)?window.showModelessDialog(imgs[0],window,ft):window.open('',winName,ft);
  if(pWin[wp].opener==null)pWin[wp].opener=self;window.focus();
  if(b4p){ if(bl||wa.indexOf("fitscreen")!=-1){pWin[wp].resizeTo(pw,ph);pWin[wp].moveTo(lp,tp);}
    if(aoT&&!IE5){otH=pWin[wp].setInterval("window.focus();",50);olf='window.setInterval("window.focus();",50);'}
  } sRes='\nvar nWw,nWh,d=document,w=window;'+(bdyn?';dw=parseInt(nW);dh=parseInt(nH);':'if(d.images.length == 1){var di=d.images[0];dw=di.width;dh=di.height;\n')+
    'if(dw>0&&dh>0){nWw=dw+'+(IE?12:NS7?15:NS6?14:0)+';nWh=dh+'+(IE?32:NS7?50:NS6?1:0)+';'+(OP?'w.resizeTo(nWw,nWh);w.moveTo('+nlp+','+ntp+')':(NS4||NS6?'w.innerWidth=nWw;w.innerHeight=nWh;'+(NS6?'w.outerWidth-=14;':''):(!omw?'w.resizeTo(nWw,nWh)':'w.dialogWidth=nWw+"px";w.dialogHeight=nWh+"px"')+';eh=dh-d.body.clientHeight;ew=dw-d.body.clientWidth;if(eh!=0||ew!=0)\n'+
  	(!omw?'w.resizeTo(nWw+ew,nWh+eh);':'{\nw.dialogWidth=(nWw+ew)+"px";\nw.dialogHeight=(nWh+eh)+"px"}'))+(!omw?'w.moveTo('+nlp+','+ntp+')'+(!(bdyn)?'}':''):'\nw.dialogLeft='+nlp+'+"px";w.dialogTop='+ntp+'+"px"\n'))+'}';
  var iwh="",dwh="",sscr="",sChgImg="";tRep=".replace(/##file##/gi,cf).replace(/##size##/gi,(nW>0&&nH>0?'width=\\''+nW+'\\' height=\\''+nH+'\\'':''))";
  var chkType='re=/\\.(swf)$/i;isSwf=re.test(cf);re=/\\.(mov)$/i;isQT=re.test(cf);re=/\\.(gif|jpg|png|bmp|jpeg)$/i;isImg=re.test(cf);re=/\.(avi|rm|rma|wav|asf|asx|mpg|mpeg)/i;isMov=re.test(cf);';
  var sSize='tSWF=\''+tSWF+'\';\ntQT=\''+tQT+'\';tIMG=\''+tIMG+'\';tMPG=\''+tMPG+'\'\n'+"if (cf.substr(cf.length-1,1)==']'){var bd=cf.lastIndexOf('[');if(bd>0){var di=cf.substring(bd+1,cf.length-1);var da=di.split('x');nW=da[0];nH=da[1];cf=cf.substring(0,bd)}}"+chkType;
  if(isEmb){if(isSL) { 
      sChgImg=(NS4?'var l = document.layers[\'slide\'];ld=l.document;ld.open();ld.write(nHtml);ld.close();':IE?'document.all[\'slide\'].innerHTML = nHtml;':NS6?'var l=document.getElementById(\'slide\');while (l.hasChildNodes()) l.removeChild(l.lastChild);var range=document.createRange();range.setStartAfter(l);var docFrag=range.createContextualFragment(nHtml);l.appendChild(docFrag);':'');
      sscr='var pImg=new Image(),slH,ci=0,simg="'+theURL+'".split("|");'+
      'function show(cf,same){if(same){di=document.images[0];nW=di.width;nH=di.height}'+sRes+'}\n'+
      'function nImg(){if(slH)window.clearInterval(slH);nW=0;nH=0;cf=simg[ci];'+sSize+'document.title=cf;'+
      (tr!=0?';var fi=IElem.filters[0];fi.Apply();IElem.style.visibility="visible";fi.transition='+(tr-1)+';fi.Play();':'')+
      'if (nW==0&&nH==0){if(isImg){nW=pImg.width;nH=pImg.height}else{nW='+pw+';nH='+ph+'}}'+
      (bdyn?'nHtml=(isSwf?tSWF'+tRep+':isQT?tQT'+tRep+':isImg?tIMG'+tRep+':isMov?tMPG'+tRep+':\'\');'+sChgImg+';':'if(document.images)document["oImg"].src=simg[ci];')+
      sRes+';ci=ci==simg.length-1?0:ci+1;cf=simg[ci];re=/\\.(gif|jpg|png|bmp|jpeg)$/i;isImg=re.test(cf);if(isImg)pImg.src=cf;'+
      (isSL?(!NS4?'if(ci>1)':'')+'slH=window.setTimeout("nImg()",'+slT*1000+')}':'');
    } else {sscr='var re,pImg=new Image(),nW=0,nH=0,nHtml="",cf="'+theURL+'";'+chkType+'if(isImg)pImg.src=cf;\n'+
      'function show(){'+sSize+';if (nW==0&&nH==0){if(isImg){;nW=pImg.width;nH=pImg.height;if (nW==0&&nH==0){nW='+pw+';nH='+ph+'}}else{nW='+pw+';nH='+ph+
      '}};nHtml=(isSwf?tSWF'+tRep+':isQT?tQT'+tRep+':isImg?tIMG'+tRep+':isMov?tMPG'+tRep+':\'\');document.write(nHtml)};'}
    pd = pWin[wp].document;pd.open();pd.write('<html><'+'head><title>'+imgs[0]+'</title><'+'script'+'>'+sscr+'</'+'script>'+(!NS4?'<STYLE TYPE="text/css">BODY {margin:0;border:none;padding:0;}</STYLE>':'')+'</head><body '+(NS4&&isSL?'onresize=\'ci--;nImg()\' ':'')+'onload=\''+olf+(isSL?';nImg()':sRes)+'\' bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">'); 
    if(rpw>0){iwh='width="'+rpw+'" ';dwh='width:'+rpw} if(rph>0){iwh+='height="'+rph+'"';dwh+='height:'+rph}
    if(tr!=0) pd.write('<span id=IElem Style="Visibility:hidden;Filter:revealTrans(duration='+trT+');width:100%;height=100%">');
    if(isSL&&bdyn) {pd.write(NS4?'<layer id=slide></layer>':'<span id=slide></span>')} else {pd.write('<'+'script>show()'+'</'+'script>')}   
    if(tr!=0) pd.write('</span>');pd.write('</body></html>');pd.close();
  }else {if(!omw)pWin[wp].location.href=imgs[0];}
  if((acT&&acT>0)||(slT&&slT>0&&isSL)){if(pWin[wp].document.body)pWin[wp].document.body.onunload=function(){if(acH)window.clearInterval(acH);if(slH)window.clearInterval(slH)}}
  if(acT&&acT>0)acH=window.setTimeout("pWin["+wp+"].close()",acT*1000);if(slT&&slT>0&&isSL)slH=window.setTimeout("if(pWin["+wp+"].nImg)pWin["+wp+"].nImg()",slT*1000);  
  if(pu&&pu!=""){pWin[wp].blur();window.focus()} else pWin[wp].focus();document.MM_returnValue=(il&&il!="")?false:true;
}

function launchWindow(ref) {
	href = ref;
	var w = 793;
	var h = 570;
	var lp = (screen.width) ? (screen.width-w)/2 : 0;
	var tp = (screen.height) ? (screen.height-h)/2 : 0;
	attrs = 'height=570,width=793,top=' + tp + ',left=' + lp + ', resizable, toolbar=no';
	window.open(href, "", attrs);
}

function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}

function delayedclose(obj) {
	window.setTimeout('toggle(\'' + obj + '\')', 400);
}

var minus=new Image(9,9);
var plus=new Image(9,9);
minus.src="files/stationary/minus.gif";
plus.src="files/stationary/plus.gif";

function toggle0(_37){
	var _38=document.getElementById("section_"+_37);
	if(_38){
		_38.style.display=(_38.style.display!="")?"":"none";
	}
	var img=document.getElementById("toggle_"+_37);
	if(img&&img.src==plus.src){
		img.src=minus.src;}else{if(img){
			img.src=plus.src;
		}
	}
}

function toggle2(_37){
	var _38=document.getElementById(_37);
	if(_38){
		_38.style.display=(_38.style.display!="")?"":"none";
	}
}

function nuToggle(itemID,linkID,img1,img2){
	if (img1==null){img1 = 'plus.gif'};
	if (img2==null){img2 = 'minus.gif'};
	itemID.style.display = itemID.style.display == "none" ? "" : "none";
	linkID.innerHTML = itemID.style.display == "none" ? "<img src=/files/stationary/" + img1 + " alt=\"expand\" />" : "<img src=/files/stationary/" + img2 + " alt=\"collapse\" />";
}

//saved stories
var initMessage="<p>Click a Save Story icon to add up to 10 stories here for easy reference.</p>";
var myStoryList=new Array();

//var tools="<div id=\"ss_options\"><a href=\"javascript:void(0)\" onmouseover=\"MM_displayStatusMsg('Verwijder alle favorieten');return document.MM_returnValue\" onfocus=\"if(this.blur)this.blur()\" onclick=\"clearList();\"><img src=\"/files/stationary/delete.gif\" /></a><a href=\"javascript:void(0);\" onmouseOver=\"MM_displayStatusMsg('Verwijder gelezen favorieten');return document.MM_returnValue\" onfocus=\"if(this.blur)this.blur()\"  onclick=\"clearRead();\"><img src=\"/files/stationary/delete.gif\" /></a></div>";
var tools="<div id=\"ss_options\"><div id=ss_deleteall><a href=\"javascript:void(0)\" onclick=\"clearList();\"></a></div><div id=ss_deleteread><a href=\"javascript:void(0);\" onclick=\"clearRead();\"></a></div></div>";

function myStory(storyData) {
   storyInfo=storyData.split("::");
   this.sid=storyInfo[0];
   this.url=storyInfo[1];
   this.hed=storyInfo[2];
   this.read=(storyInfo[3]=='t')?true:false;
}

function shiftMyStoryList() {
  l=myStoryList.length;
  
  for (i=l;i>0;i--)
    myStoryList[i]=myStoryList[i-1];
}

function swapSaveGif(storyID,state) {
  gifID="add"+storyID;
  if (!(savedImg=document.getElementById(gifID)))
     return;
  
  if ((savedImg.width==18) || (savedImg.width==50)) {
     if (state=="saved")
        savedImg.src="files/stationary/saved.gif";
     else if (state=="save")
        savedImg.src="files/stationary/save.gif";
  }

  else if (savedImg.width==12) {
     if (state=="saved")
        savedImg.src="files/stationary/saved.gif";
     else if (state=="save")
        savedImg.src="files/stationary/save.gif";
  }
}

function addMyStory(storyId,url,hed) {
  if ((l=myStoryList.length)==10) {
     alert("Only 10 stories may be saved at this time. To save a new story, please clear one or more from your menu.");
     return;
  }

  inlist=false;
  
  if (l)
    for (i=0;i<l;i++)
      if (myStoryList[i].sid==storyId) {
	  inlist=true;
	  break;
	}
  
  if (!(inlist)) {
      storyData=storyId+"::"+url+"::"+hed;

      shiftMyStoryList();
      myStoryList[0]=new myStory(storyData);

      setCookieList();
      changeList();
      swapSaveGif(storyId,'saved');
    }
}

// Initialize menu
function startupSaved() {  //checks for mysavedstories cookie and tells document bacground to watch for clicks
  document.onclick=checkMenu;
  readCookieList();
}

//Cookie Management
function getCookie() {
  var dc = document.cookie;
  var prefix = "mynewsstories=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function readCookieList() {
   if (cookstring=getCookie()) {
      storyList=cookstring.split("**");
      for (i=0;i<storyList.length;i++) {
	    myStoryList[i]=new myStory(storyList[i]);
	    if (document.getElementById('add'+myStoryList[i].sid))
	       swapSaveGif(myStoryList[i].sid,'saved');
	  }
      changeList();
   }
   else document.getElementById("ss_headlines").innerHTML=initMessage;
}

function setCookieList() {

   l=myStoryList.length;
   cookstring='';
   for (i=0;i<l;i++) {
     readtf=(myStoryList[i].read)?'::t':'::f'
     if (i>0) cookstring+="**";
     cookstring+=myStoryList[i].sid+"::"+myStoryList[i].url+"::"+myStoryList[i].hed+readtf; //took out the extra colon
   }
   var expdate = new Date();
   expdate.setTime(expdate.getTime()+31536000000);
   document.cookie="mynewsstories="+escape(cookstring)+"; expires="+expdate.toGMTString()+"; path=/;";
}

// Menu management
function buildPullDown() {

  l=myStoryList.length;
  myStoryHTML="";
  myStoryHTML+=tools;
  
  for (i=0;i<l;i++)
  {
   readtest=(myStoryList[i].read)?' class=\"read\"':'';
   myStoryHTML+="<a href=\""+myStoryList[i].url+"\""+readtest+" onmouseover=\"MM_displayStatusMsg('" + myStoryList[i].hed + "');return document.MM_returnValue\" onfocus=\"if(this.blur)this.blur()\" onclick=\"readThis('"+myStoryList[i].sid+"');\">"+myStoryList[i].hed+"</a>"
  }
//  myStoryHTML+=tools;
  return myStoryHTML;
}

function changeNums() {
   l=myStoryList.length;
   document.getElementById('ss_count').innerHTML=l;
}

function changeList() {
  p=document.getElementById("ss_headlines");
  p.innerHTML=(myStoryList.length)?buildPullDown():initMessage;
  changeNums();
}

function clearList() {
   for (i=0;i<myStoryList.length;i++)
       swapSaveGif(myStoryList[i].sid,'save');

   document.cookie="mynewsstories=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/;";
   myStoryList=new Array();
   changeNums();
   document.getElementById("ss_headlines").innerHTML=initMessage;
}

function clearRead() {
   newStoryList=new Array();
   for (i=0;i<myStoryList.length;i++) {
     if (!(myStoryList[i].read))
        newStoryList[newStoryList.length]=myStoryList[i];
     else
        swapSaveGif(myStoryList[i].sid,'save');
   }
   myStoryList=newStoryList;
   changeList();
   setCookieList();
}

function readThis(storyid) {
  for (i=0;i<myStoryList.length;i++)
    if (myStoryList[i].sid==storyid) {
       myStoryList[i].read=true;
       break;
    }
  setCookieList();
}

// Menu Show/Hide Functions
var openMenu=null;
    // variable to determine which pulldown is open - needed for closing menus by clicking on background

function toggleSS(which) {

   obj=document.getElementById(which).style.visibility;
   if ((obj=="hidden") || (obj==""))
      { showSS(which); }
   else { hideSS(which); }
}

function hideSS(which) {
   document.getElementById(which).style.visibility="hidden";
   openMenu=null;
}

function showSS(which) {
   document.getElementById(which).style.visibility="visible";
   openMenu=which;
}

function checkMenu() {
  if (openMenu != null)
     hideSS(openMenu);
}

//Date
function getQueryValue(name) {
  var value = "";
  if ( (i=location.search.indexOf('?'+name))==-1 &&
(i=location.search.indexOf('&'+name,3))==-1 )
    return null;
  else
    i += name.length+2;
  if ( (j=location.search.indexOf("&",i))!=-1 )
    value = location.search.substring(i,j);
  else
    value = location.search.substring(i,location.search.length);
  for ( i=0; i<value.length; i++ )
    if ( value.charAt(i)=='+' )
     value = value.substring(0,i)+' '+value.substring(i+1,value.length);
  return unescape(value);
}

function dt() {
	d=new Date;
	var lcid = getQueryValue('lcid')
	
	if(lcid=="en"){
	if(d.getDay()==0)day="";
	else if(d.getDay()==1)day="monday";
	else if(d.getDay()==2)day="tuesday";
	else if(d.getDay()==3)day="wednesday";
	else if(d.getDay()==4)day="thursday";
	else if(d.getDay()==5)day="friday";
	else day="saturday";
	}else
	if(d.getDay()==0)day="zondag";
	else if(d.getDay()==1)day="maandag";
	else if(d.getDay()==2)day="dinsdag";
	else if(d.getDay()==3)day="woensdag";
	else if(d.getDay()==4)day="donderdag";
	else if(d.getDay()==5)day="vrijdag";
	else day="zaterdag";
	
	if(lcid=="en"){	
	if(d.getMonth()==0)m="january ";
	else if(d.getMonth()==1)m="february ";
	else if(d.getMonth()==2)m="march ";
	else if(d.getMonth()==3)m="april ";
	else if(d.getMonth()==4)m="may ";
	else if(d.getMonth()==5)m="june ";
	else if(d.getMonth()==6)m="july ";
	else if(d.getMonth()==7)m="august ";
	else if(d.getMonth()==8)m="september ";
	else if(d.getMonth()==9)m="october ";
	else if(d.getMonth()==10)m="november ";
	else m="december ";
	} else
		
	if(d.getMonth()==0)m="januari ";
	else if(d.getMonth()==1)m="februari ";
	else if(d.getMonth()==2)m="maart ";
	else if(d.getMonth()==3)m="april ";
	else if(d.getMonth()==4)m="mei ";
	else if(d.getMonth()==5)m="juni ";
	else if(d.getMonth()==6)m="juli ";
	else if(d.getMonth()==7)m="augustus ";
	else if(d.getMonth()==8)m="september ";
	else if(d.getMonth()==9)m="oktober ";
	else if(d.getMonth()==10)m="november ";
	else m="december ";
	
	var n = ""+d.getMinutes()
	if (n.length==1) n="0"+n;
	
	if(lcid=="en"){
		//return(day +" " +m+" "+d.getDate()+" "+d.getFullYear()+" "+d.getHours()+":"+d.getMinutes());
		return((d.getMonth()+1)+"-"+d.getDate()+"-"+d.getFullYear()+"-"+d.getHours()+":"+n);
	}else
		//return(day +" " +d.getDate()+" "+m+" "+d.getFullYear()+" "+d.getHours()+":"+d.getMinutes());
		return(d.getDate()+"-"+(d.getMonth()+1)+"-"+d.getFullYear()+" "+d.getHours()+":"+n);
}

// Masks
function editMaskPre(obj, mask, evt) {
	var keyCode = evt.keyCode;
	if (keyCode == 0) {
		keyCode = evt.charCode;
	}
	if (obj.value.length == 0 && keyCode != 8 && keyCode != 0 && keyCode!= 9) {
		completeMask(obj, mask);
	}
}

function toregexp(txt) {
	txt = txt.replace(/([-\/\[\]()\*\+])/g, '\\$1');
	txt = txt.replace(/N/g, '\\d');
	txt = txt.replace(/\?/g, '.');
	txt = txt.replace(/A/g, '\\w');
	txt = txt.replace(/C/g, '[A-Za-z]');
	return txt;
}

function editMask(obj, mask, evt) {
	var tmVal = getFirstMatch(obj.value, mask);
	if (obj.value != tmVal) {
		obj.value = tmVal;
	}
	if(evt.keyCode != 8 && obj.value.length != 0) { // backspace and tab
		completeMask(obj, mask);
	}
}

function getFirstMatch(value, mask) {
	var size = value.length;
	if(size == 0) {
		return "";
	}
	var re = new RegExp('^' + toregexp(mask.substr(0, size)) + '$');
	if (!value.match(re)) { 
		return getFirstMatch(value.substr(0, size-1), mask);
	} else {
		return value;
	}
}

function completeMask(obj, mask) {
	var size = obj.value.length;
	var sw=true;
	var tmp = obj.value;
	while (sw) {
		if (mask.length<=size) {
			break;
		}
		switch (mask.charAt(size)) {
			case 'N':
			case 'A':
			case 'C':
			case '?':
				sw = false;
				break;
			default:
				tmp += mask.charAt(size);
		}
		size++;
	}
	if (obj.value != tmp) {
		obj.value = tmp;
		obj.lastMatched = obj.value;
	}
	return;
}

function tsep(n,swap) {
	var ts=".", ds=","; // thousands and decimal separators
	if (swap) { ts=","; ts="."; } // swap if requested
	var ns = String(n),ps=ns,ss=""; // numString, prefixString, suffixString
	var i = ns.indexOf(".");
	if (i!=-1) { // if ".", then split:
		ps = ns.substring(0,i);
		ss = ds+ns.substring(i+1);
	} return ps.replace(/(\d)(?=(\d{3})+([.]|$))/g,"$1"+ts)+ss;
}
function sumIt() {
	var f = document.forms["form1"]
	var s = 0
	for (var i=1;i<=28;i++) {
		if(f.elements["item"+i].checked == true){
			var v = f.elements["val"+i].value
			v = parseFloat(v)
			if (isNaN(v)) continue
			v = Math.abs(v)
			s+=v
		}
	}
	//f.elements["totaal"].value = tsep(s)
	//arbeid.innerText = tsep(2500+Math.round(1.2*s))
	//totaal2.innerText = tsep(3000+Math.round(2*s))
	var totaal;
	var huur;
	var arbeid;
	totaal = document.getElementById('totaal');
	huur = document.getElementById('huur');
	arbeid = document.getElementById('arbeid');
	totaal.innerHTML = tsep(s)
	huur.innerHTML = tsep(Math.round(24000 / 16 * (totaal.innerHTML / 24)))
	arbeid.innerHTML = tsep(Math.round(1.75*s))
}

var strColumns_Current = "200,*";

function hidetoc() {
  strColumns_Current = top.fstMain.cols
  
  top.fstMain.cols = "0,*";
  top.mainFrame.document.all("showtoc").style.display = "block";
  }

function showtoc() {
  top.fstMain.cols = strColumns_Current;
  document.getElementById('showtoc').style.display = "none";
  }
  
function nospam_email(domain,name,visible){
	document.write('<a href=\"mail'+'to:' + name + '@' + domain + '\">');
	document.write(visible+ '</a>');
}

function updateAll(){$('titlepreview').innerHTML=$('title').value;$('bodytextpreview').innerHTML=$('bodytext').value;charCounter($('title'),75,$('titleCounter'));charCounter($('bodytext'),350,$('bodytextCounter'));}
function charLimit(field,maxLength){var inputLength=field.value.length;if(inputLength>=maxLength){field.value=field.value.substring(0,maxLength);}}
function charCounter(field,maxLength,countTarget){var inputLength=field.value.length;if(inputLength>=maxLength){field.value=field.value.substring(0,maxLength);}
countTarget.innerHTML=maxLength-field.value.length;}

addEvent(window,"load",labels_init);function labels_init(){if(document.getElementById&&document.styleSheets){try{var s=document.styleSheets[document.styleSheets.length-1];addStyleRule(s,"label.inside","position:absolute; visibility:hidden;");for(var i=0,label=null;(label=document.getElementsByTagName("label")[i]);i++)
{if(label.className=='inside'){label_init(label);}}
addEvent(document.forms[0],"submit",labels_uninit);}
catch(e){}}}
function labels_uninit(e){if(document.getElementById&&document.styleSheets){for(var i=0,label=null;(label=document.getElementsByTagName("label")[i]);i++)
{var el=document.getElementById(label.htmlFor);if(el&&el.value==el._labeltext)label_hide(el);}}}
function label_init(label){try{var el=document.getElementById(label.htmlFor);var elName=el.nodeName;var elType=el.getAttribute("type");if(elName=="TEXTAREA"||(elType=="text"||elType=="password")){el._labeltext=label.firstChild.nodeValue;el._type=el.getAttribute("type");addEvent(el,"focus",label_focused);addEvent(el,"blur",label_blurred);label_blurred({currentTarget:el});}else{label.style.position="static";label.style.visibility="visible";}}
catch(e){label.style.position="static";label.style.visibility="visible";}}
function label_focused(e){e=fix_e(e);var el=e.currentTarget;if(el.value==el._labeltext)el=label_hide(el)
el.select();}
function label_hide(el){if(el._type=="password")el=label_setInputType(el,"password");el.value="";return el;}
function label_blurred(e){e=fix_e(e);var el=e.currentTarget;if(el.value=="")el=label_show(el);}
function label_show(el){if(el._type=="password")el=label_setInputType(el,"text");el.value=el._labeltext;return el;}
function label_setInputType(el,type){if(navigator.appName=="Microsoft Internet Explorer"){var newEl=document.createElement("SPAN");newEl.innerHTML='<input type="'+type+'" />';newEl=newEl.firstChild;var s='';for(prop in el){try{if(prop!="type"&&prop!="height"&&prop!="width")newEl[prop]=el[prop];}
catch(e){}}
addEvent(newEl,"focus",label_focused);addEvent(newEl,"blur",label_blurred);el.parentNode.replaceChild(newEl,el);return newEl;}else{el.setAttribute("type",type);return el;}}
function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,true);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}
function addStyleRule(stylesheet,selector,rule){if(stylesheet.addRule)stylesheet.addRule(selector,rule);else{var index=stylesheet.cssRules.length;stylesheet.insertRule(selector+"{"+rule+"}",index);}}
function fix_e(e){if(!e&&window.event)e=window.event;if(!e.currentTarget&&e.srcElement)e.currentTarget=e.srcElement;if(!e.originalTarget&&e.srcElement)e.originalTarget=e.srcElement;return e;}

//ajax dropdown
var loadedobjects = "";
var rootdomain = "http://" + window.location.hostname;
		
function ajaxpage(url, containerid){
	var page_request = false;
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){ // if IE
		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
		catch (e){}
		}
	}
	else
	return false
	
	page_request.onreadystatechange = function(){
		loadpage(page_request, containerid);
	}
	page_request.open('GET', url, true);
	page_request.send(null);
}
		
function loadpage(page_request, containerid){
	document.getElementById(containerid).innerHTML = '<p style="margin-left:135px"><img src="files/stationary/indicator.gif" alt="loading..." /> loading...</p>';
	if(page_request.readyState == 4 && (page_request.status == 200 || window.location.href.indexOf("http") == -1)){
		document.getElementById(containerid).innerHTML = page_request.responseText;
		//alert(page_request.responseText);
	}
}
		
function ajaxcombo(selectobjID1, selectobjID2, selectobjID3, loadarea){
	var selectobj1 = document.getElementById ? document.getElementById(selectobjID1) : ""
	var selectobj2 = document.getElementById ? document.getElementById(selectobjID2) : ""
	var selectobj3 = document.getElementById ? document.getElementById(selectobjID3) : ""
	if(selectobj1 != "" && selectobj1.options[selectobj1.selectedIndex].value != ""){
		//url = 'include/inc_register.asp?method=ajax&sSport=' + selectobj1.options[selectobj1.selectedIndex].value + '&sCountry=' + selectobj2.options[selectobj2.selectedIndex].value + '&sState=' + selectobj3.options[selectobj3.selectedIndex].value;
		url = 'include/inc_register.asp?method=ajax&sSport=' + selectobj1.options[selectobj1.selectedIndex].value + '&sCountry=nl' + '&sState=' + selectobj3.options[selectobj3.selectedIndex].value;
		ajaxpage(url, loadarea);
	}
}

/*
pullquote function by Roger Johansson, http://www.456bereastreet.com/
*/
var pullquote = {
	init : function() {
	// Check that the browser supports the methods used
		if (!document.getElementById || !document.createElement || !document.appendChild) return false;
		var oElement, oPullquote, oPullquoteP, oQuoteContent, i, j;
	// Find all span elements with a class name of pullquote
		var arrElements = document.getElementsByTagName('span');
		var oRegExp = new RegExp("(^|\\s)pullquote(\\s|$)");
		for (i=0; i<arrElements.length; i++) {
	// Save the current element
			oElement = arrElements[i];
			if (oRegExp.test(oElement.className)) {
	// Create the blockquote and p elements
				oPullquote = document.createElement('blockquote');
				oPullquote.className = oElement.className
				oPullquoteP = document.createElement('p');
	// Insert the pullquote text
				for(j=0;j<oElement.childNodes.length;j++) {
					oPullquoteP.appendChild(oElement.childNodes[j].cloneNode(true));
				}
				oPullquote.appendChild(oPullquoteP);
	// Insert the blockquote element before the span elements parent element
				oElement.parentNode.parentNode.insertBefore(oPullquote,oElement.parentNode);
			}
		}
	}
};
// addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
function addEvent(obj, type, fn) {
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function confirmation() {
	var answer = confirm("Weet je zeker dat je dit bericht en alle reacties wil verwijderen?")
	if (answer){
		return true;
	}
	else{
		return false;
	}
}
addEvent(window, 'load', pullquote.init);