// JavaScript Document
var bannerOn = true;
var pos = 0;
$(document).ready(function(){ 
							   
	$("#toggle").click(function () {
		$("#presentation").slideToggle("slow");
		$("#spacer").slideToggle("slow");
		if(bannerOn){
			document.getElementById('toggle').innerHTML = 'Show Presentation +';
			bannerOn = false;
		}else{
			document.getElementById('toggle').innerHTML = 'Twitter +';
			bannerOn = true;
			}

	});
	
	$(".login").click(function () {
		$("#loginForm").slideToggle("slow");
	});
	
	$("#nextPresentation").click(function(){
		
		pos +=988; 
		if(pos > 2964){
			pos = 2964;
			}
		$frame = $('#presentation');				
		$frame.scrollTo(pos+"px",'0px',500);					
		}
	);
	
});


function toggleForm(id){
		$("#"+id).slideToggle("slow");
	}
	
	
//Portfolio Menu Scroll to functions
var horizontal = 0;

function scrollUp(height, id, speed){
	$frame = $('#'+id);
	horizontal += height;
	if(horizontal < 0){
		horizontal = 0;
	}
	$frame.scrollTo(horizontal+"px",speed);
}

function scrollDown(height, id, speed, itmes){
	$frame = $('#'+id);
	horizontal += height;
	if(horizontal > ((height*itmes)-(4*height))+50){
		horizontal = ((height*itmes)-(4*height)+50) ;
	}
	$frame.scrollTo(horizontal+"px",speed);
}


function construction(){
	alert('Sorry! still working on it, almost there!');
	}
	
function constructionContact(){
	alert('Sorry! still working on it, \n please give us a call: 514-312 27 91 \n or send us an email: info@multimediaxp.com');
	}
	
	
//Key press events for window scroll To
 windowPos=0;
	  window.onload = function(){
		  bodyY = document.body.scrollHeight;
		  }
	  
      window.onkeypress = function(e) {
	   if(e.keyCode == 40){
		   windowPos+=clientY;
		   if( windowPos > (bodyY-clientY)){
			   windowPos = bodyY-clientY;
			   }
		   $(window).scrollTo(windowPos+"px",300)
		   }
		   
		if(e.keyCode == 38){
			windowPos-=clientY;
			if(windowPos < 0){
				windowPos = 0;
				}
		   $(window).scrollTo(windowPos+"px",300)
		   }
		if(e.keyCode == 39){
			window.location.href = "http://www.multimediaxp.com"
			}
      }
