/* 
Methods for resizing the flash stage at runtime.

setFlashWidth(divid, newW)
divid: id of the div containing the flash movie.
newW: new width for flash movie

setFlashWidth(divid, newH)
divid: id of the div containing the flash movie.
newH: new height for flash movie

setFlashSize(divid, newW, newH)
divid: id of the div containing the flash movie.
newW: new width for flash movie
newH: new height for flash movie

canResizeFlash()
returns true if browser supports resizing flash, false if not. 
*/
function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
	
}
function setFlashHeight(divid, newH){
		var str = document.location.href.toLowerCase();
		var b_q = str.indexOf("buildquote");
		
		if(b_q > 0)
		{
			setFlashStageHeight(divid, newH);
		}
		else
		{
	
			document.getElementById(divid).style.height = newH+"px";
			document.getElementById(divid).style.zIndex = document.getElementById(divid).style.zIndex+1;
			
			var mym_pos = str.indexOf("meetyourmodel.aspx");
			if(mym_pos == -1)		
			{
				if (newH > 100)
				{
					// Growing
					hideWebPartContent();
				}
				else
				{
					// Shrinking
					showWebPartContent();
	
				}
			}
		}

}

function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}

function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}



function hideWebPartContent()
{
	var version=0
	if (navigator.appVersion.indexOf("MSIE")!=-1)
	{
		temp=navigator.appVersion.split("MSIE")
		version=parseFloat(temp[1])
	} 
	if ( (navigator.appName == "Firefox" || navigator.appName == "Netscape") || (navigator.appName=="Microsoft Internet Explorer" && version < 7))
	{
		var webPartContentTable =  document.getElementById('MSOPageViewerWebPart_WebPartWPQ1');
		if (webPartContentTable)
		{
			webPartContentTable.style.display = 'none';
		}
		else
		{
			var webPartContentTable2010 =  document.getElementById('MSOPageViewerWebPart_WebPartWPQ3');
			if(webPartContentTable2010)
			{
				webPartContentTable2010.style.display = 'none';
			}
		}

		
	}
	
		overflowHidden();

		var divSnowGame = document.getElementById('zoomcontentGame')
		var imgSnowGame = document.getElementById('bgImage');
		if(divSnowGame)
		{
			divSnowGame.style.display = 'none';	
		}
		if(imgSnowGame)
		{
			imgSnowGame.style.display = 'block';
		}	
}

function showWebPartContent()
{
	var version=0
	if (navigator.appVersion.indexOf("MSIE")!=-1)
	{
		temp=navigator.appVersion.split("MSIE")
		version=parseFloat(temp[1])
	} 

	if ((navigator.appName == "Firefox" || navigator.appName == "Netscape") || (navigator.appName=="Microsoft Internet Explorer" && version < 7))
	{
		
		var webPartContentTable =  document.getElementById('MSOPageViewerWebPart_WebPartWPQ1');
		
		if (webPartContentTable)
		{
			webPartContentTable.style.display = 'block';
		}
		else
		{
			var webPartContentTable2010 =  document.getElementById('MSOPageViewerWebPart_WebPartWPQ3');
			if(webPartContentTable2010)
			{
				webPartContentTable2010.style.display = 'block';
			}
		}

	}
	
	
	
		overflowAuto();
	
		
		var divSnowGame = document.getElementById('zoomcontentGame');
		var imgSnowGame = document.getElementById('bgImage');
		if(imgSnowGame)
		{
			imgSnowGame.style.display = 'none';
		}
		if(divSnowGame)
		{
			document.location.reload();
		}
	
}

function overflowHidden()
{		
		var webPartOne = document.getElementById('WebPartWPQ1');
		var webPartTwo = document.getElementById('WebPartWPQ2');	
		if(webPartOne && webPartOne.style.overflow != "")
		{
			//alert("in one");
			webPartOne.style.overflow = "hidden";
			webPartOne.height = "auto";
		}
		if(webPartTwo && webPartTwo.style.overflow != "")
		{
			//alert("in two");
			webPartTwo.style.overflow = "hidden";
			webPartTwo.height = "auto";
		}
}

function overflowAuto()
{
		var webPartOne = document.getElementById('WebPartWPQ1');
		var webPartTwo = document.getElementById('WebPartWPQ2');
		if(webPartOne && webPartOne.style.overflow != "")
		{
			webPartOne.style.overflow = "auto";	
		}
		if(webPartTwo && webPartTwo.style.overflow != "")
		{
			webPartTwo.style.overflow = "auto";
		}
		
}



