$(document).ready(function(){
	// body hide
	$('#search-form, #subscribe-form').hide();
	// smooth scroll
	$('a[href*=#]').click(function(){
		if(location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname)
		{
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if($target.length)
			{
				var targetOffset = $target.offset().top;
				$('html,body').animate({scrollTop: targetOffset}, 1000, 'easeInOutSine');
				return false;
			}
		}
	});
	// slider
	$('#slider').coinslider({ 
		width: 710,
		height: 272,
		opacity: 0.6,
		titleSpeed: 2000,
		delay: 4000
	});
	// pretty photo
	$("a[rel^='zoom']").prettyPhoto({
		theme: 'dark_square', 			/* light_rounded / dark_rounded / light_square / dark_square / facebook */
		animation_speed: 'slow', 		/* fast/slow/normal */
		slideshow: false, 				/* false OR interval time in ms */
		autoplay_slideshow: false,		/* true/false */
		opacity: 0.70, 					/* Value between 0 and 1 */
		show_title: true, 				/* true/false */
		allow_resize: true, 			/* Resize the photos bigger than viewport. true/false */
		counter_separator_label: '/', 	/* The separator for the gallery counter 1 "of" 2 */
		hideflash: true, 				/* Hides all the flash object on a page if set to TRUE */
		wmode: 'opaque', 				/* Set the flash wmode attribute */
		autoplay: false, 				/* Automatically start videos: True/False */
		modal: false, 					/* If set to true, only the close button will close the window */
		overlay_gallery: true, 			/* If set to true, a gallery will overlay the fullscreen image on mouse over */
		keyboard_shortcuts: true, 		/* Set to false if you open forms inside prettyPhoto */
		default_width: 500,
		default_height: 344
	});
	// contact form accordion
	$(".show-search").click(function(){
		$("#subscribe-form").slideUp(500,'easeInOutSine');
		$("#search-form").slideToggle(500,'easeInOutSine');
		$('#search-box').focus();
	});
	$(".show-subscribe").click(function(){
		$("#search-form").slideUp(500,'easeInOutSine');
		$("#subscribe-form").slideToggle(500,'easeInOutSine');
		$('#subscription-name').focus();
	});
	$('.close span.cross').click(function(){
		$(this).parent('.close').slideUp(200,'easeInOutSine');
	});
	getTwitters('latest-tweets', { 
	  id: 'exabytedesigns', 
	  count: 3, 
	  enableLinks: true, 
	  newwindow: true,
	  ignoreReplies: true,
	  clearContents: true,
	  template: '<p>%text%</p><span>- %time%</span>'
	});
	$('.show-sub-list').click(function(){
		$(this).parent('li').find('> ul').stop(true, true).slideToggle(250,'easeInOutSine');
	});
	$('.show-sub-sub-list').click(function(){
		$(this).parent('li').find('> ul').stop(true, true).slideToggle(250,'easeInOutSine');
	});
	// disable right click
	/*$(document).bind("contextmenu",function(e){
		return false;
	});*/
});

$(window).load(function() {
	// validate plugin
	$("#form").validate();
	$("#search-form").validate();
	$("#subscribe-form").validate();
	// googleMaps plugin
	$('.hint span').text('click the pin to view the address');
	$('#google-map-info').css('display', 'block');
	$('#google-map').googleMaps({
		latitude: 24.841218,
		longitude: 67.031673,
		depth: 15,
		scroll: false,
		markers:
		{
			latitude: 24.841218,
			longitude: 67.031673,
			info:
			{
				layer: '#google-map-info'
			}
		}
	});
});

// cufon replace 
/*Cufon.replace('.exabyte', { fontFamily: 'Procyon' });
Cufon.replace('.designs', { fontFamily: 'Labtop Upper' });*/
