// JavaScript Document introResizer.js
var isPlaying=false;
window.onresize=setSize;
//sets play method in case it doesnt work
setTimeout("toPlay();",5000);
//functions
function setSize() //Sets more accurate movie size
{
	var availableSizeY=null;
	var availableSizeX=null;
	var proporcion=document.getElementById("FlashID").width/document.getElementById("FlashID").height;
		try
		{
			if(window.getComputedStyle(document.body,null).height&&parseInt(window.getComputedStyle(document.body,null).height)!=0)
			{
				availableSizeY=parseInt(getComputedStyle(document.body,null).height);
				availableSizeX=parseInt(getComputedStyle(document.body,null).width);
			}
		}catch(error){}		
		try
		{
			if(((window.innerHeight&&availableSizeY>parseInt(window.innerHeight))&&window.innerHeight)!=0||(window.innerHeight&&availableSizeY==null))
			{				
				availableSizeY=window.innerHeight;
				availableSizeX=window.innerWidth;
			}
		}catch(error){}	
		try
		{
			if(((document.documentElement.clientHeight&& availableSizeY>parseInt(document.documentElement.clientHeight))&&parseInt(document.documentElement.clientHeight)!=0)||(document.documentElement.clientHeight&&availableSizeY==null))
			{
				availableSizeY=document.documentElement.clientHeight;
				availableSizeX=document.documentElement.clientWidth;
			}
		}catch(error){}
		try
		{
			if(((document.body.clientHeight&&availableSizeY>parseInt(document.body.clientHeight))&&parseInt(document.body.clientHeight)!=0)||(document.body.clientHeight&&availableSizeY==null))
			{
				availableSizeY=document.body.clientHeight;
				availableSizeX=document.body.clientWidth;
			}
		}catch(error){}
	if(availableSizeY!=null&&parseInt(availableSizeY)>0)
	{
		document.getElementById("FlashID").height=correction(availableSizeY);
		document.getElementById("FlashID").width=document.getElementById("FlashID").height*proporcion;
		document.getElementById("FlashID").style.left=(availableSizeX-document.getElementById("FlashID").width)/2+"px";
		document.getElementById("FlashID").style.top=(availableSizeY-document.getElementById("FlashID").height)/2+"px";
		try
		{
			document.getElementById("FlashId2").height=correction(availableSizeY);
			document.getElementById("FlashId2").width=document.getElementById("FlashId2").height*proporcion;
			document.getElementById("FlashId2").style.left=((availableSizeX-document.getElementById("FlashId2").width)/2)-parseInt(document.getElementById("FlashID").style.left)+"px";
			document.getElementById("FlashId2").style.top=((availableSizeY-document.getElementById("FlashId2").height)/2)-parseInt(document.getElementById("FlashID").style.top)+"px";
		}catch(error){}
	}else
	{
		document.getElementById("FlashID").height=correction((screen.availHeight)*(80/100));
		document.getElementById("FlashID").width=Math.round(document.getElementById("FlashID").height*proporcion);
		document.getElementById("FlashID").style.left=Math.round((screen.availWidth-document.getElementById("FlashID").width)/2)+"px";
		document.getElementById("FlashID").style.top=Math.round(((screen.availHeight-document.getElementById("FlashID").height)/2)-100)+"px";
		try
		{
			document.getElementById("FlashId2").height=correction((screen.availHeight)*(80/100));
			document.getElementById("FlashId2").width=Math.round(document.getElementById("FlashId2").height*proporcion);
			document.getElementById("FlashId2").style.left=((availableSizeX-document.getElementById("FlashId2").width)/2)-parseInt(document.getElementById("FlashID").style.left)+"px";
			document.getElementById("FlashId2").style.top=((availableSizeY-document.getElementById("FlashId2").height)/2)-parseInt(document.getElementById("FlashID").style.top)+"px";	
		}catch(error){}
	}
	if(isPlaying==false)
	{	
		try
		{
			document.getElementById("FlashID").play();;
		}catch(error){}
		try
		{
			document.getElementById("FlashId2").play();
		}catch(error){}
		isPlaying=true;
	}
}
function correction(number)
{
	for(number=Math.round(number); number%12!=0; number--){}
	return number;
}
function toPlay()
{
	if(isPlaying==false)
	{	
		try
		{
			document.getElementById("FlashID").play();;
		}catch(error){}
		try
		{
			document.getElementById("FlashId2").play();
		}catch(error){}
		isPlaying=true;
	}
}