// JavaScript Document

		
		function getBlogs(){
	
			var blogs = ajaxCall('text','getBlogs.php','','blogsContainer',3);
			document.getElementById("blogsContainer").innerHTML = blogs;
		
		}
	
		function getTweets(){
		
			
			var tweetTempl = document.getElementById("tweetTemplate").innerHTML;
			
			ajaxCall('xml','getTweets.php',tweetTempl,'tweetsContainer',3);
	
		}
		
		function playVideo(action,videoFile){
		
			switch(action){
			
				case "open": 
					
					var x = 0;
					if (self.innerHeight){ x = self.innerWidth; }
					else if (document.documentElement && document.documentElement.clientHeight){ x = document.documentElement.clientWidth; }
					else if (document.body){ x = document.body.clientWidth; }
					
					var y = 0;
					if (self.innerHeight){ y = self.innerHeight; }
					else if (document.documentElement && document.documentElement.clientHeight) { y = document.documentElement.clientHeight; }
					else if (document.body) { y = document.body.clientHeight; }
					
					document.getElementById('videoWindow').style.left = x/2-250+"px";
					document.getElementById('videoWindow').style.top = y/2-173+"px";
					
					document.getElementById("videoWindow").innerHTML = "";
					var videoPlayer = ajaxCall("text","flash/videoWindow.php?videoFile="+videoFile);
					document.getElementById("videoWindow").innerHTML = videoPlayer;
					document.getElementById("videoWindow").style.display = "block";
					document.documentElement.scrollTop = 0;
					document.body.scrollTop = 0;
					
				break;
				
				case "close":
				 
					document.getElementById("videoWindow").style.display = "none";
					document.getElementById("videoWindow").innerHTML = "";
					
				break;
			
			}
			
			return false;
		
		}
		
		function showPhoto(action,photoFile){
		
			switch(action){
			
				case "open": 
					
					var x = 0;
					if (self.innerHeight){ x = self.innerWidth; }
					else if (document.documentElement && document.documentElement.clientHeight){ x = document.documentElement.clientWidth; }
					else if (document.body){ x = document.body.clientWidth; }
					
					var y = 0;
					if (self.innerHeight){ y = self.innerHeight; }
					else if (document.documentElement && document.documentElement.clientHeight) { y = document.documentElement.clientHeight; }
					else if (document.body) { y = document.body.clientHeight; }
					
					document.getElementById('photoWindow').style.left = x/2-350+"px";
					document.getElementById('photoWindow').style.top = y/2-250+"px";
					
					document.getElementById("photoWindow").innerHTML = "";
					
					var photoPlayer = ajaxCall("text","flash/photoWindow.php?photoFile="+photoFile);
					
					document.getElementById("photoWindow").innerHTML = photoPlayer;
					document.getElementById("photoWindow").style.display = "block";
					document.documentElement.scrollTop = 0;
					document.body.scrollTop = 0;
					
				break;
				
				case "close":
				 
					document.getElementById("photoWindow").style.display = "none";
					document.getElementById("photoWindow").innerHTML = "";
					
				break;
			
			}
			
			return false;
		
		}
		
		
		function sendEnquiry(form){
		
			if(validateForm(form)){
			
				return true;
			
			} else {
			
				alert("Sorry! there is an error in your form\n\nPlease make sure all required fields\nare filled in correctly");
				return false;
			
			}
		
		}
		