<!-- Browser detection ------------------------------------------------- -->

Safari = (navigator.userAgent.indexOf("Chrome") == -1) && 
         (navigator.userAgent.indexOf("Safari") != -1);  
Chrome = (navigator.userAgent.indexOf("Chrome") != -1) && 
         (navigator.userAgent.indexOf("Safari") != -1); 
		 
intIEversion = -1; 
if (navigator.appName == 'Microsoft Internet Explorer')
{
   var ua = navigator.userAgent;
   var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
   if (re.exec(ua) != null)
      intIEversion = parseFloat( RegExp.$1 );
}
IE = (intIEversion > -1);

<!-- Adjusting to various screen sizes, iPad and iPhone ---------------- --> 

document.write('<link rel="stylesheet"'); 
document.write('      type="text/css"'); 
document.write('	  href="../Stylefiles/stylefile.css">');
document.write('<link rel="shortcut icon"');
document.write('	  type="image/x-icon"');	
document.write('      href="../Icons/favicon.ico">'); 

if ((IE) && (intIEversion < 9) && (screen.width < 1000))
{
   document.write('<link rel="stylesheet" type="text/css" ');
   document.write('href="Stylefiles/stylefile_centre_off.css">') 
}    
if (screen.width < 481)
{
   document.write('<meta name="viewport" ');
   document.write('content="width=device-width">');
}
if ((screen.width > 480) && (screen.width < 769))
{

}

document.write('<script type="text/javascript"');
document.write(' 		src="../Scripts/scriptIcons.js">');
document.write('</script>');
document.write('<script type="text/javascript"');
document.write('  	    src="../Scripts/scriptMakeMenu.js">');
document.write('</script>');		
document.write('<script type="text/javascript"');
document.write('   		src="../Scripts/scriptMakePhotoMenu.js">');
document.write('</script>');		
document.write('<script type="text/javascript"');
document.write('   		src="../Scripts/scriptNewWindow.js">');
document.write('</script>');	
document.write('<script type="text/javascript"');
document.write('   		src="../Scripts/scriptMakeListItems.js">');
document.write('</script>');	
document.write('<script type="text/javascript"');
document.write('   		src="../Scripts/scriptFlexcroll.js">');
document.write('</script>	');
	

<!-- Page name and location -------------------------------------------- -->				 

strWinPath = window.location.pathname;
slash = "/";
if (window.location.protocol == 'file:')
   if (strWinPath.lastIndexOf(slash) < strWinPath.lastIndexOf("\\"))
      slash = "\\";
strPageName = CleanString(strWinPath.slice(strWinPath.lastIndexOf(slash) + 1, strWinPath.length - 5));
if (strPageName.length == 0)
   strPageName = "index"; 	
   
if (self.location.href.split("?").length > 1)
   strPageExt = self.location.href.split("?")[1]  
else
   strPageExt = '';    
	 
strLanguage = "NL";
if (strWinPath.indexOf(slash + "DE" + slash) > -1)
   strLanguage = "DE";	 

<!-- Help functions ---------------------------------------------------- -->	
		 
function CleanString(str)
{
   str = str.replace(/%20/g,' ');
   if (IE)
      str = str.replace(/\//g,'\\');
   return str;		 
}

function SpaceString(str, nrnbsp)
{
   if (str.length < 2)
      newstr = str;
   else
   {	  
      newstr = '';
      strLetterSpacing = '';
      for (i = 0; i < nrnbsp; i++)
         strLetterSpacing += '&nbsp; ';
      for (i = 0; i < str.length - 1; i++)
      {
         newstr += str.slice(i, i+1);
	     newstr += strLetterSpacing;
      }		  
      newstr += str.slice(str.length - 1, str.length);
   }	  
   return newstr;
} 

var strOpenItemName = '';

function ToggleItem(strItemId)
{ 
   if (strOpenItemName != '')
	  document.getElementById(strOpenItemName).style.display = 'none';
   document.getElementById(strItemId).style.display = 'block';   
   
   strOpenItemName = strItemId;
   
   CSBfleXcroll('text');
}

function ToggleText()
{
   if (strPagePastFuture == 'past')
      document.getElementById('futureappend').style.display = 'none';  
}

function GetDateAndTime()
{
   arrayDateTime = strPageName.split('_');
   strDateNum = arrayDateTime[1];
   strTime = arrayDateTime[2].substring(0, 2) + ':' + arrayDateTime[2].substring(2, 4);
   
   strDateText = DateTextFromDate(DateFromDateNum(strDateNum));

   document.write(strDateText + ', ' + strTime + ',<br>');
   if (strLanguage == "NL")
      document.title = 'Programma ' + strDateText.toLowerCase();
   else	  
      document.title = 'Programm ' + strDateText;
}

function DateFromDateNum(strDateNum)
{
   strDayNum = strDateNum.substring(4, 6);
   if (strDayNum.substring(0, 1) == '0') strDayNum = strDayNum.substring(1, 2);
   strMonthNum = strDateNum.substring(2, 4);
   if (strMonthNum.substring(0, 1) == '0') strMonthNum = strMonthNum.substring(1, 2);
   strYearNum = '20' + strDateNum.substring(0, 2);
   
   var MyDate = new Date(strYearNum, strMonthNum - 1, strDayNum);
   return MyDate;
}

function DateTextFromDate(MyDate)
{
   switch (strLanguage)
   {
      case "NL": 
         switch (MyDate.getMonth())
         {
            case  0: strMonthText = 'januari'; break;
	        case  1: strMonthText = 'februari'; break;
	        case  2: strMonthText = 'maart'; break;
	        case  3: strMonthText = 'april'; break;
	        case  4: strMonthText = 'mei'; break;
	        case  5: strMonthText = 'juni'; break;
	        case  6: strMonthText = 'juli'; break;
	        case  7: strMonthText = 'augustus'; break;
	        case  8: strMonthText = 'september'; break;
	        case  9: strMonthText = 'oktober'; break;
	        case 10: strMonthText = 'november'; break;
	        case 11: strMonthText = 'december'; break;
         }
         arrayDay = ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'] 
         strDayText = arrayDay[MyDate.getDay()];
         strDateText = strDayText + ' ' + strDayNum + ' ' + strMonthText + ' ' + MyDate.getFullYear();
		 break;
      case "DE":
	     switch (MyDate.getMonth())
         {
            case  0: strMonthText = 'Januar'; break;
	        case  1: strMonthText = 'Februar'; break;
	  		case  2: strMonthText = 'März'; break;
	  		case  3: strMonthText = 'April'; break;
	  		case  4: strMonthText = 'Mai'; break;
	  		case  5: strMonthText = 'Juni'; break;
	  		case  6: strMonthText = 'Juli'; break;
	  		case  7: strMonthText = 'August'; break;
	  		case  8: strMonthText = 'September'; break;
	  		case  9: strMonthText = 'Oktober'; break;
	  		case 10: strMonthText = 'November'; break;
	  		case 11: strMonthText = 'Dezember'; break;
         }
         arrayDay = ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Sammstag'] 
         strDayText = arrayDay[MyDate.getDay()];
         strDateText = strDayText + ' ' + strDayNum + '. ' + strMonthText + ' ' + MyDate.getFullYear();
		 break;
   }	  
   return strDateText;
}

function DatePastFuture(MyDate)
{
   var TodayDate = new Date();
   if (MyDate >= TodayDate)
      strPastFuture = 'future'
   else
      strPastFuture = 'past';  

   return strPastFuture;	  
}

function InsertPhoto(strPhotoTitle, intWidth, intPaddingRight)
{    
   strFolderName = strPageName.substring(0, 1).toUpperCase() + strPageName.substring(1, strPageName.length);
   strPhotoName = strPhotoTitle + '.jpg';
   strPhotoNameWithRelPath = CleanString('../Photos/' + strFolderName + '/' + strPhotoName);

   document.write('	  <img class="image"');
   document.write('        src="' + strPhotoNameWithRelPath + '"');
   document.write('	       width="' + intWidth + 'px"');
   document.write('        style="padding: 5px ' + intPaddingRight + 'px 0px 0px"');
   document.write('		   title=""');
   document.write('		   alt="">');
}

function EMailJo(strText)
{
   document.write('<a class="textlink"');
   document.write('   href="mailto: louppen@hetnet.nl"');
   document.write('   title="louppen@hetnet.nl"');
   document.write('	  alt="louppen@hetnet.nl">');
   document.write(    strText);
   document.write('</a>');
}  

