// JavaScript Document
/*
$(function() {
    $("#content-area").height($(document).height()-141);
});
*/
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-22416828-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);
  })();

$(window).resize(function() {
  location.reload(true);
});


$(document).ready(function() {
	 $("#content-area").height($("body").height()-151);
	 //alert($(document).height());
	 //alert($("body").height());
	 //alert($("#content-area").height());
});

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-21874545-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);
  })();


$(document).ready(function(){
  var currentPosition = 0;
  var slideWidth = 210;
  var slides = $('.project-thumbnail');

  var numberOfSlides = slides.length;

  // Remove scrollbar in JS
  $('#slidesContainer').css('overflow', 'hidden');

  // Wrap all .slides with #slideInner div
  slides.wrapAll('<div id="slideInner"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth 
    });

  // Set #slideInner width equal to total width of all slides
  $('#slideInner').css('width', (slideWidth * numberOfSlides) + (numberOfSlides * 10));

  // Insert controls in the DOM
  $('#slideshow')
    .prepend('<span class="control" id="leftControl">Clicking moves left</span>')
    .append('<span class="control" id="rightControl">Clicking moves right</span>');

  // Hide left arrow control on first load
  manageControls(currentPosition);

  // Create event listeners for .controls clicks
  $('.control')
    .bind('click', function(){
    // Determine new position
	currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
	// Hide / show controls
    manageControls(currentPosition);
    // Move slideInner using margin-left
    $('#slideInner').animate({
      'marginLeft' : (220*(-currentPosition))
    });
  });

  // manageControls: Hides and Shows controls depending on currentPosition
  function manageControls(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
	// Hide right arrow if position is last slide
    if(position==numberOfSlides-4){ $('#rightControl').hide() } else{ $('#rightControl').show() }
  }	
});

$(document).ready(function() {

	//When page loads...
	$(".panel-content").hide(); //Hide all content
	$("#panel-tab li:first a").addClass("active").show(); //Activate first tab
	$(".panel-content:first").show(); //Show first tab content

	//On Click Event
	$("#panel-tab li a").click(function() {
		$("#panel-tab li a").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".panel-content").hide(); //Hide all tab content
		var activeTab = $(this).attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});/**/
	
	//alert($(document).height());
	//alert($("body").height());
});

$(document).ready(function() {
$('.acc_container').hide(); //Hide/close all containers
//On Click
$('.acc_trigger').click(function(){
	if( $(this).next().is(':hidden') ) { 
		$(this).next().slideDown(); 
	}else{
		$(this).next().slideUp();
		}
	return false; 
});
});

<!--
$(document).ready(function() {
	//create a vertical scroller...	
	$('.index-news-txt').SetScroller({	
		velocity: 350, 
		startfrom: 	 'bottom', 
		onmouseover: 'play',
		onmouseout:  'play',
		cursor: 	'normal',
		onstartup: 	 'play',
		direction: 'vertical'
		 
	});		
});


$(document).ready(function() {

	//When page loads...
	$(".section-img-inner").hide(); //Hide all content
	$(".section-pager a:first").addClass("active").show(); //Activate first tab
	$(".section-img-inner:first").show(); //Show first tab content

	//On Click Event
	$(".section-pager a").click(function() {
		$(".section-pager a").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".section-img-inner").hide(); //Hide all tab content

		var activeTab = $(this).attr("rel"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});/**/
});
$(document).ready(function(){
	$(".sitemap-list li a").hover(function(){
		$(this).stop().animate({
     		 paddingLeft : "25px"
    	},300)},function(){
		$(this).stop().animate({
     		 paddingLeft : "20px"
    	},300);
	})	
});

function checkForm()
{
	if (document.form1.NAME.value != "" && document.form1.EMAIL.value != "" && document.form1.ENQUIRY.value != ""  && document.form1.DETAILS.value != "")
	{
		document.form1.action = "/Connections/form_to_email.php";
		document.form1.submit();
	}
	else
	{
		alert("Fields marked by a * must be completed");
	}
}
