// YG 31-03-2006 declare variable for popup
var printWin;

function FnQueryString(strParameter) { 
    	strParameter = strParameter.toLowerCase();
	strSearchLowercase = unescape(location.search);
	var strWaarde = ""; 
	strSearch = strSearchLowercase.toLowerCase();
	numPosStart = strSearch.indexOf(strParameter); 
	numPosStop = 0;
	if (numPosStart != -1) { 
		numPosStart = numPosStart + strParameter.length;
		numPosStop = strSearch.indexOf("&", numPosStart);
		if (numPosStop == -1) { 
			numPosStop = strSearch.length;
		}
		strWaarde = unescape(strSearchLowercase.substring(numPosStart, numPosStop));
	}
	return strWaarde;
}


function BreadCrum(strBreadCrum){
	if (document.getElementById("Breadcrum")){
		document.getElementById("Breadcrum").innerHTML += '<span class="padnav"> &gt; </span><a href="#" class="padnav">' + strBreadCrum + '</a>';
	}
}


function Title(strTitle){
	if (document.getElementById("Titel")){
		document.getElementById("Titel").innerHTML = strTitle;
	}
}


// changed : 18-04-2006
// adapation for zoom everywhere in the site 
// JavaScript images popup 
function printWindow(Painter, Title, SubText, ImageUrlMid, ImageUrlLarge,cssType) {
// specify window parameters
printWin = window.open( "", "Zoom", "width=425,height=500,status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40");

pic1value = URLEncode(ImageUrlMid)
pic2value = URLEncode(ImageUrlLarge)

var bgColorFlash;

// wrote content to window
printWin.document.write('<head>')
printWin.document.write('<title>Koninklijk Kabinet van Schilderijen Maurithuis</title>')
printWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">')
if(cssType== undefined){cssType="3";}
	printWin.document.write('<link href="mauritshuis'+cssType+'.css" rel="stylesheet" type="text/css">')
	// 1=orange, 2=groen, 3=blauw, 4= geel
	switch (cssType)
	{
		case "1": bgColorFlash = "#ffd6b2"; break;
		case "2": bgColorFlash = "#d7e0be"; break;
		case "3": bgColorFlash = "#dbe4f4"; break;
		case "4": bgColorFlash = "#f1e9b2"; break;
	}

//printWin.document.write('<script language="JavaScript1.2" src="sites/MHS/js/scripts.js"></script>')
printWin.document.write('</head>')
printWin.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="'+bgColorFlash+'">')
printWin.document.write('<table width="405" height="405" border="0" align="center" cellpadding="10" cellspacing="0">')
printWin.document.write('  <tr>')
printWin.document.write('    <td align="center" valign="middle"><table width="385" border="0" cellspacing="0">')
printWin.document.write('        <tr> ')
printWin.document.write('          <td align="left" valign="top"><span class="kop-collectie">'+Painter+' - '+Title+'</span>&nbsp; </td>')
printWin.document.write('        </tr>')
printWin.document.write('        <tr> ')
printWin.document.write('          <td align="center" valign="middle" class="schilderij-groot-kader">')
printWin.document.write(' 				<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="375" height="375" id="zoom" align="middle">')
printWin.document.write(' 					<param name="allowScriptAccess" value="sameDomain" />')
printWin.document.write(' 					<param name="movie" value="Sites/MHS/flash/zoom.swf?image_small='+pic1value+'&image_large='+pic2value+'" />')
printWin.document.write(' 					<param name="quality" value="high" />')
printWin.document.write(' 					<param name="menu" value="false" />')
printWin.document.write(' 					<param name="bgcolor" value="'+bgColorFlash+'" />')
printWin.document.write(' 					<embed src="Sites/MHS/flash/zoom.swf?image_small='+pic1value+'&image_large='+pic2value+'" quality="high" menu="false" bgcolor="'+bgColorFlash+'" width="375" height="375" name="zoom" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />')
printWin.document.write(' 				</object>')
printWin.document.write(' 			</td>')
printWin.document.write('        </tr>')
printWin.document.write('        <tr>')
printWin.document.write('          <td align="left" valign="top" class="schilderij-details-navkader">')
printWin.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">')
printWin.document.write('              <tr align="left" valign="top"> ')
printWin.document.write('                <td colspan="2"><span class="subtekst2">Via de zoom kunt u dit schilderij onder de loep nemen en in detail bekijken.</span></td>')
printWin.document.write('              </tr>')
printWin.document.write('            </table>')
printWin.document.write('          </td>')
printWin.document.write('        </tr>')
printWin.document.write('     </table></td>')
printWin.document.write('  </tr>')
printWin.document.write('</table>')
printWin.document.write('</body>')
printWin.document.write('</html>')
printWin.document.close();	
// If we are on NetScape, we can bring the window to the front
// YG 31-03-2006 fix condition not == but !=
	if (navigator.appName.substring(0,8) != "Netscape") printWin.focus();
}



function printContent(pTitle) {
// specify window parameters
  printWin = window.open( "", "print", "width=600,height=450,status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40");
  printText = document.getElementById("PrintContent").innerHTML;
// wrote content to window
  printWin.document.write('<html><head><title>' + pTitle + '</title><style>H1 {	font-family: Arial, Helvetica, sans-serif;	font-size: 18px;color: #006699;	font-weight: bold;padding:0px;margin:0px;} H2 {	font-family: Arial, Helvetica, sans-serif;font-size: 14px;color: #9EC8DE;font-weight: bold; padding:0px; margin:0px;} td{font-family:verdana;font-size:11px;};.Print{display:none;}</style><link href="mauritshuis.css" rel="stylesheet" type="text/css"><script language="JavaScript1.2" src="sites/MHS/js/scripts.js"></script><script language="JavaScript" type="text/javascript">var windowOnload = "";	function ntb_init(){eval(windowOnload)};</script></head>');	
  printWin.document.write('<BODY BGCOLOR=#ffffff onload="print();"><p>'+printText+'</p>');
  printWin.document.write('<style>#Print{display:none;}</style></body></html>')
  printWin.document.close();	
// If we are on NetScape, we can bring the window to the front
// YG 31-03-2006 fix condition not == but !=
	if (navigator.appName.substring(0,8) != "Netscape") printWin.focus();
}


		


function URLEncode(URLstring)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var plaintext = URLstring;
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for

	encoded;
	return encoded;
}



function printNewWindow(sTitle, sImageUrl) {
// specify window parameters
printWin = window.open("", "Zoom", "width=425,height=500,status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40");

// wrote content to window
printWin.document.write('<head>');
printWin.document.write('<title>Koninklijk Kabinet van Schilderijen Maurithuis</title>');
printWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
printWin.document.write('<link href="mauritshuis.css" rel="stylesheet" type="text/css">');
printWin.document.write('<script language="JavaScript1.2" src="sites/MHS/js/scripts.js"></script>');
printWin.document.write('</head>');
printWin.document.write('<body bgcolor="#C9D6EE" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
printWin.document.write('<table width="405" height="405" border="0" align="center" cellpadding="10" cellspacing="0">');
printWin.document.write('  <tr>');
printWin.document.write('    <td align="center" valign="middle"><table width="385" border="0" cellspacing="0">');
printWin.document.write('        <tr> ');
printWin.document.write('          <td align="left" valign="top"><span class="kop-collectie">'+sTitle+'</span>&nbsp; </td>');
printWin.document.write('        </tr>');
printWin.document.write('        <tr> ');
printWin.document.write('          <td align="center" valign="middle" class="schilderij-groot-kader">');
printWin.document.write(' 				<img src="'+sImageUrl+'" border="0" />');
printWin.document.write(' 			</td>');
printWin.document.write('        </tr>');
printWin.document.write('        <tr>');
printWin.document.write('          <td align="left" valign="top" class="schilderij-details-navkader">');
printWin.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
printWin.document.write('              <tr align="left" valign="top"> ');
printWin.document.write('                <td colspan="2"><span class="subtekst2"></span></td>');
printWin.document.write('              </tr>');
printWin.document.write('            </table>');
printWin.document.write('          </td>');
printWin.document.write('        </tr>');
printWin.document.write('     </table></td>');
printWin.document.write('  </tr>');
printWin.document.write('</table>');
printWin.document.write('</body>');
printWin.document.write('</html>');
printWin.document.close();	
// If we are on NetScape, we can bring the window to the front
// YG 31-03-2006 fix condition not == but !=
	if (navigator.appName.substring(0,8) != "Netscape") printWin.focus();
}

function printPers(sTitle, sImageUrl) {

// specify window parameters
printWin = window.open("", "Zoom", "width=425,height=500,status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40");

// wrote content to window
printWin.document.write('<head>');
printWin.document.write('<title>Koninklijk Kabinet van Schilderijen Maurithuis</title>');
printWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
printWin.document.write('<link href="mauritshuis.css" rel="stylesheet" type="text/css">');
printWin.document.write('<script language="JavaScript1.2" src="sites/MHS/js/scripts.js"></script>');
printWin.document.write('</head>');
printWin.document.write('<body bgcolor="#D7E0BE" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
printWin.document.write('<table width="405" height="405" border="0" align="center" cellpadding="10" cellspacing="0">');
printWin.document.write('  <tr>');
printWin.document.write('    <td align="center" valign="middle"><table width="385" border="0" cellspacing="0">');
printWin.document.write('        <tr> ');
printWin.document.write('          <td align="left" valign="top"><span class="kop-kantoor">'+sTitle+'</span>&nbsp; </td>');
printWin.document.write('        </tr>');
printWin.document.write('        <tr> ');
printWin.document.write('          <td align="center" valign="middle" class="kantoor-groot-kader">');
printWin.document.write(' 				<img src="'+sImageUrl+'" border="0" />');
printWin.document.write(' 			</td>');
printWin.document.write('        </tr>');
printWin.document.write('        <tr>');
printWin.document.write('          <td align="left" valign="top">');
printWin.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
printWin.document.write('              <tr align="left" valign="top"> ');
printWin.document.write('                <td colspan="2"><span class="subtekst2"></span></td>');
printWin.document.write('              </tr>');
printWin.document.write('            </table>');
printWin.document.write('          </td>');
printWin.document.write('        </tr>');
printWin.document.write('     </table></td>');
printWin.document.write('  </tr>');
printWin.document.write('</table>');
printWin.document.write('</body>');
printWin.document.write('</html>');
printWin.document.close();	
// If we are on NetScape, we can bring the window to the front
	// YG 31-03-2006 fix condition not == but !=
	if (navigator.appName.substring(0,8) != "Netscape") printWin.focus();
}


function printWindowBezoek(sTitle, sImage, article) {
if(printWin!=null)
{
	printWin.close();
}
// specify window parameters
printWin = window.open("", "mhs_winkel", "width=425,height=500,status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40");

// wrote content to window
printWin.document.writeln('<html>');
printWin.document.writeln('<head>');
printWin.document.writeln('<title>Koninklijk Kabinet van Schilderijen Maurithuis</title>');
printWin.document.writeln('<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />');
printWin.document.writeln('<link href="mauritshuis.css" rel="stylesheet" type="text/css">');
//printWin.document.writeln('<script language="JavaScript1.2" src="sites/MHS/js/scripts.js"></script>');
printWin.document.writeln('</head>');
printWin.document.writeln('<body bgcolor="#F1E9B2" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
printWin.document.writeln('<table width="405" height="405" border="0" align="center" cellpadding="10" cellspacing="0">');
printWin.document.writeln('  <tr>');
printWin.document.writeln('    <td align="center" valign="middle"><table width="385" border="0" cellspacing="0">');
printWin.document.writeln('        <tr> ');
printWin.document.writeln('          <td align="left" valign="top"><span class="kop-bezoek">'+deEscape(sTitle)+'</span>&nbsp; </td>');
printWin.document.writeln('        </tr>');
printWin.document.writeln('        <tr> ');
printWin.document.writeln('          <td align="center" valign="middle" class="winkel-groot-kader">');
printWin.document.writeln(' 				' + unescape(sImage) + '');
printWin.document.writeln(' 			</td>');
printWin.document.writeln('        </tr>');
printWin.document.writeln('                <tr><td height="20" align="left" valign="bottom"><a href="javascript:opener.AddTobasket(' + article + ');this.close();" class="link-bezoek">Bestel</a></td></tr>');
printWin.document.writeln('     </table></td>');
printWin.document.writeln('  </tr>');
printWin.document.writeln('</table>');
printWin.document.writeln('</body>');
printWin.document.writeln('</html>');
printWin.document.close();	
// If we are on NetScape, we can bring the window to the front
// YG 31-03-2006 fix condition not == but !=
	if (navigator.appName.substring(0,8) != "Netscape") { 
		printWin.focus();
	}
}

function deEscape(stringValue) {
	var str_Output = unescape(decodeURI(stringValue));
	return str_Output.replace(/\+/gi, ' ');
}


