
	var bestinnerhtmled = false;
	var allinnerhtmled = false;
	var paneshowing = 'overview_content';	
	function contentselected(toshow)
	{	if (paneshowing != toshow) 
						{
							var thepane = document.getElementById(paneshowing);
							thepane.style.display = 'none';
						
							var thepane = document.getElementById(toshow);
							thepane.style.display = 'block';
							paneshowing = toshow;											
						}
	}	
	function showlistview()
	{					
						hidemap2();
						hidebestdeals();
						contentselected('please_wait_content');					
						setTimeout('showlistviewpt2()',10);
	}				
	function showlistviewpt2()
	{	
						var ListViewContent = document.getElementById('list_view_content');
						var existingcontent = document.getElementById('overviewhotels');
						ListViewContent.innerHTML = existingcontent.innerHTML;
						contentselected('list_view_content');
								
	}						
	function showoverview()
	{	
						hidemap2();
						hidebestdeals();
						contentselected('overview_content'); 
	}
	function showbestdeals()
	{	
						hidemap2();
						contentselected('please_wait_content');			
						setTimeout('showbestdealspt2()',100);
	}	
	function showbestdealspt2()
	{ 	
						if (!bestinnerhtmled)
						{
							showBestDeals();
							if (document.getElementById('best_deals_content').innerHTML != '')
							{
								bestinnerhtmled = true;
							}
						}
						contentselected('best_deals_content');				 					
	}										
	function showBestDeals()
	{		
		var bestdeals_content = document.getElementById('best_deals_content');
		var ifrm = frames["regiondeals"].document.getElementById('best_deals_content');
		if (ifrm)
		{
			bestdeals_content.innerHTML = ifrm.innerHTML;
			bestdeals_content.style.display = 'block';
		}else
		{
			setTimeout('showbestdeals()', 10);
		} 									
	}	
	
	function initshowBestDeals()
	{		
		
		var bestdeals_content = document.getElementById('best_deals_content');
			
		var ifrm = frames["regiondeals"].document.getElementById('best_deals_content');
		if (ifrm)
		{
			bestdeals_content.innerHTML = ifrm.innerHTML;
			bestdeals_content.style.display = 'block';
		}else
		{
			setTimeout('initshowBestDeals()',10);
		} 									
	}	
	
	function hidebestdeals()
	{
					var best = document.getElementById('best_deals_content');
					if (best)
					{
						best.style.display = 'none';
					}	
	}
				
	function showlivedeals()
	{	
						hidemap2();
						hidebestdeals();
						contentselected('please_wait_content'); 
						setTimeout('showlivedealspt2()',100);
	}													
	function showlivedealspt2()
	{	
		if (!allinnerhtmled)
		{
				var numhtlifrm = frames["regiondeals"].document.getElementById('numhotels');
							
				if (!numhtlifrm)
				{
					setTimeout('showlivedeals()',10)
				}
				else
				{
							var sz = numhtlifrm.innerHTML;
							
							for(var i = 0; i < sz; i=i+6)	
							{ 
								var spanId = 'live_deals_content' + i; 
								var spantag = document.createElement( 'span' );
								spantag.setAttribute( 'id', spanId );
								var div_tag = document.getElementById('live_deals_content');
								if(div_tag){div_tag.appendChild( spantag )};
							}
							
							showAllLiveDeals3(sz, 0);
							
							var j = (6 * Math.ceil(sz/6)) - 6 ;
							var lastspanId = 'live_deals_content' + j;  
							var lastspan = document.getElementById(lastspanId);
							if (lastspan.innerHTML != '')
							{
									allinnerhtmled = true;
							}
				}
		}					 
		contentselected('live_deals_content'); 				
	}
	
	function showAllLiveDeals3(sz, i)
	{		
		if (i< sz)
		{				
			var spanId = 'live_deals_content' + i;
			var ifrm = frames["regiondeals"].document.getElementById(spanId);
			var alllivedeals_span = document.getElementById(spanId);
			if (ifrm)
			{
				alllivedeals_span.innerHTML = ifrm.innerHTML;
				alllivedeals_span.style.display = 'block';			
			}
			i = i+6;	 		
			setTimeout(function(){showAllLiveDeals3(sz, i);},10);
		}	 							
	}
	
	
	function showmappane(sHotelIdAllDeals)
	{	
		var mapcontents = '<iframe src="/multimap-many.asp?MultimapHotels=' + sHotelIdAllDeals + '" scrolling="no" width="100%" height="600" frameborder="0" marginheight="0"></iframe>';						
		var map_view_content = document.getElementById('map_view_content');
		var temp = mapcontents;		
		map_view_content.innerHTML = temp;			 	
		map_view_content.style.display = 'block';		
	}
	function hidemap2()
	{
					var mapwrap = document.getElementById('map_view_content');
					if (mapwrap)
					{
					mapwrap.style.display = 'none';
					}	
	}


function changecss(myclass,element,value) 
	{
		var CSSRules
		if (document.all) 
		{
      CSSRules = 'rules'
		}
		else if (document.getElementById) 
		{
      CSSRules = 'cssRules'
		}
		for (var i = 0; i < document.styleSheets[0][CSSRules].length; i++) 
		{
     if (document.styleSheets[0][CSSRules][i].selectorText == myclass) 
     {
        document.styleSheets[0][CSSRules][i].style[element] = value
     }
		}	
	}	      
	function hideandshow(hide1, hide2, show1, show2, HeadShow, headhide1, headhide2)
	{
	changecss(hide1,'display','none');
	changecss(hide2,'display','none');
	changecss(show1,'display','');
	changecss(show2,'display','');
	changecss(HeadShow,'display','');
	changecss(headhide1,'display','none');
	changecss(headhide2,'display','none');					       	        
	}			



