
function PopupWindow(sLink, sText)
{
	window.open(sLink, "test","height=460,width=660");
}

//
// This function writes a five column row in HTML. It is intended for use
// with the price lines in the houses for rent pages
// Col1 to Col5 are named after the contents they have in drenthe.html and friesland.html
//
function writePriceRow(dtFrom, dtTo, amtMid, amtWeekend, amtWeek, vRemark)
{

	document.write("<tr style=\"cursor:auto\">");


	writeCell(dtFrom, 1);
	writeCell(dtTo, 2);
	writeCell(amtMid, 3);
	writeCell(amtWeekend, 4);
	if (amtWeek != undefined)
		writeCell(amtWeek, 5);
	if (vRemark != undefined)
		writeCell(vRemark, 6);

	document.write("</tr>");
}
function writeCell(vText, vCol)
{

	//Writes a cell for the pricelist
	var vTD, vTD_Close, vNoValue;

	vTD_Close = "</td>";

	// Empty value means: keep cell blue
	if(vText == "leeg")
	{
		vText = "&nbsp;";
	}

	// Act on numeric value
	if(!isNaN(vText))
	{
		// It's a number, add euro sign
		if(vText == 0)
		{
			vNoValue = true;
		}
		vText = "&euro; " + vText;
	}

	// Apply grey cell, or normal blue cell.
	if(vNoValue == true)
	{
		vTD = "<td align=\"center\" class=\"pl-cell\" bgcolor=\"#CBDAE2\">";
		vText = "&nbsp;";		
	}
	else
	{
		vTD = "<td align=\"center\" class=\"pl-cell\">";
	}
	document.write(vTD + vText + vTD_Close);
}

/////////////////////////////////////////////////////////////////////////
// 
// Below some scripts that are taken from the website
// http://www.jsr.communitech.net/dissolve.htm
// I've changed them to accomodate my own needs.
// 
// Note: the global variables are needed for correct functioning
//
/////////////////////////////////////////////////////////////////////////

var sponsor = 1;  	// global variable for current sponsor (Don't change this!)
var go = 1;       	// tells the banner if to rotate

var max = 3;     	// number of banners

var url1 = "index-vakantie.html";
var url2 = "index-vakantie.html";
var url3 = "index-vakantie.html";

var text1 = "Vakantie in de zomer in Alkmaar";
var text2 = "Vakantie het hele jaar door in Friesland";
var text3 = "Vakantie het hele jaar door in Drenthe";

//
// Links to appropriate sponsor
// This function can be used when you want a different targetlink for each picture
//
function GoSponsor()
{
	location = eval("url" + sponsor);
}

// function to rotate image
function rotate()
{
	if (document.images)   // Only if the image object exists so no errors occur with IE 3.0
	{
		if (go)        // If cursor not on image
		{
			if (++sponsor > max) 
				sponsor = 1;
				
			dissolvePix(document.images['pic'], "images/vakantie-banner" + sponsor + ".jpg");
			window.setTimeout('rotate();',3500);
		}
		else          // If cursor on image, try to rotate later (refrain the image from changing)
		{
			window.setTimeout('rotate();',100);
		}
	}
}

// Displays text in the status bar about the current banner
function windowON()
{
	window.status = eval('text' + sponsor);
	setTimeout("windowOFF()",2000);			//Show the text for only 2 seconds
}

// Clears the status bar message
function windowOFF()
{
	window.status="";
}

// Checking for IE4 or higher
var RunningIE4 = (msieversion() >=4);

function msieversion() 
{
	var ua = window.navigator.userAgent
	var msie = ua.indexOf ( "MSIE " )
	if ( msie > 0 )		// is Microsoft Internet Explorer; return version number
		return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) )
	else
		return 0	// is other browser
}

function dissolvePix(picObj, imgfile)
{
	if(RunningIE4)
	{ 
		// This is for IE4 or later, and dissolves the images together using a visual filter.
		picObj.filters.revealTrans.Transition = Math.ceil((Math.random() * 20));
		picObj.filters.revealTrans.Apply();      
		picObj.src = imgfile;
		picObj.filters.revealTrans.Play();
	}
	else
	{
		picObj.src = imgfile;
	}
}

