	function createPopupWindow(PageAliasIN,URLIN,OptionsIN)
	{
		if (typeof OptionsIN == 'undefined') OptionsIN = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=361,height=580';
		//alert("Attempting to open a popup ("+PageAliasIN+") with URL:\n"+URLIN);

		window.open(URLIN, PageAliasIN, OptionsIN);

	}// createPopupWindow

	function zeroPad(NumIN, LengthIN)
	{ 
		var ZeropaddedOUT = NumIN + '';
		while(ZeropaddedOUT.length < LengthIN) 
		{
			ZeropaddedOUT = '0' + ZeropaddedOUT; 
		}
		return ZeropaddedOUT;
	}// zeroPad


	function getVirtualTourThumbnailContent(TourIDIN, TourLabelIN, ThumbnailIDIN, PackageIDIN, ParentURLIN)
	{
		if (typeof TourLabelIN == 'undefined') TourLabelIN      = 'Tour';	
		if (typeof ThumbnailIDIN == 'undefined') ThumbnailIDIN  = TourIDIN;	
		if (typeof PackageIDIN == 'undefined') PackageIDIN      = 358;	
		if (typeof ParentURLIN == 'undefined') ParentURLIN      = document.location.href;	

		var ContentOUT = '';
		var Link = "javascript: createPopupWindow('vt_"+TourIDIN+"','http://delivery.vrxstudios.com/18/virtualtours.htm?package="+PackageIDIN+"&id="+TourIDIN+"&id_type=2&locale=1&container=1&parentWindow="+ParentURLIN+"','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=361,height=580');";

		ContentOUT += "<div id=\"vt_"+TourIDIN+"_div\" style=\"float: left; padding: 5px;\" onmouseover=\"this.style.backgroundColor='white';\" onmouseout=\"this.style.backgroundColor='transparent'\" >\n";
		ContentOUT += "\t<a href=\""+Link+"\">\n";
		ContentOUT += "\t\t<img src='http://delivery.vrxstudios.com/media/images/thumbnails/"+zeroPad(ThumbnailIDIN,10)+".JPG' alt='click to open the virtual tour a new window' border=0><br>\n";
		ContentOUT += "\t\t<div style=\"height:5px; line-height:5px;\">&nbsp;</div>\n";
		ContentOUT += "\t\t<div style=\"height: 21px; width: 150px; overflow: hidden;\">\n";
		ContentOUT += "\t\t\t<img src='/images/icon_virtualtour.gif' alt='' border=0 style=\"float: left; margin-right: 5px;\">";
		ContentOUT += "\t\t\t<div style=\"float: left; font-size: 10px; width:120px; height: 18px; line-height: 9px; margin-top: 3px;\">"+TourLabelIN+"</div>\n";
		ContentOUT += "\t\t\t<div style=\"clear:both; line-height: 1px; height: 1px; width:1px;\"></div>\n";
		ContentOUT += "\t\t</div>\n";
		ContentOUT += "\t</a>\n";
		ContentOUT += "</div>\n";

		return ContentOUT;

	}// getVirtualTourThumbnailContent
