
Shadowbox.init({
	language: 'en',
	players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv'],
	overlayColor: "#000000"

});


function disableSelection(element) {
    element.onselectstart = function() {
      return false;
    };
    element.unselectable = "on";
    element.style.MozUserSelect = "none";
    element.style.cursor = "default";
}

function onLoad() {
  disableSelection(document.getElementById("bookcon"));
}

$(document).ready(function() {
	
	$('.mainImage').cycle({fx: 'fade',speed:  2500,timeout:  2500 });
 
	//rotation speed and timer
	var speed = 7000;
	var run = setInterval('rotate()', speed);	
	
	//grab the width and calculate left value
	var item_width = $('#slides li').outerWidth(); 
	var left_value = item_width * (-1); 
        
    //move the last item before first item, just in case user click prev button
	$('#slides li:first').before($('#slides li:last'));
	
	//set the default item to the correct position 
	$('#slides ul').css({'left' : left_value});
 
    //if user clicked on prev button
	$('#prev').click(function() {
 
		//get the right position            
		var left_indent = parseInt($('#slides ul').css('left')) + item_width;
 
		//slide the item            
		$('#slides ul:not(:animated)').animate({'left' : left_indent}, 2000,function(){    
 
            //move the last item and put it as first item            	
			$('#slides li:first').before($('#slides li:last'));           
 
			//set the default item to correct position
			$('#slides ul').css({'left' : left_value});
		
		});
 
		//cancel the link behavior            
		return false;
            
	});
 
 
    //if user clicked on next button
	$('#next').click(function() {
		
		//get the right position
		var left_indent = parseInt($('#slides ul').css('left')) - item_width;
		
		//slide the item
		$('#slides ul:not(:animated)').animate({'left' : left_indent}, 2000, function () {
            
            //move the first item and put it as last item
			$('#slides li:last').after($('#slides li:first'));                 	
			
			//set the default item to correct position
			$('#slides ul').css({'left' : left_value});
		
		});
		         
		//cancel the link behavior
		return false;
		
	});        
	
	//if mouse hover, pause the auto rotation, otherwise rotate it
	$('#slides').hover(
		
		function() {
			clearInterval(run);
		}, 
		function() {
			run = setInterval('rotate()', speed);	
		}
	); 
        
});


function call_me_back(div)
{
	
	if($(div).css('display') == "block")
	{
		$(div).slideUp();
		
	}
	else
	{
		$(div).slideDown();







$(div).load('/call-me-back.php', function(data) {


   Shadowbox.setup();
              
    
});







		//$(div).load('call-me-back.php');
	}
}


function termsandconditions(div)
{
	
	if($(div).css('display') == "block")
	{
		$(div).slideUp();
		
	}
	else
	{
		$(div).slideDown();
		$(div).load('tandcs.php');
	}
}


function get_in_touch(div)
{
	
	if($(div).css('display') == "block")
	{
		$(div).slideUp();
		
	}
	else
	{
		$(div).slideDown();
	}
}



function submit_callmeback(name, email, tel) {
	
		$.post("/call-me-back-submit.php", { name: name, email: email, tel: tel },
				function(data){
					$("#processform").html(data);
				});
	
	
	return false;
	
}
 
//a simple function to click next link
//a timer will call this function, and the rotation will begin :)  
function rotate() {
	$('#next').click();
}

function showgapfair(value) {


	if (value == "Gap Fair/Presentation") {

	$("#showtext").css('display', 'block');

	}


}

function edit_window_front(div, id)
{				

	$('#w_horsetab').hide();
	$('#w_interntab').hide();
	$('#w_voltab').hide();
	$('#w_sumtab').hide();

	$(div).animate({width:'toggle'},400, function () {
		
			
			
		
			$.post("/type-leap-text.php", { id: id  },
		 	function(data){
	   		//alert("Data Loaded: " + data);
			
			$("#edit-window-content-1").html(data);
			
			$('#w_horsetab').show();
			$('#w_interntab').show();
			$('#w_voltab').show();
			$('#w_sumtab').show();
		
			
	   });
		
		
		});
		
}

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

function disableSelection(element) {
    element.onselectstart = function() {
      return false;
    };
    element.unselectable = "on";
    element.style.MozUserSelect = "none";
    element.style.cursor = "default";
}


<!--//
$(function(){
	
	function moveFloatMenu() {
		
		var menuOffset = 42 + $(this).scrollTop() + "px";
		$('#edittab-front').animate({top:menuOffset},{duration:100,queue:false});
	}
	
	menuYloc = $('#edittab-front').offset();
 
	$(window).scroll(moveFloatMenu);
 
	moveFloatMenu();
	
	
});
//-->


(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));


 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-28417280-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
