// Declaratie globale variabele
//

/* ======================================================================
FUNCTION:         getArgs
functie:          Splitsen van meegegeven argumenten
                  Parameter:
Aangeroepen door: pr_*.htm, ld_*.htm;
====================================================================== */

function getArgs()
{
   var args=new Object();
   var query=location.search.substring(1);
   var pairs= query.split(",");
   for (var i=0; i<pairs.length; i++)
      {
      var pos=pairs[i].indexOf('=');
      if (pos==-1) continue;
      var argname=pairs[i].substring(0,pos);
      var value=pairs[i].substring(pos+1);
      args[argname]=unescape(value);
// * weer terug naar komma's
      args[argname]=args[argname].replace(/\*/g,",");
      }
return args;
}
var args=getArgs();

/* ======================================================================
FUNCTION:   GetRadioValue
====================================================================== */
function GetRadioValue( radioObject )
{
   var value = null;
   // Validate parameter value
   if (radioObject+"" == "undefined" || radioObject == null)
      return null;

   for (var i=0; i < radioObject.length; i++) {
      if (radioObject[i].checked) {
         value = radioObject[i].value;
         break;
      }
   } // end for loop

   return value;
}

/* ======================================================================
FUNCTION:   isBlank
====================================================================== */
function isBlank(s)
{
   for (var i=0; i<s.length;i++)
      {
      var c=s.charAt(i);
      if ((c!=" ") && (c !="\n") && (c !="\t")) return false;
      }
   return true;
}

/* ======================================================================
FUNCTION:   Jump
argument:   lang = taalkeuze (nl,en)
====================================================================== */
function Jump(lang)
{
loc=parent.boven.location.href;
isGuestbook=loc.lastIndexOf('dcguest');
//file=loc.substr(pos+1,loc.length);
//nieuw="..\/"+lang+"\/"+file;
if (lang=="nl") nieuw="n-adresregel.htm"
else            nieuw="e-adresregel.htm"
SetTaal(lang);
//if (parent.taal) parent.taal=lang;
if (isGuestbook==-1) {
  parent.boven.location.reload();
  }
else {
  if (lang=="nl") parent.boven.location.href="http://www.seasonsgalleries.nl/cgi-bin/dcguestv21/dcguest.cgi";
  else            parent.boven.location.href="http://www.seasonsgalleries.nl/cgi-bin/dcguestv21/edcguest.cgi";
  }
//alert(parent.taal);
document.location=nieuw;
}


function mailAdres(voor,na,naam,oms,subj) {
//
// Voorbeeld:
// <a href="mailto:Rederij Quo Vadis<info(apestaartje)de-liefde.nl>&SUBJECT=Aanvraag prijsinformatie catering (Engels)">Rederij Quo Vadis</a>
//
   var link="<a href=\'mailto:";
   if (naam) link+=naam+"<";
   link+=voor+"@"+na
   if (naam) link+=">";
   if (subj) link+="&subject="+subj;
   link+="\'>";
   if (oms) link+=oms
   else     link+=voor+"@"+na;
   link+="</a>";
//   alert(link);
   document.write(link);
}


/* ======================================================================
FUNCTION:         openVergroting
functie:          Toon vergroting van de foto
Parameter:        naamfoto(foto=...)
                  breedtefoto(w=...)
                  hoogtefoto(h=...)
Aangeroepen door: -
====================================================================== */
function openVergroting(imageName,imageWidth,imageHeight,tekst) {
// origineel: function JustSoPicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin)
// by E Michael Brandt of ValleyWebDesigns.com - Please leave these comments intact.
// version 2.1.8
// Aangepast door DJ 2001/2003

   alt="* * Klik om venster te sluiten * *"
   alttekst=tekst+", \n\nklik om venster te sluiten...";
   var imagePad = '../img/gr/'+imageName;
   var bgcolor = "ff0000";
   var hugMargin = "0";
   var hugger = "hug image";
// DJ
	var adj=10;
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){
	  byFactor = w / imageWidth;
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h;
	}

	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin + 40;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  }
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }

	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}

	var agt=navigator.userAgent.toLowerCase();
	var is_opera = (agt.indexOf("opera") != -1);

	if (is_opera == true){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imagePad;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {

	newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title>',CSSregel,'<body class="vergroting" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+imagePad+'" width='+imageWidth+'height='+imageHeight+' alt="'+alttekst+'" >');  // DJ
	newWindow.document.write('</td></tr><tr><td align="center"><table border="0" cellspacing="0" cellpadding="0" align="center"><tr><td align="right" valign="top"><IMG src="../img/diamant.gif" width="35" height="26" vspace="2" hspace="10" align="absmiddle"></td><td align="center">DiamantDirect.<i>nl</i></td></td></tr></table></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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 flevDivPositionValue(sDiv, sProperty) { // v2.1, Marja Ribbers-de Vroed, FlevOOware
	this.opera = (window.opera); // Opera 5+
	this.ns4 = (document.layers); // Netscape 4.x
	this.ns6 = (document.getElementById && !document.all && !this.opera); // Netscape 6+
	this.ie = (document.all);  // Internet Explorer 4+
    var sValue = ""; docObj = eval("MM_findObj('" + sDiv + "')"); if (docObj == null) {return 0;}
	if ((sProperty == "left") || (sProperty == "top")) {
		if (!this.ns4) {docObj = docObj.style;}
		sValue = eval("docObj." + sProperty);
		if ((this.ie) && (sValue == "")) { // IE (on PC) bug with nested layers
			if (sProperty == "top") { sValue = eval(sDiv + ".offsetTop"); }
			else { sValue = eval(sDiv + ".offsetLeft"); }
		};
	}
	else {
		if (this.opera) {
			docObj = docObj.style;
			if (sProperty == "height") { sValue = docObj.pixelHeight; }
			else if (sProperty == "width") { sValue = docObj.pixelWidth; }
		}
		else if (this.ns4) {sValue = eval("docObj.clip." + sProperty);}
		else if (this.ns6) {sValue = document.defaultView.getComputedStyle(docObj, "").getPropertyValue(sProperty); }
	    else if (this.ie) {
			if (sProperty == "width") { sValue = eval(sDiv + ".offsetWidth"); }
			else if (sProperty == "height") { sValue = eval(sDiv + ".offsetHeight"); }
		}
   	}
	sValue = (sValue == "") ? 0 : sValue;
	if (isNaN(sValue)) { if (sValue.indexOf('px') > 0) { sValue = sValue.substring(0,sValue.indexOf('px')); } }
	return parseInt(sValue);
}

function flevPersistentLayer() { // v3.3, Marja Ribbers-de Vroed, FlevOOware
	var sD = arguments[0], oD = eval("MM_findObj('" + sD + "')"), iWW, iWH, iSX, iSY, iT = 10, sS = "";
	if (!document.layers) {oD = oD.style;}
	if (oD.tmpTimeout != null) {clearTimeout(oD.tmpTimeout);}
	var sXL = arguments[1], sXC = arguments[2], sXR = arguments[3], sYT = arguments[4], sYC = arguments[5], sYB = arguments[6];
	var iS = (arguments.length > 7) ? parseInt(arguments[7]) : 0, iPx = (arguments.length > 8) ? parseInt(arguments[8]) : 0;
	if (window.innerWidth) { // NS4, NS6 and Opera
		var oW = window; iWW = oW.innerWidth; iWH = oW.innerHeight; iSX = oW.pageXOffset; iSY = oW.pageYOffset; }
	else if (document.documentElement && document.documentElement.clientWidth) { // IE6 in standards compliant mode
		var oDE = document.documentElement; iWW = oDE.clientWidth; iWH = oDE.clientHeight; iSX = oDE.scrollLeft; iSY = oDE.scrollTop; }
	else if (document.body) { // IE4+
		var oDB = document.body; iWW = oDB.clientWidth; iWH = oDB.clientHeight; iSX = oDB.scrollLeft; iSY = oDB.scrollTop; }
	else {return;}
	var iCX = iNX = flevDivPositionValue(sD, 'left'), iCY = iNY = flevDivPositionValue(sD, 'top');
	if (sXL != "") {iNX = iSX + parseInt(sXL);}
	else if (sXC != "") {iNX = Math.round(iSX + (iWW/2) - (flevDivPositionValue(sD, 'width')/2));}
	else if (sXR != "") {iNX = iSX + iWW - (flevDivPositionValue(sD, 'width') + parseInt(sXR));}
	if (sYT != "") {iNY = iSY + parseInt(sYT);}
	else if (sYC != "") {iNY = Math.round(iSY + (iWH/2) - (flevDivPositionValue(sD, 'height')/2));}
	else if (sYB != "") {iNY = iSY + (iWH - flevDivPositionValue(sD, 'height') - parseInt(sYB));}
	if ((iCX != iNX) || (iCY != iNY)) {
		if (iS > 0) {
			if (iPx > 0) { iT = iS;
				var iPxX = iPx, iPxY = iPx, iMX = Math.abs(iCX - iNX), iMY = Math.abs(iCY - iNY);
				// take care of diagonal movement
				if (iMX < iMY) {iPxY = (iMX != 0) ? ((iMY/iMX)*iPx) : iPx;}
				else {iPxX = (iMY != 0) ? ((iMX/iMY)*iPx) : iPx;}
				if (iPxX >= iMX) {iPxX = Math.min(Math.ceil(iPxX), iPx);}
				if (iPxY >= iMY) {iPxY = Math.min(Math.ceil(iPxY), iPx);}
				// temporary X/Y coordinates
				if ((iCX < iNX) && (iCX + iPxX < iNX)) {iNX = iCX + iPxX;}
				if ((iCX > iNX) && (iCX - iPxX > iNX)) {iNX = iCX - iPxX;}
				if ((iCY < iNY) && (iCY + iPxY < iNY)) {iNY = iCY + iPxY;}
				if ((iCY > iNY) && (iCY - iPxY > iNY)) {iNY = iCY - iPxY;} }
			else {
				var iMX = ((iNX - iCX) / iS), iMY = ((iNY - iCY) / iS);
				iMX = (iMX > 0) ? Math.ceil(iMX) : Math.floor(iMX); iNX = iCX + iMX;
				iMY = (iMY > 0) ? Math.ceil(iMY) : Math.floor(iMY); iNY = iCY + iMY; } }
		if ((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1) && (!window.opera)) {sS="px";}
		if (iMX != 0) {eval("oD.left = '" + iNX + sS + "'");}
		if (iMY != 0) {eval("oD.top = '" + iNY + sS + "'");} }
	var sF = "flevPersistentLayer('" + sD + "','" + sXL + "','" + sXC + "','" + sXR + "','" + sYT + "','" + sYC + "','" + sYB + "'," + iS + "," + iPx + ")";
	oD.tmpTimeout = setTimeout(sF,10);
}

function flevInitPersistentLayer() { // v3.3, Marja Ribbers-de Vroed, FlevOOware
	if (arguments.length < 8) {return;}
	var sD = arguments[0]; if (sD == "") {return;}
	var	oD = eval("MM_findObj('" + sD + "')"); if (!oD) {return;}
	var iCSS = parseInt(arguments[1]);
	var sXL = arguments[2], sXC = arguments[3], sXR = arguments[4], sYT = arguments[5], sYC = arguments[6], sYB = arguments[7];
	var iS = (arguments.length > 8) ? parseInt(arguments[8]) : 0, iPx = (arguments.length > 9) ? parseInt(arguments[9]) : 0;
	if (iCSS != 0) { if (!document.layers) {oD = oD.style;} sXL = parseInt(oD.left), sYT = parseInt(oD.top);}
	var sF = "flevPersistentLayer('" + sD + "','" + sXL + "','" + sXC + "','" + sXR + "','" + sYT + "','" + sYC + "','" + sYB + "'," + iS + "," + iPx + ")";
	eval(sF);
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_timelinePlay(tmLnName, myID) { //v1.2
  //Copyright 1997 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j];
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_timelineStop(tmLnName) { //v1.2
  //Copyright 1997 Macromedia, Inc. All rights reserved.
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  if (tmLnName == null)  //stop all
    for (var i=0; i<document.MM_Time.length; i++) document.MM_Time[i].ID = null;
  else document.MM_Time[tmLnName].ID = null; //stop one
}

function gb() {
   var link="http://ww";
   link+="w.kynokliq.";
   link+="nl/gast";
   link+="enboek/gast";
   link+="enboek";
   link+=".htm";
   document.location.href=link;
}

function MM_initTimelines() { //v4.0
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) == 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    var macIE5 = (navigator.platform ? (navigator.platform == "MacPPC") : false) && (navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4);
    document.MM_Time = new Array(1);
    document.MM_Time[0] = new Array(19);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 3;
    document.MM_Time[0][0] = new String("behavior");
    document.MM_Time[0][0].frame = 5;
    document.MM_Time[0][0].value = "MM_showHideLayers('LayPaw1','','show')";
    document.MM_Time[0][1] = new String("behavior");
    document.MM_Time[0][1].frame = 6;
    document.MM_Time[0][1].value = "MM_showHideLayers('LayPaw2','','show')";
    document.MM_Time[0][2] = new String("behavior");
    document.MM_Time[0][2].frame = 7;
    document.MM_Time[0][2].value = "MM_showHideLayers('LayPaw3','','show')";
    document.MM_Time[0][3] = new String("behavior");
    document.MM_Time[0][3].frame = 8;
    document.MM_Time[0][3].value = "MM_showHideLayers('LayPaw4','','show')";
    document.MM_Time[0][4] = new String("behavior");
    document.MM_Time[0][4].frame = 9;
    document.MM_Time[0][4].value = "MM_showHideLayers('LayPaw5','','show')";
    document.MM_Time[0][5] = new String("behavior");
    document.MM_Time[0][5].frame = 10;
    document.MM_Time[0][5].value = "MM_showHideLayers('LayPaw6','','show')";
    document.MM_Time[0][6] = new String("behavior");
    document.MM_Time[0][6].frame = 11;
    document.MM_Time[0][6].value = "MM_showHideLayers('LayPaw7','','show')";
    document.MM_Time[0][7] = new String("behavior");
    document.MM_Time[0][7].frame = 12;
    document.MM_Time[0][7].value = "MM_showHideLayers('LayPaw8','','show')";
    document.MM_Time[0][8] = new String("behavior");
    document.MM_Time[0][8].frame = 13;
    document.MM_Time[0][8].value = "MM_showHideLayers('LayPaw9','','show')";
    document.MM_Time[0][9] = new String("behavior");
    document.MM_Time[0][9].frame = 14;
    document.MM_Time[0][9].value = "MM_showHideLayers('LayPaw10','','show')";
    document.MM_Time[0][10] = new String("behavior");
    document.MM_Time[0][10].frame = 15;
    document.MM_Time[0][10].value = "MM_showHideLayers('LayPaw1','','hide')";
    document.MM_Time[0][11] = new String("behavior");
    document.MM_Time[0][11].frame = 16;
    document.MM_Time[0][11].value = "MM_showHideLayers('LayPaw2','','hide')";
    document.MM_Time[0][12] = new String("behavior");
    document.MM_Time[0][12].frame = 17;
    document.MM_Time[0][12].value = "MM_showHideLayers('LayPaw3','','hide')";
    document.MM_Time[0][13] = new String("behavior");
    document.MM_Time[0][13].frame = 18;
    document.MM_Time[0][13].value = "MM_showHideLayers('LayPaw4','','hide')";
    document.MM_Time[0][14] = new String("behavior");
    document.MM_Time[0][14].frame = 19;
    document.MM_Time[0][14].value = "MM_showHideLayers('LayPaw5','','hide')";
    document.MM_Time[0][15] = new String("behavior");
    document.MM_Time[0][15].frame = 20;
    document.MM_Time[0][15].value = "MM_showHideLayers('LayPaw6','','hide')";
    document.MM_Time[0][16] = new String("behavior");
    document.MM_Time[0][16].frame = 21;
    document.MM_Time[0][16].value = "MM_showHideLayers('LayPaw7','','hide')";
    document.MM_Time[0][17] = new String("behavior");
    document.MM_Time[0][17].frame = 22;
    document.MM_Time[0][17].value = "MM_showHideLayers('LayPaw8','','hide')";
    document.MM_Time[0][18] = new String("behavior");
    document.MM_Time[0][18].frame = 23;
    document.MM_Time[0][18].value = "MM_timelineStop()";
    document.MM_Time[0].lastFrame = 23;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
