jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	jQuery("<img>").attr("src", arguments[i]);
}
jQuery.preloadImages("images/About_Open_Center.jpg", "images/Resume_Open_Center.jpg", "images/Contact_Open_Center.jpg", "images/Gallery_Open_Center.jpg", "images/Viewer_Open_2.jpg", "images/Loading.gif");


var TwoDeeDescription = "Nikon D7000";
var WebDescription = "Designed and Coded: HTML, PHP, SQL, CSS";
var AnimationDescription = "Maya 3D";
var ThreeDeeDescription = "Maya 3D";



 function ClosePaper()
{
				/* set the queue to true here and below, to make the menu open then close */
			$("#AboutScroll#AboutScroll li a").animate({ width: "20px" }, {queue:false, duration:"normal"} );
			$("#ResumeScroll#ResumeScroll li a").animate({ width: "20px" }, {queue:false, duration:"normal"} );
			$("#ContactScroll#ContactScroll li a").animate({ width: "20px" }, {queue:false, duration:"normal"} );
			$("#GalleryScroll#GalleryScroll li a").animate({ width: "20px" }, {queue:false, duration:"normal"} );
			$("#ViewerScroll#ViewerScroll li a").animate({ height: "42px" }, {queue:false, duration:"normal"} );

}

 function ChangeAnimation(MovieNumber, Description)
{
var myElement = document.getElementById("Animation"); 

    myElement.setAttribute("src","http://player.vimeo.com/video/"+MovieNumber+"?portrait=0&byline=0&title=0");

	AnimationDescription = Description;
	
	document.getElementById('Viewer_Description').innerHTML = Description ;
}

			
function roll(img_name, img_src)
{
   document[img_name].src = img_src;
}

function Change_Viewer_Image_3D(ViewerImage,img_src,Description)
{
   document[ViewerImage].src = "images/Loading.gif";
   document[ViewerImage].src = img_src;
   
   ThreeDeeDescription = Description;
   
   document.getElementById('Viewer_Description').innerHTML = Description ;
}

function Change_Viewer_Image_2D(ViewerImage,img_src,Description)
{
   document[ViewerImage].src = "images/Loading.gif";
   document[ViewerImage].src = img_src;
   
   TwoDeeDescription = Description;

   document.getElementById('Viewer_Description').innerHTML = Description ;
}

function Change_Viewer_Image_Web(ViewerImage,img_src,Description,Link)
{
   document[ViewerImage].src = "images/Loading.gif";
   document[ViewerImage].src = img_src;
   
   WebDescription = Description;
	if(Link)
	{
		document.getElementById('Viewer_Description').innerHTML = "<a href=\""+Link+"\" target=\"_blank\" >"+Description+"</a>";
	}
   else
	{
		document.getElementById('Viewer_Description').innerHTML = Description;
	}
}


function Change_Viewer_Video(vid_src,Description)
{
  /* .style.display = "none";  */
   document.getElementById('Viewer_Description').innerHTML = Description ;
}

function ShowGallery1()
{
				document.getElementById("Gallery_1").style.display = "block";
				document.getElementById("Gallery_2").style.display = "none";
				document.getElementById("Gallery_3").style.display = "none";
}

function ShowGallery2()
{
				document.getElementById("Gallery_1").style.display = "none";
				document.getElementById("Gallery_2").style.display = "block";
				document.getElementById("Gallery_3").style.display = "none";
}

function ShowGallery3()
{
				document.getElementById("Gallery_1").style.display = "none";
				document.getElementById("Gallery_2").style.display = "none";
				document.getElementById("Gallery_3").style.display = "block";
}

function ShowThreeDee1()
{
				document.getElementById("ThreeDee_1").style.display = "block";
				document.getElementById("ThreeDee_2").style.display = "none";
}

function ShowThreeDee2()
{
				document.getElementById("ThreeDee_1").style.display = "none";
				document.getElementById("ThreeDee_2").style.display = "block";
}



jQuery(document).ready(function(){


 
var Location = "ShowReel"
var AboutWidth = 517
var ResumeWidth = 487
var ContactWidth = 443
var GalleryWidth = 767
var ViewerHeight = 372



 //Show Reel to default
 				Location = "ShowReel" 
				$("#ViewerScroll#ViewerScroll li a").animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
				Change_Viewer_Video("","Michael Thyer 2011");
				/*    In the Viewer     */
				document.getElementById("Viewer_ShowReel").style.display = "block";
				document.getElementById("Viewer_Animations").style.display = "none";
				document.getElementById("Viewer_2DGallery").style.display = "none";
				document.getElementById("Viewer_3DGallery").style.display = "none";
				document.getElementById("Viewer_Web").style.display = "none";			
///////////////////////////////////////////

 
 
 /*       CLICK ON THE SCROLLS                
		$("#AboutScroll#AboutScroll li a").click
	(
		function()
		{
			ClosePaper();
			if(Location != "About")
			{
				Location = "About" 
				$(this).animate({ width: AboutWidth }, {queue:false, duration:"normal"} );
			}
			else
			{
				Location = "null" 
			}
		}
	);
	

	
		$("#ResumeScroll#ResumeScroll li a").click
	(
		function()
		{
			ClosePaper();
			if(Location != "Resume")
			{
				Location = "Resume" 
				$(this).animate({ width: ResumeWidth }, {queue:false, duration:"normal"} );
			}
			else
			{
				Location = "null" 
			}
		}
	);
	
	
	
	$("#ContactScroll#ContactScroll li a").click
		(
		function()
		{
			ClosePaper(); 
			if(Location != "Contact")
			{
				Location = "Contact" 
				$(this).animate({ width: ContactWidth }, {queue:false, duration:"normal"} );
			}
			else
			{
				Location = "null" 
			}
		}
	);
	
	

	
		$("#GalleryScroll#GalleryScroll li a").click
	(
		function()
		{
			ClosePaper(); 
			if(Location != "Gallery")
			{
				Location = "Gallery" 
				$("#ViewerScroll#ViewerScroll li a").animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
				$(this).animate({ width: GalleryWidth }, {queue:false, duration:"normal"} );
			}
			else
			{
				Location = "null" 
			}
		}
	);

		$("#ViewerScroll#ViewerScroll li a").click
	(
		function()
		{
			ClosePaper();
			if(Location != "ShowReel")
			{
				Location = "ShowReel" 
				$(this).animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
			}
			else
			{
				Location = "null" 
			}
		}
	);
	 -------------------------------------------------*/ 
	
 /*       CLICK ON THE MENU                 -------------------------------------------------*/ 		

 	document.getElementById("B_ShowReel").onclick=function()
{
			ClosePaper();
			if(Location != "ShowReel")
			{
				Location = "ShowReel" 
				$("#ViewerScroll#ViewerScroll li a").animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
				Change_Viewer_Video("","Michael Thyer 2011");
				/*    In the Viewer     */
				document.getElementById("Viewer_ShowReel").style.display = "block";
				document.getElementById("Viewer_Animations").style.display = "none";
				document.getElementById("Viewer_2DGallery").style.display = "none";
				document.getElementById("Viewer_3DGallery").style.display = "none";
				document.getElementById("Viewer_Web").style.display = "none";		
			}
			else
			{
				Location = "null" 
			}
}

 	document.getElementById("B_Viewer").onclick=function()   /*Viewer Also Opens Showreel */
{
			ClosePaper();
			if(Location != "ShowReel")
			{
				Location = "ShowReel" 
				$("#ViewerScroll#ViewerScroll li a").animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
				Change_Viewer_Video("","Michael Thyer 2010");
				/*    In the Viewer     */
				document.getElementById("Viewer_ShowReel").style.display = "block";
				document.getElementById("Viewer_Animations").style.display = "none";
				document.getElementById("Viewer_2DGallery").style.display = "none";
				document.getElementById("Viewer_3DGallery").style.display = "none";
				document.getElementById("Viewer_Web").style.display = "none";
			}
			else
			{
				Location = "null" 
			}
}




	document.getElementById("B_Animations").onclick=function()
{
			ClosePaper();
			if(Location != "Animations")
			{
				Location = "Animations" 
				
				$("#GalleryScroll#GalleryScroll li a").animate({ width: GalleryWidth }, {queue:false, duration:"normal"} );
				$("#ViewerScroll#ViewerScroll li a").animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
				/*    In the Gallery     */				
				document.getElementById("Animations_1").style.display = "block";
				document.getElementById("Gallery_1").style.display = "none";
				document.getElementById("Gallery_2").style.display = "none";
				document.getElementById("Gallery_3").style.display = "none";
				document.getElementById("ThreeDee_1").style.display = "none";
				document.getElementById("ThreeDee_2").style.display = "none";
				document.getElementById("Web_1").style.display = "none"
				/*    In the Viewer     */
				document.getElementById("Viewer_ShowReel").style.display = "none";
				document.getElementById("Viewer_Animations").style.display = "block";
				document.getElementById("Viewer_2DGallery").style.display = "none";
				document.getElementById("Viewer_3DGallery").style.display = "none";
				document.getElementById("Viewer_Web").style.display = "none";
				
				document.getElementById('Viewer_Description').innerHTML = AnimationDescription ;
				
			}
			else
			{
				Location = "null" 
			}
}	

	document.getElementById("B_3D").onclick=function()
{
			ClosePaper();
			if(Location != "ThreeDee")
			{
				Location = "ThreeDee" 
				$("#GalleryScroll#GalleryScroll li a").animate({ width: GalleryWidth }, {queue:false, duration:"normal"} );
				$("#ViewerScroll#ViewerScroll li a").animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
				
				document.getElementById("Animations_1").style.display = "none";
				document.getElementById("Gallery_1").style.display = "none";
				document.getElementById("Gallery_2").style.display = "none";
				document.getElementById("Gallery_3").style.display = "none";
				document.getElementById("ThreeDee_1").style.display = "block";
				document.getElementById("ThreeDee_2").style.display = "none";
				document.getElementById("Web_1").style.display = "none";
				
				/*  Change_Viewer_Image('images/3D/AdultAvitar.jpg','Milkshape 3D (Freelance: Gogofrog)')  Sets the default image and text */ 
				
				/*    In the Viewer     */
				document.getElementById("Viewer_ShowReel").style.display = "none";
				document.getElementById("Viewer_Animations").style.display = "none";
				document.getElementById("Viewer_2DGallery").style.display = "none";
				document.getElementById("Viewer_3DGallery").style.display = "block";
				document.getElementById("Viewer_Web").style.display = "none";
				
				document.getElementById('Viewer_Description').innerHTML = ThreeDeeDescription ;
			}
			else
			{
				Location = "null" 
			}
}	


document.getElementById("B_2D").onclick=function()
{
			ClosePaper();
			if(Location != "Gallery")
			{
				Location = "Gallery" 
				$("#GalleryScroll#GalleryScroll li a").animate({ width: GalleryWidth }, {queue:false, duration:"normal"} );
				$("#ViewerScroll#ViewerScroll li a").animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
				
				document.getElementById("Animations_1").style.display = "none";
				document.getElementById("Gallery_1").style.display = "block";
				document.getElementById("Gallery_2").style.display = "none";
				document.getElementById("Gallery_3").style.display = "none";
				document.getElementById("ThreeDee_1").style.display = "none";
				document.getElementById("ThreeDee_2").style.display = "none";
				document.getElementById("Web_1").style.display = "none";
				
				/*  Change_Viewer_Image('images/3D/AdultAvitar.jpg','Milkshape 3D (Freelance: Gogofrog)')  Sets the default image and text */ 
				
				/*    In the Viewer     */
				document.getElementById("Viewer_ShowReel").style.display = "none";
				document.getElementById("Viewer_Animations").style.display = "none";
				document.getElementById("Viewer_2DGallery").style.display = "block";
				document.getElementById("Viewer_3DGallery").style.display = "none";
				document.getElementById("Viewer_Web").style.display = "none";
				
				document.getElementById('Viewer_Description').innerHTML = TwoDeeDescription ;
			}
			else
			{
				Location = "null" 
			}
}

	document.getElementById("B_Web").onclick=function()
{
			ClosePaper();
			if(Location != "Web")
			{
				Location = "Web" 
				$("#GalleryScroll#GalleryScroll li a").animate({ width: GalleryWidth }, {queue:false, duration:"normal"} );
				$("#ViewerScroll#ViewerScroll li a").animate({ height: ViewerHeight }, {queue:false, duration:"normal"} );
				
				document.getElementById("Animations_1").style.display = "none";
				document.getElementById("Gallery_1").style.display = "none";
				document.getElementById("Gallery_2").style.display = "none";
				document.getElementById("Gallery_3").style.display = "none";
				document.getElementById("ThreeDee_1").style.display = "none";
				document.getElementById("ThreeDee_2").style.display = "none";
				document.getElementById("Web_1").style.display = "block";
				
				/*    In the Viewer     */
				document.getElementById("Viewer_ShowReel").style.display = "none";
				document.getElementById("Viewer_Animations").style.display = "none";
				document.getElementById("Viewer_2DGallery").style.display = "none";
				document.getElementById("Viewer_3DGallery").style.display = "none";
				document.getElementById("Viewer_Web").style.display = "block";
				
				document.getElementById('Viewer_Description').innerHTML = WebDescription ;
				

			}
			else
			{
				Location = "null" 
			}
}	

		
	document.getElementById("B_About").onclick=function()
{
			ClosePaper();
			if(Location != "About")
			{
				Location = "About" 
				$("#AboutScroll#AboutScroll li a").animate({ width: AboutWidth }, {queue:false, duration:"normal"} );
			}
			else
			{
				Location = "null" 
			}
			
}	

	document.getElementById("B_Resume").onclick=function()
{
			ClosePaper();
			if(Location != "Resume")
			{
				Location = "Resume" 
				$("#ResumeScroll#ResumeScroll li a").animate({ width: ResumeWidth }, {queue:false, duration:"normal"} );
			}
			else
			{
				Location = "null" 
			}
}	

	document.getElementById("B_Contact").onclick=function()
{
			ClosePaper();
			if(Location != "Contact")
			{
				Location = "Contact" 
				$("#ContactScroll#ContactScroll li a").animate({ width: ContactWidth }, {queue:false, duration:"normal"} );
			}
			else
			{
				Location = "null" 
			}
}	


	

		
});



