// JavaScript Document


//<!--
function getCookie(Name) {
   var search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 
      if (offset != -1) { // if cookie exists 
         offset += search.length 
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 
         // set index of end of cookie value
         if (end == -1) 
            end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
      } 
   }
}

function setCookie(name, value, expire) {
   document.cookie = name + "=" + escape(value)
   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}
//-->

function readCookie(name) {
  var nameEQ = name + '=';
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

 function launchPopup(url, name, width, height, resizable, scrollbars, toolbar, location) {
          popup_window = window.open(url, name, 'width='+width+',height='+height+',resizable='+resizable+',scrollbars='+scrollbars+',toolbar='+toolbar+',location='+location+'');
          popup_window.focus();
        }
 
 function popupWindowCult(mypage,myname,w,h,features) {
				if(screen.width){
				var winl = (screen.width-w)/2;
				var wint = (screen.height-h)/2;
				}else{winl = 0;wint =0;}
				if (winl < 0) winl = 0;
				if (wint < 0) wint = 0;
				var settings = 'height=' + h + ',';
				settings += 'width=' + w + ',';
				settings += 'top=' + wint + ',';
				settings += 'left=' + winl + ',';
				settings += features;
				win = window.open(mypage,myname,settings);
				win.window.focus();
				}
				
			function submitSearch() {
				linkie = "http://www.galeries.nl/agendazoek_nrc.asp?search="+document.forms.ipc_search_nrc.search.value;
				popupWindowCult(linkie,'popup',500,500,'toolbar=no,scrollbars=yes,status=no');
				}
				
function BrowserError(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function BrowserDetect() {
<!--  Activate Cloaking Device
//**************************************************
//
//         Browser Dection Function
//			Windows		IE4.0 NS4.0
//   		Macintosh	IE5.0 NS4.5
//			Other		NS4.5 KDE3.0
//
//			Error ArtikelID: 1022137082567 
//
//**************************************************

// Captures browser name and writes it to the first element of the first form.
// Microsoft Platforms
	if (navigator.platform.indexOf('Win')!=-1) {
		if (navigator.appName.indexOf('Explorer')!=-1){
			temp=navigator.appVersion.split('MSIE')
			version = parseFloat(temp[1])
				if (version < 4.0) {
				BrowserError('/nrc.nl/error/browsererror.html');
				}
		} else if (navigator.appName.indexOf('Netscape')!=-1) {
			temp=navigator.userAgent.split('Netscape')
			version=parseFloat(temp[1])
				if (version < 4.0) {
				BrowserError('/nrc.nl/error/browsererror.html');
				}
			}
// Macintosh Platforms	
	} else if (navigator.platform.indexOf('Mac')!=-1) {
		if (navigator.appName.indexOf('Explorer')!=-1){
			temp=navigator.appVersion.split('MSIE')
			version=parseFloat(temp[1])
				if (version < 5.0) {
				BrowserError('/nrc.nl/error/browsererror.html');
				}

		} else if (navigator.appName.indexOf('Netscape')!=-1) {
			version=parseFloat(navigator.appVersion)
				if (version < 4.5) {
				BrowserError('/nrc.nl/error/browsererror.html');
				}
			}
// Other Platforms		
	} else {
		if (navigator.appName.indexOf('Netscape')!=-1){
			temp=navigator.userAgent.split('Netscape')
			version=parseFloat(temp[1])
				if (version < 4.5) {
				BrowserError('/nrc.nl/error/browsererror.html');
				}

		} else if (navigator.appName.indexOf('Konqueror')!=-1) {
			temp=navigator.userAgent.split('Konqueror/')
			version=parseFloat(temp[1])
				if (version < 3.0) {
				BrowserError('/nrc.nl/error/browsererror.html');
				}
			}
	}
}

function switchImageOn(divId) {
   document.getElementById(divId).style.visibility="visible";
   document.getElementById(divId).style.display="block";
}
function switchImageOff(divId) {
  document.getElementById(divId).style.visibility="hidden";
  document.getElementById(divId).style.display="none";
}

function ShowHide( id)
		{
			  try{
				var hideElm = document.getElementById( "vote-"+id);
				var showElm = document.getElementById( "voted-"+id);
				var butElm = document.getElementById( "votebut-"+id);

				hideElm.style.display = "none";
						butElm.style.display = "none";
						showElm.style.display = "block";
			  }catch (erm){
			  }

		}

 		function DoVote( id)
		{
				var selectionmade= false;
				var poll = document.getElementById('poll-formulier-' + id);


                for (var i = 0; i < poll.vote.length; i++)
				{
					if (poll.vote[i].checked)
					{
						value = escape(poll.vote[i].value );
						selectionmade = true;
					 }
				 }

				 if ( ! selectionmade) {
					 }
				 else{
				   document.forms[ "poll-formulier-"+id ].submit();
				     }
		}

function ShowHideQuiz( id)
		{
			  try{
				var hideElm = document.getElementById( "vote-"+id);
				var showElm = document.getElementById( "voted-"+id);
				//var butElm = document.getElementById( "votebut-"+id);

				hideElm.style.display = "none";
						//butElm.style.display = "none";
						showElm.style.display = "block";
			  }catch (erm){
			  }

		}

function DoQuiz(value, id)
	{
		document.forms[ "poll-formulier-"+id ].vote.value = value;
		document.forms[ "poll-formulier-"+id ].submit();
	}