$(document).ready(function(){
	// Activate the main slider	
$(window).load(function() {
    $('#slider').nivoSlider({
    });
});
// jQuery image change on hover
	$('div#servicesContainer .one-half img,div#servicesContainer .secondContainer img,div#latestwork .one-third img,div#clients .one-sixth img,div#pageContent ul.ourwork img,div#servicesContent .one-sixth  img,div#portfolioFirstrow .one-third img,div#portfolioSecondrow .one-third img,div#portfolioThirdrow .one-third img,div#circleFirstrow .one-fourth img,div#circleSecondrow .one-fourth img,div#circleThirdrow .one-fourth img,div#portfolio2columns .one-half img,div#classicPortfolio img,div#classicPortfoliosecond img,div#classicPortfoliothird img,div#sidebarPortfolio img,div#blog img,div#blogone img,div.post img,ul.jobservices img,ul.socials li img,div#breadcrumbsContainer h2 img,div#breadcrumbsContainer ul li p img,.callus a img,div#employeesContent .one-half img,.team img,ul.featured img,ul.featured1 img')
        .mouseover(function() { 
            var src = $(this).attr("src").match(/[^\.]+/) + "Over.png";
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).attr("src").replace("Over", "");
            $(this).attr("src", src);
        });
// Quote	
$(document).ready(function(){
	$('#quote .slide');
	setInterval(function(){
		$('#quote .slide').filter(':visible').fadeOut(4000,function(){
			if($(this).next('.slide').size()){
				$(this).next().fadeIn(300);
			}
			else{
				$('#quote .slide').eq(0).fadeIn(300);
			}
		});
	},3000);	
});	
// Twitter
$(function(){
      $('#tweets').tweetable({username: 'anariel77', time: true, limit: 1, replies: true, position: 'append'});
  });
  
 // Piecemaker 
    var flashvars = {};
  flashvars.xmlSource = "piecemaker.xml";
  flashvars.cssSource = "piecemaker.css";
  var params = {};
  params.play = "true";
  params.menu = "false";
  params.scale = "showall";
  params.wmode = "transparent";
  params.allowfullscreen = "true";
  params.allowscriptaccess = "always";
  params.allownetworking = "all";
  
  swfobject.embedSWF('piecemaker.swf', 'piecemaker', '960', '300', '10', null, flashvars,    
  params, null);
  
  // Slidedeck  
  $('.slidedeck').slidedeck();
  
  // Poshytips ------------------------------------------------------ //
    $('.poshytip').poshytip({
    	className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'center',
		offsetY: 10,
		allowTipHover: false
    });
	
	 // Poshytips1 ------------------------------------------------------ //
    $('.poshytip1').poshytip({
    	className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'center',
		alignY:'bottom',
		offsetY: 10,
		allowTipHover: false
    });
	// Poshytips2 ------------------------------------------------------ //
    $('.poshytip2').poshytip({
    	className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'center',
		alignY:'top',
		offsetY: 20,
		allowTipHover: false
    });
	// Poshytips3 ------------------------------------------------------ //
    $('.poshytip3').poshytip({
    	className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'center',
		alignY:'top',
		offsetY: -30,
		allowTipHover: false
    });
	
// Activate the prettyPhoto
 $(document).ready(function(){
    $("a[rel^='prettyPhoto']").prettyPhoto();
  });
  
  // Activate the toggle-content on click
$('.toggle-content').hide();
    $('.toggle-title').click(function(){
        $(this).next().slideToggle(300);
        $(this).children('span.open-toggle').toggleClass('closed');
        $(this).attr('title', ($(this).attr('title') == 'Close') ? 'Open' : 'Close');
        return false;
    });  
	   	
	// Activate the contactform
$(function(){
	$('#contact_form').submit(function(e){
		e.preventDefault();
		var form = $(this);
		var post_url = form.attr('action');
		var post_data = form.serialize();
		$('#loader', form).html('<img src="img/loader.gif" /> Please Wait...');
		$.ajax({
			type: 'POST',
			url: post_url, 
			data: post_data,
			success: function(msg) {
				$(form).fadeOut(500, function(){
					form.html(msg).fadeIn();
				});
			}
		});
	});
});

// Activate the togglebox on hover	
$(document).ready(function(){
//Hide the tooglebox when page load
$(".togglebox").hide();
//slide up and down when hover over heading 2
$("h3").hover(function(){
// slide toggle effect set to slow you can set it to fast too.
$(this).next(".togglebox").slideToggle("slow");
return true;
});
});

// Activate the togglebox on click
$(document).ready(function(){
//Hide the tooglebox when page load
$(".togglebox1").hide();
//slide up and down when click over heading 2
$("h2").click(function(){
// slide toggle effect set to slow you can set it to fast too.
$(this).next(".togglebox1").slideToggle("slow");
return true;
});
});

	});
	

