var scrOfX=0;
var scrOfY=0;


function showProgressSpinner()
{
//	$('iframe#HotelPropertyDescription').attr('src', "");
	
//	var popUpURL= $('iframe#HotelPropertyDescription').attr('src');
//	if(null == popUpURL || "" == popUpURL){
//	$('iframe#HotelPropertyDescription').attr('src','HotelDescription.do?hotel_city_code='+ hotel_city_code + '&hotel_code='+hotel_code);
//	}
	getScrollXY();
	scrollTo(0,0);
	var pageWidth = getPageSize()[0];
	var pageHeight = getPageSize()[1];
	document.getElementById('hidepage').style.display='block';
	document.getElementById('popup').style.display='block';

	var h  = getWindowSize()[0];
	var T = (h-200)/2+"px";	
	var b  = getWindowSize()[1];
	var L = (b-200)/2+"px";

	document.getElementById('popup').style.left=L;
	document.getElementById('popup').style.top=T;
	document.getElementById('hidepage').style.width = pageWidth+"px";
	document.getElementById('hidepage').style.height = pageHeight+"px";
	document.body.style.overflow="hidden";	
}



function showHotelDescription(hotel_city_code, hotel_code)
{	
	$('iframe#HotelPropertyDescription').attr('src', "");
	
	var popUpURL= $('iframe#HotelPropertyDescription').attr('src');
	if(null == popUpURL || "" == popUpURL){
	$('iframe#HotelPropertyDescription').attr('src','HotelDescription.do?hotel_city_code='+ hotel_city_code + '&hotel_code='+hotel_code);
	}

	getScrollXY();
	scrollTo(0,0);

	var pageWidth = getPageSize()[0];
	var pageHeight = getPageSize()[1];
	
//	alert("pageWidth: " + pageWidth);
//	alert("pageHeight: " + pageHeight);

	document.getElementById('hidepage').style.display='block';
	document.getElementById('popup').style.display='block';
	document.getElementById('frame1').style.display='block';

	var h  = getWindowSize()[0];
//	var T = (h-516)/2+"px";
	var T = (h-475)/2+"px";
	
	var b  = getWindowSize()[1];
	var L = (b-816)/2+"px";

	//	alert(h);
	//	alert(b);

	document.getElementById('popup').style.left=L;
	document.getElementById('popup').style.top=T;


	document.getElementById('hidepage').style.width = pageWidth+"px";
	document.getElementById('hidepage').style.height = 2000+"px";
	document.getElementById('frame1').style.width = pageWidth+"px";
	document.getElementById('frame1').style.height = 2000+"px";


	//	document.getElementById('hidepage').style.width=(screen.width)+"px";
	//	document.getElementById('hidepage').style.height =(screen.height)+"px";
	//	document.getElementById('frame1').style.width=(screen.width)+"px";
	//	document.getElementById('frame1').style.height =(screen.height)+"px";
	document.body.style.overflow="hidden";
}




function getScrollXY()
{
	if(typeof(window.pageYOffset)=="number")
	{
		scrOfY=window.pageYOffset;
		scrOfX=window.pageXOffset;
	}
	else
	{
		if(document.body && (document.body.scrollLeft||document.body.scrollTop))
		{
			scrOfY=document.body.scrollTop;
			scrOfX=document.body.scrollLeft;
		}
		else
		{
			if(document.documentElement &&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
			{
				scrOfY=document.documentElement.scrollTop;
				scrOfX=document.documentElement.scrollLeft;
			}
		}
	}

//	alert("scrOfX..." + scrOfX);
//	alert("scrOfY..." + scrOfY);
	
	return true;
}


function getPageSize()
{
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) 
	{
        var pageWidth = document.body.scrollWidth;
        var pageHeight = document.body.scrollHeight;
    } 
	else if( document.body.offsetWidth ) 
	{
		pageWidth = document.body.offsetWidth;
		pageHeight = document.body.offsetHeight;
    } 
	else
	{
		pageWidth='100%';
		pageHeight='100%';
    }   
	return [pageWidth, pageHeight];
}


function getWindowSize()
{
	var a=0;	
	var b=0;	
	if(typeof(window.innerWidth)=="number")
	{
		a=window.innerHeight;
		b=window.innerWidth;
	}
	else
	{
		if(document.documentElement && (document.documentElement.clientWidth||document.documentElement.clientHeight))
		{
			a=document.documentElement.clientHeight;
			b=document.documentElement.clientWidth;
		}
		else
		{
			if(document.body&&(document.body.clientWidth||document.body.clientHeight))
			{
				a=document.body.clientHeight; 
				b=document.body.clientWidth;
			}
		}
	}	
	return [a, b];

}

