Cufon.replace('h1,h2,h3,h4');

	$(document).ready(function() {
	
         $('.buy, .action-link').tipsy({fade: true});

		//Ajax Contact Form Submission
		$("#ajax-contact-form").submit(function(){
		var str = $(this).serialize();
		   $.ajax({
		   type: "POST",
		   url: "contact/contact.php",
		   data: str,
		   success: function(msg){
			$("#notification").ajaxComplete(function(event, request, settings){
			if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
			{
			result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
			$("#fields").hide();
			}
			else
			{
			result = msg;
			}
			$(this).html(result);
			});
			}
		 });
		return false;
		});

	$('#testimonials').cycle({
 		fx:'fade',
 		timeout:4000
 	});


		//ContactForm FancyBox
		$("a#contactform-inline,a#subscribe-inline").fancybox({
			'transitionIn'		:'elastic',
			'overlayShow'		:true,
			'speedIn'			:600,
			'titleShow':false
		});
		
		//Social FancyBox
		$("a#social-inline").fancybox({
			'transitionIn'		:'elastic',
			'overlayShow'		:true,
			'speedIn'			:600,
			'titleShow':false
		});



	    	$("#screen-02").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'elastic',
			'overlayShow'	: true,
			'speedIn'		: 600,
			'title'			: this.title,
			'width'			: 630,
			'height'		: 360,
			'href'			: this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1'),
			'type'			: 'swf'
		});

		return false;
	});
	
	
			//Screenshots FancyBox
		$("a[rel=img_screen]").fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			'titlePosition' 	: 'over',
			'speedIn'		:	600,
			'speedOut'		:	200,
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">' + (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
		

			$outer_container=$("#outer_container");
	$thumbScroller=$("#thumbScroller");
	$thumbScroller_container=$("#thumbScroller .container");
	$thumbScroller_content=$("#thumbScroller .content");
	$thumbScroller_thumb=$("#thumbScroller .thumb");

	var sliderWidth=$thumbScroller.width();
	var itemWidth=$thumbScroller_content.width();

	$thumbScroller_content.each(function (i) {
		totalContent=i*itemWidth;
		$thumbScroller_container.css("width",totalContent+itemWidth);
	});

	$thumbScroller.mousemove(function(e){
		var mouseCoords=(e.pageX - this.offsetLeft);
	  	var mousePercentY=mouseCoords/sliderWidth;
	  	var destY=-(((totalContent-(sliderWidth-itemWidth))-sliderWidth)*(mousePercentY));
	  	var thePosA=mouseCoords-destY;
	  	var thePosB=destY-mouseCoords;
	  	if(mouseCoords==destY){
			$thumbScroller_container.stop();
	  	}
	  	if(mouseCoords>destY){
			$thumbScroller_container.css("left",-thePosA);
	  	}
	  	if(mouseCoords<destY){
			$thumbScroller_container.css("left",thePosB);
	  	}
	});

	var fadeSpeed=300;

	$thumbScroller_thumb.each(function () {
		var $this=$(this);
		$this.fadeTo(fadeSpeed, 0.5);
	});

	$thumbScroller_thumb.hover(
		function(){ //mouse over
			var $this=$(this);
			$this.stop().fadeTo(fadeSpeed, 1);
		},
		function(){ //mouse out
			var $this=$(this);
			$this.stop().fadeTo(fadeSpeed, 0.5);
		}
	);
		
		
		
		
		
		
		



		//notify to turnon js
		window.onload = function () {
			document.getElementById("no-script").style.display = "none";
		}

	});
		
		


