/*
** Support function for loading XML
*/


var globalpath = '';
var hrefpath = '';
var displaystate = '';
var displayregion = '';
var metadivname = '';
var xmlloaded = false;

function importXML( cszPathName )
{
	var 	xmlDoc;
		  
	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);	
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
		    if (xmlDoc.readyState == 4) if (typeof(createTable) == 'function') createTable();
		};
 	}
	else
	{
		alert('iXML:: Your browser can\'t handle this script');
		return;
	}

	xmlDoc.async=false;
	xmlDoc.load(cszPathName);
		
	return (xmlDoc);
}

var req;

function httpRetrieveXML(url) {
	req = false;
    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest && !(window.ActiveXObject)) {
    	try {
			req = new XMLHttpRequest();
        } catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
		}
    }
	if(req) {
		req.onreadystatechange = processReqChange;
		req.open("GET", url, true);
		req.send("");
	}
}
function processReqChange() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            CThriftyMap._xmlLoaded(req.responseXML);
        } else {
            alert("There was a problem retrieving the XML data:\n" +
                req.statusText);
        }
    }
}

var CThriftyMap =
{
	/* CONSTANTS: Don't modify elsewhere */
	DISPLAY_MODE_NORMAL: 		0,
	DISPLAY_MODE_SPECIALS: 		1,
	DISPLAY_MODE_LOCATIONS: 	2,
//	DISPLAY_MODE_SHORTBREAKS:	0,
	DISPLAY_MODE_SHORTBREAKS:	3,
	
	load: function(iDisplayMode, mappath, pagedepth)
	{		
		if (mappath) {
		    globalpath = mappath;
		    hrefpath = mappath;
		}
		if (pagedepth) {
		    globalpath = pagedepth + globalpath;
		}
		
		// This should be overridable
		//this.oXML = importXML(globalpath + "../common/maps/xml/thrifty-maps.xml");
		httpRetrieveXML(globalpath + "../common/maps/xml/thrifty-maps.xml");
		
    	this.szCurrent = "australia";
	
		// Region locking
		this.bLocked = false;
		
		this.iDisplayMode = (iDisplayMode ? iDisplayMode : this.DISPLAY_MODE_NORMAL);
	},
	
    _xmlLoaded: function(theXML)
    {
        this.oXML = theXML;
        xmlloaded = true;
        if (displaystate != '' || displayregion != ''){
            this.display(displaystate, displayregion);
		}
        if (metadivname != '') {
            this.modifyMeta(metadivname);
		}
    },    

    _delayed_display: function(cszName, cszRegion)
    {
        displaystate = cszName;
        displayregion = cszRegion;
        if (xmlloaded) 
            this.display(displaystate, displayregion);
    },
    _delayed_modifyMeta: function(divname)
    {
        metadivname = divname;
        if (xmlloaded)
            this.modifyMeta(metadivname);
    },
    /*
	** HTML node management
	*/
	
	_getImagePath: function( szName)
	{
		if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS &&
			szName=="nsw_state")
		{
			szName = "nsw_v2_state_loc";
		}
		
		return globalpath + "../common/maps/img/" + szName + ".gif";
	},
	
	_deployBkgMap: function( szName )
	{
		// Get the parent map node		
		oMapNode = document.getElementById("dynMap");
		
		var oNew = document.createElement('IMG');
		
  		oNew.setAttribute('id',"idMap");
		oNew.setAttribute('src',this._getImagePath( szName ));
		oNew.setAttribute('usemap', "#mRegions", 0); // 0 for case insensitivity
		oMapNode.appendChild(oNew);
		//alert(document.getElementById("idMap").width);
	},	
	
	highlightRegion: function( szName )
	{
		document.getElementById("idMap").src = this._getImagePath( szName );			
	},
	
	highlightRegionLock: function ( szName )
	{
		this.bLocked=true; 
		document.getElementById("idMap").src = this._getImagePath( szName );
		
		var oRoot = this._iMap_findRegion( szName );		
		document.getElementById("dynLabel").innerHTML = oRoot.attributes.getNamedItem("alt").value;								
	},

	_clearArea: function(cszName)
	{
		var aRemoveList = new Array();
		
		szName = cszName ? cszName : "dynMap";
		
		oMapNode = document.getElementById(szName);
		
		for (i=0, oCur = oMapNode.firstChild; oCur; oCur = oCur.nextSibling)
		{
			// Remove image and MAP tags
			if (oCur.tagName == "IMG" || oCur.tagName == "MAP" || oCur.tagName == "A" || oCur.tagName == "P")
			{
				aRemoveList[i] = oCur;
				i++;
			}
		}
		
		for (i=0; i< aRemoveList.length; i++)
		{
			oMapNode.removeChild(aRemoveList[i]);
		}
		
		return oMapNode;
	},	
	
	/*
	** Back icons
	*/
	
	_BackIcons_deploy: function( oParent )
	{
		if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS ||
			this.iDisplayMode == this.DISPLAY_MODE_SHORTBREAKS) {
			return;
		}
			
		aParents = new Array();
		oNewElementAs = new Array();
		oNewElementIs = new Array();
		
		for (i=0, oCur = oParent.parentNode; oCur.parentNode; oCur = oCur.parentNode)
		{
			if (oCur.attributes.getNamedItem("name"))
			{
				aParents[i] = oCur;				
				i++;
			}
		}
		
		aParents.reverse();
		
		oMapNode = this._clearArea("dynMiniMaps");		
		
		oMapNode.style.display="none";
				
		for (i =0; i < aParents.length; i++)
		{			
			oMapNode.style.display="block";
			
			// Make the link
			oNewElementAs[i] = document.createElement('A');
			oNewElementAs[i].setAttribute('href', "#");
			oNewElementAs[i].setAttribute('id', aParents[i].attributes.getNamedItem("name").value);
			
			if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS)
			{
				oNewElementAs[i].onclick=function() { 
														CThriftyMap.bLocked=false;
														
														CThriftyMap.display(this.id); this.blur(); 
														
														oSEO = document.getElementById("dynDefault");
			
														if (oSEO)
															oSEO.style.display="block";
														
														oRegionList = document.getElementById("dynRegions");
														
														if (oRegionList)
															oRegionList.style.display="none";
															
														oRegionList = document.getElementById("dynResults");
														
														if (oRegionList)
															oRegionList.innerHTML = "";
															
														if (this.id == "australia")
															CThriftyMap._iMap_showSEO();
														return false;
													}
			}
			else
			{
				oNewElementAs[i].onclick=function() { CThriftyMap.display(this.id); this.blur(); return false; }
			}
			
			// ...and the image
			oNewElementIs[i] = document.createElement('IMG');
			
			if (aParents[i].attributes.getNamedItem("icon"))
			{
				szImgName = i > 0 ? "icon_nsw" : aParents[i].attributes.getNamedItem("icon").value;
				
				oNewElementIs[i].setAttribute('src',globalpath + "../common/maps/img/" + szImgName + ".gif");
			}
		
			oMapNode.appendChild(oNewElementAs[i]); 
			oNewElementAs[i].appendChild(oNewElementIs[i]);
		}
	},
	
	/*
	** Image map manager procedures
	*/
	
	_iMap_begin: function()
	{
		// Get the parent map node			
		oMapNode = document.getElementById("dynMap");
		
		var oNew = document.createElement('MAP');
		
  		oNew.setAttribute('name',"mRegions",0);
		oNew.setAttribute('id',"mRegions",0);
		
		oMapNode.appendChild(oNew); 
	},
	
	_iMap_end: function()
	{
		//document.write("</map>");
	},
	
	// Gets the location and popup HTML, sans the div.cRow wrapper
	// This is where the Specials will go
	_getLocationHTML: function( oLocation )
	{
		var szRet = "<div class=\"cCol modNarrow\">"+
						"<a href=\"#\" onclick=\"CPopupManager.onClick(this); return false;\">"+
						oLocation.attributes.getNamedItem("name").value +
						"</a>"+
						""+
						"<div class=\"cPopup modSelect\" style='margin-left:-18px'>"+
							"<div class=\"cTopSection\">"+
							"</div>"+
							"<div class=\"cContentSection\">"+
								"<div class=\"cCloseLink\">"+
									"<a href=\"#\" onclick=\"CPopupManager.closeSpecific(this); return false;\">X</a>"+
								"</div>"+
								"<div class=\"cContainer\">"+
								   "<p><strong>Location</strong>"+
								   "<br />"+
								   oLocation.attributes.getNamedItem("name").value +
								   "</p>"+
								   "<p><strong>Address</strong>"+
								   "<br />"+
								   oLocation.attributes.getNamedItem("address").value +
								   "</p>"+
								   "<p><strong>Phone</strong>"+
								   "<br />"+
								   oLocation.attributes.getNamedItem("phone").value +
								   "</p>"+
								"</div>"+
							"</div>"+
							"<div class=\"cBottomSection\"></div>"+
					  "</div>"+
					"</div>"+
					"<div class=\"cCol\">"+
						"Quote &amp; book"+
					"</div>";
												
		return szRet;												
	},
	
	_clearClassedDivs: function( oRegions, szClass )
	{
		aRemoveList = new Array();
		
		for (i=0, j=0, oCurrent = oRegions.firstChild; oCurrent; oCurrent = oCurrent.nextSibling)
		{
			if (oCurrent.tagName == "DIV")
			{
				if (i <2)
					i++;
				else
				{
					aRemoveList[j] = oCurrent;
					j++;					
				}
			}
		}
		
		for (i=0; i< aRemoveList.length; i++)
		{
			oRegions.removeChild(aRemoveList[i]);
		}
	},
	
	_iMap_hideSEO: function()
	{
		oSEO = document.getElementById("dynRegionsShow");
			
		if (oSEO)
			oSEO.style.display="none";
	},
	
	_iMap_showSEO: function()
	{
		oSEO = document.getElementById("dynRegionsShow");
			
		if (oSEO)
			oSEO.style.display="block";
	},
	
	// This will be used for adding regions to the bottom list later
	_iMap_displayLocations: function( oRegion )
	{
			// Hide the default SEO data
			this._iMap_hideSEO();

			oRegionList = document.getElementById("dynRegions");
			
			// Clear the list
			this._clearClassedDivs(oRegionList, "cRow");
			
			oRegionList.style.display="block";						
            //var selectState;
            //selectState = oRegion.attributes.getNamedItem("name").value;
            //alert (oRegion.attributes.getNamedItem("name").value);
    
			showlocs(oRegion.attributes.getNamedItem("name").value);
			return;
		    	
			aLocations = oRegion.getElementsByTagName("location");
			
			var oRow = new Array();
			
			if (aLocations.length == 0)
			{
				oRow[0] = document.createElement('DIV');
				oRow[0].className="cRow";
				oRow[0].innerHTML = "No locations found.";
				
				oRegionList.appendChild(oRow[0]);
				
				return;
			}						
			
			for (i=0; i < aLocations.length; i++)
			{				
				oRow[i] = document.createElement('DIV');
				
				szHTML = this._getLocationHTML( aLocations[i] );
				
				oRow[i].className="cRow";				
				
				oRegionList.appendChild(oRow[i]);
			}
	},

	_iMap_getClickFunction: function( oRegion )
	{
		if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS)
		{	
		    if (oRegion && oRegion.attributes) 
		    {
			    if (oRegion.attributes.getNamedItem("locations_link")) 
			    {
				return function() 
				{
				    szText = oRegion.attributes.getNamedItem("locations_link").value;
				    setTimeout("location.href = '"+hrefpath+szText+"';", 50 ); return;
				}
		            }
		        
			if (oRegion.attributes.getNamedItem("large") && oRegion.attributes.getNamedItem("large").value == "nsw_state")
			{				
				return function() { 															
							if (oRegion.attributes.getNamedItem("large").value == "sydney_00") //hackattack
							{												
								CThriftyMap.display("nsw_sydsurrounds"); return false; this.blur();
							}

							szText = oRegion.attributes.getNamedItem("locations_link").value;											
							setTimeout("location.href = '"+hrefpath+szText+"';", 50 ); return;  
						}
			}
		    }

			return function() { 
		    		CThriftyMap._iMap_displayLocations( oRegion ); 
					CThriftyMap.highlightRegion(oRegion.attributes.getNamedItem("name").value ); 
					CThriftyMap.bLocked=true; 
					this.blur(); 

					oLabel = document.getElementById("dynLabel");

					if (oLabel)
					{
						oLabel.innerHTML = oRegion.attributes.getNamedItem("alt").value;											
					}
					
					if (oRegion.attributes.getNamedItem("name").value == "nsw_sydney-and-surrounds" ||
						oRegion.attributes.getNamedItem("name").value == "nsw_other-nsw")
					{
						document.getElementById("dynNSWS").style.display = "none";
						document.getElementById("dynRegions").style.display="block";
					}
				}
		}
		else if (this.iDisplayMode == this.DISPLAY_MODE_SHORTBREAKS)
		{	
			if (oRegion && oRegion.attributes) 
			{
				return function() { 	szText = oRegion.attributes.getNamedItem("sb_link").value;											
							setTimeout("location.href = '"+hrefpath+szText+"';", 50 ); return;  }
			}
		}

		// If there's a large map for the entry, then set the click through		
		if ( oRegion.attributes.getNamedItem("large"))
		{
			if (this.iDisplayMode == this.DISPLAY_MODE_SPECIALS)
			{
				return function() { 	szText = oRegion.attributes.getNamedItem("specials_link").value; 											
											setTimeout("location.href = '"+hrefpath+szText+"';", 50 ); return;  }
			}
			else if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS)
			{
				return function() { 		if (oRegion.attributes.getNamedItem("large").value == "sydney_00") //hackattack
											{												
												CThriftyMap.display("nsw_sydsurrounds"); return false; this.blur();
											}

											szText = oRegion.attributes.getNamedItem("locations_link").value;											
											setTimeout("location.href = '"+hrefpath+szText+"';", 50 ); return;  }
			}
			else
			{
				return function() { CThriftyMap.display(oRegion.attributes.getNamedItem("name").value); return false; this.blur(); }
			}
		}
		else
		{	
			return function() { this.blur(); }
		}	
	},
	
	_iMap_writeRegion: function( oRegion )
	{		
		// Get the parent node of the image map	
		oMapNode = document.getElementById("mRegions");
		
		var oNew = document.createElement('area');
		
  		oNew.setAttribute('shape',"poly");
		oNew.setAttribute('onmouseover',"CThriftyMap.highlightRegion('" + oRegion.attributes.getNamedItem("name").value + "');");
		oNew.setAttribute('coords',oRegion.attributes.getNamedItem("coords").value);
		oNew.setAttribute('href',"#");		
		oNew.setAttribute('alt',oRegion.attributes.getNamedItem("alt").value);
		oNew.setAttribute('id', this.iRgnCount);
		
		oNew.onmouseover=function() { 		
			if (CThriftyMap.bLocked)
				return;

			CThriftyMap.highlightRegion(oRegion.attributes.getNamedItem("name").value ); 
			
			// Remove to use label
			//return;

			oLabel = document.getElementById("dynLabel");

			if (oLabel)
			{
				oLabel.innerHTML = oRegion.attributes.getNamedItem("alt").value;											
			}

									}
		
		// If there's a large map for the entry, then set the click through		
		//oNew.onclick=function() { CThriftyMap._iMap_getClickFunction( oRegion ); return false; }
		oNew.onclick=this._iMap_getClickFunction( oRegion );
						
		oMapNode.appendChild(oNew);								
	},
	
	_iMap_getRegions: function( oParent )
	{
		var			aRegions = new Array();
		
		// Go only one level down
		for (oRegions = oParent.firstChild, i=0; oRegions; oRegions = oRegions.nextSibling)
		{					
			if (oRegions.tagName == "region")
			{						
				aRegions[i] = oRegions;
				i++;
			}
		}
		
		return aRegions;
	},
	
	_iMap_deploy: function( oParent )
	{			
		aRegions = this._iMap_getRegions( oParent );
		
		if (!aRegions.length)
			return;				
		
		// Create the image map		
		this._iMap_begin();
				
		if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS)
			this.iRgnCount=1;
			
		// Get the parent node of the image map	
		oMapNode = document.getElementById("mRegions");
		
		if (oParent.attributes.getNamedItem("outside"))
		{
			var oNew = document.createElement('area');

			oNew.setAttribute('shape',"poly");
			oNew.setAttribute('onmouseover',"if (!CThriftyMap.bLocked) CThriftyMap.highlightRegion('australia'); document.getElementById('dynLabel').innerHTML = 'Click on a state to explore';");
			oNew.setAttribute('coords',oParent.attributes.getNamedItem("outside").value);	
			oMapNode.appendChild(oNew);
		}
			
		// Go only one level down
		for (i=0; i < aRegions.length; i++)
		{					
			this._iMap_writeRegion( aRegions[i] );
		}
		
	
		this._iMap_end();
	},
	
	_iMap_findRegion: function( szName )
	{
		var aList = this.oXML.getElementsByTagName('region');
				
		for (x=0; x < aList.length; x++)
		{			
			if (aList[x].attributes.getNamedItem("name").value == szName)
			{
				return aList[x];
			}
		}
		
		return null;
	},
	
	getElementsIn: function( szParentID, szElementName )
	{
		var oRoot2 = document.getElementById(szParentID);
		return oRoot2.getElementsByTagName(szElementName);
	},
	
	/* 
	** Called for short breaks, to rebuild the "car rental ..." blocks
	*/
	
	constructMeta: function( szRegionName, szID )
	{				
		var aNewLinks = new Array();
		var aNewPs = new Array();

		oPContainer = document.getElementById(szID);

		// Now repopulate the list
		var oState = this._iMap_findRegion( szRegionName );
		aRegions = this._iMap_getRegions( oState );

		if (!aRegions.length)
			return;				

		// Go only one level down
		for (i=0; i < aRegions.length; i++)
		{					
			//alert(aRegions[i].attributes.getNamedItem("alt").value);
			aNewPs[i] = document.createElement('P');
			
			aNewLinks[i] = document.createElement('A');
			aNewLinks[i].setAttribute('href', "#");	
			aNewLinks[i].setAttribute('title', aRegions[i].attributes.getNamedItem("name").value);
			aNewLinks[i].innerHTML = "" + aRegions[i].attributes.getNamedItem("alt").value;
			
			aNewLinks[i].onclick = this._iMap_getClickFunction( this._iMap_findRegion(aRegions[i].attributes.getNamedItem("name").value) );
			
			aNewLinks[i].onmouseover = function() 
			{
							CThriftyMap.highlightRegion(this.title ); 					

							oLabel = document.getElementById("dynLabel");

							if (oLabel)
								oLabel.innerHTML = CThriftyMap._iMap_findRegion(this.title).attributes.getNamedItem("alt").value;											
			}
			
			aNewPs[i].appendChild(aNewLinks[i]);
			oPContainer.appendChild(aNewPs[i]);								
		}
	},
	
	modifyMeta: function( szID )
	{		
		var oParagraphs = this.getElementsIn(szID, 'P');
		
		var aNewLinks = new Array();
		
		for (i=0; i < oParagraphs.length; i++)
		{					
			if (this.szBkg && oParagraphs[i].title == "nsw_" + this.szBkg)
				continue;
				
			if (oParagraphs[i].title)
			{
				aNewLinks[i] = document.createElement('A');
				aNewLinks[i].setAttribute('href', "#");
				aNewLinks[i].setAttribute('title', oParagraphs[i].title);
				aNewLinks[i].innerHTML = oParagraphs[i].innerHTML;
				
				oParagraphs[i].innerHTML="";
								
				if (!this.bLocked && oParagraphs[i].title != "au")
				{
					aNewLinks[i].onmouseover = function() 
					{
						CThriftyMap.highlightRegion(this.title ); 					
						
						oLabel = document.getElementById("dynLabel");
		
						if (oLabel)
							oLabel.innerHTML = CThriftyMap._iMap_findRegion(this.title).attributes.getNamedItem("alt").value;											
					}
					
					if (szName == "australia")
					{
						aNewLinks[i].onmouseout = function() 					
						{
							if (!CThriftyMap.bLocked) CThriftyMap.highlightRegion('australia'); document.getElementById('dynLabel').innerHTML = 'Click on a state to explore';
						}
					}
				}
					
				aNewLinks[i].onclick = this._iMap_getClickFunction( this._iMap_findRegion(oParagraphs[i].title) );			
				
				oParagraphs[i].appendChild(aNewLinks[i]);				
			}
		}
	},
	
	/*
	** Restore the default page
	*/
	
	restore: function()
	{
		this._iMap_showSEO();
		
		oRegionList = document.getElementById("dynRegions");
					
		oRegionList.style.display="none";
		
		document.getElementById("dynResults").style.display="none";
		
		document.getElementById("dynLabel").innerHTML = "Click on a state to explore";
		
		this.bLocked=false;
		
		this.display();
		
		if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS)
		{				
			document.getElementById("dynNSWS").style.display = "none";
		}
	},
	
	/*
	** Preloader
	*/
	
	displayPreloader: function(szID)
	{
		var aRegions = this.oXML.getElementsByTagName('region');
		
		oContainer = document.getElementById( szID );
		
		if (!oContainer)
			return;
		
		for (oNewImg = new Array(), i=0; i < aRegions.length; i++)
		{
			oNewImg[i] = document.createElement('IMG');
		
  			oNewImg[i].setAttribute('src',this._getImagePath( aRegions[i].attributes.getNamedItem("name").value ));
			
			oContainer.appendChild(oNewImg[i]);
		}
	},
	
	/*
	** Display
	*/
	
	display: function(cszName, cszRegion)
	{

		this._clearArea();		
		szName = (cszName) ? cszName : "australia";
		szState = (szName == "australia") ? "" : szName;
		szRegion = (cszRegion) ? cszRegion : "";
		    
			    
		if (szName != "australia" && this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS)
			this._iMap_hideSEO();
		//FH:
		//if (szName != "australia" && this.iDisplayMode == this.DISPLAY_MODE_SPECIALS)
			//this._iMap_hideSEO();
		//FH:END
		// For zoomin (NSW)
		if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS)
		{
			this.szBkg = cszRegion;
			
			if (szState == "nsw")
			{
				this.modifyMeta("dynNSWS");
				document.getElementById("dynNSWS").style.display = "block";
				document.getElementById("dynLabel").innerHTML = "Click on a region in New South Wales";
				document.getElementById("dynRegions").style.display="none";
			}
			else
			{
			    szName = "australia";
			}
		}
		//FH:
		if (this.iDisplayMode == this.DISPLAY_MODE_SPECIALS || (this.iDisplayMode == this.DISPLAY_MODE_SHORTBREAKS && cszName == 'act'))
		{
			this.szBkg = cszRegion;
		    szName = "australia";
		}
		//FH:END
		
		var oRoot = this._iMap_findRegion( szName );			

		// Change the top level image
		this._deployBkgMap(oRoot.attributes.getNamedItem("large").value);
		
		// Throw in the image map
		this._iMap_deploy(oRoot);

		
		// show the 'back' icons
		this._BackIcons_deploy(oRoot);		

		if (this.iDisplayMode == this.DISPLAY_MODE_LOCATIONS)
		{ 
		    if (szState == "nsw") {
	    	    if (szRegion != "") {
	    	        szRegion = szState + "_" + szRegion;
                    this.highlightRegionLock( szRegion );
                    this._iMap_displayLocations( this._iMap_findRegion( szRegion ) );
	            }
	        }

		    else if (szState != "") {
                this.highlightRegionLock( szState );
                this._iMap_displayLocations( this._iMap_findRegion( szState ) );
		    }
		}
	//FH:
		if (this.iDisplayMode == this.DISPLAY_MODE_SPECIALS)
		{ 
		    if (szState != "") {
                this.highlightRegionLock( szState );
				this._iMap_showSEO();
		    }
		}
		if (this.iDisplayMode == this.DISPLAY_MODE_SHORTBREAKS)
		{ 
			if (szState == "act") {
				this.highlightRegionLock( szState );
				this._iMap_showSEO();
			} else {
				if (szState != "") {
					this.constructMeta( szState, "dynRegionsShow" )
				}
				if (cszRegion != "" && cszRegion != undefined) {
					this.highlightRegionLock( cszRegion );
				}
			}

		}		
	//FH:END
	},
	
	goback: function()
	{
	    	if (hrefpath == '') return;
        	setTimeout("location.href = '"+hrefpath+"';", 50 ); return;	    
	}
	
}
