jQuery(function(){	
		
	jQuery('.sidebar input[type=text]').val("add mail");
	
	jQuery('.sidebar input[type=text]').click(function(){
		if (jQuery('.sidebar input[type=text]').val() == "add mail")
			jQuery('.sidebar input[type=text]').val("");
		return false;
	});
	jQuery("#comment").focus(function(){
		if (jQuery(this).val() == "comment article")
			jQuery(this).val("");
	});
	jQuery(".wpcf7-form input, .wpcf7-form textarea").focus(function(){
		if (jQuery(this).val() == "Contact Name" || jQuery(this).val() == "Mobile Phone" || jQuery(this).val() == "Email Box" || jQuery(this).val() == "Skype Name" || jQuery(this).val() == "Facebook Page" || jQuery(this).val() == "Your Request")
			jQuery(this).val("");
	});
	/*jQuery('.toggle-reply').click(function(){
		jQuery('.comments-cont').slideToggle(300);
		return false;
	});*/
	jQuery('.icon-search').click(function(){
		jQuery('.icon-close, .v-search, .v-search-li').fadeIn(300);
		jQuery('.icon-search, #v-search-1, #v-search-2, #v-search-3, #v-search-4, #v-search-5, .icon-facebook').fadeOut(300);
		jQuery('.v-mainnav .active').removeClass('active').addClass('active2');
	});
		
	jQuery('.icon-close').click(function(){
		jQuery('.icon-search, #v-search-1, #v-search-2, #v-search-3, #v-search-4, #v-search-5, .icon-facebook').fadeIn(300);
		jQuery('.icon-close, .v-search, .v-search-li').fadeOut(300);
		jQuery('.v-mainnav .active2').removeClass('active2').addClass('active');
	});
	
	jQuery(".sidebar input[type='submit']").attr("value","");
	
	var $next = jQuery("#content img.next");
	var $previous = jQuery("#content img.previous");
	var $posts = jQuery("#posts");
	
	jQuery("#posts div.post div.inside").click(function() {
		var thisClass = jQuery(this).parent("div").attr("id");
		jQuery(".v-accordion, .interactive-container, .jcarousel-skin-tango, #posts").animate({marginLeft: "-200px", opacity: "hide"}, 400);
		jQuery("#content").height(700);
		// jQuery("#footer").css("margin-top", "390px");
		jQuery ("#posts_big").css ( "height", "390px" );
		jQuery("#"+thisClass).animate({top: "0px", opacity: "show"}, 600);
		jQuery("#"+thisClass).children("div.post_info").animate({top: "50px", opacity: "show"}, 800);
		jQuery("img.icon").stop(true, true).animate({top: "50px", opacity: "hide"}, 250);
	});
	$next.click(function() {
		var $parent = jQuery(this).parent("div.big_post"); 
		var $firstpost = jQuery("div.big_post:first");
		var $parentnext = $parent.next("div.big_post");
		$parentnext.css({"top" : "0px", "left" : "200px"});
		$parentnext.children("div.post_info").css({"top" : "50px", "display" : "block"});
		$parent.animate({left: "-200px", opacity: "hide"}, 600);
		if ( $parentnext.length == 0 ) {
		$firstpost.css({"top" : "0px", "left" : "200px"});
		$firstpost.children("div.post_info").css({"top" : "50px", "display" : "block"});
		$firstpost.animate({left: "0px", opacity: "show"}, 600);
		} else { 
		$parentnext.animate({left: "0px", opacity: "show"}, 600);
		}
	});
	$previous.click(function() {
		var $parent = jQuery(this).parent("div.big_post");
		var $parentprev = $parent.prev("div.big_post");
		var $lastpost = jQuery("div.big_post:last");
		$parentprev.css({"top" : "0px", "left" : "-200px"});
		$parentprev.children("div.post_info").css({"top" : "50px", "display" : "block"});
		$parent = jQuery(this).parent("div.big_post");
		$parent.animate({left: "200px", opacity: "hide"}, 600);
		if ( $parentprev.length == 0 ) {
		$lastpost.css({"top" : "0px", "left" : "-200px"});
		$lastpost.children("div.post_info").css({"top" : "50px", "display" : "block"});
		$lastpost.animate({left: "0px", opacity: "show"}, 600);
		} else { 
		$parent.prev("div.big_post").animate({left: "0px", opacity: "show"}, 600);
		}
	});
	jQuery("img.icon").css("top", "50px");
	jQuery("#posts div.post div.inside").hover(function() {
		jQuery(this).animate({marginTop: "13px"}, 250, function(){
			jQuery(this).children(".fade_title").css("bottom", "0px").fadeIn(300);
		});
		jQuery(this).children("img.icon").animate({top: "32px", opacity: "show"}, 250);
		}, function(){
		jQuery(this).stop(true, true).animate({marginTop: "0px"}, 250);
		jQuery(this).children("img.icon").stop(true, true).animate({top: "50px", opacity: "hide"}, 250);
		jQuery(this).children(".fade_title").animate({bottom: "30px", opacity: "hide"}, 100);
	});
	$next.hover(function() {
		jQuery(this).animate({left: "760px", opacity: .5}, 250);
		}, function(){
		jQuery(this).stop(true, true).animate({left: "755px",  opacity: 1}, 250);
	});
	jQuery("#next2").hover(function() {
		jQuery(this).animate({left: "760px", opacity: .5}, 250);
		}, function(){
		jQuery(this).stop(true, true).animate({left: "755px",  opacity: 1}, 250);
	});
	$previous.hover(function() {
		jQuery(this).animate({left: "-55px", opacity: .5}, 250);
		}, function(){
		jQuery(this).stop(true, true).animate({left: "-50px",  opacity: 1}, 250);
	});
	jQuery("#previous2").hover(function() {
		jQuery(this).animate({left: "-55px", opacity: .5}, 250);
		}, function(){
		jQuery(this).stop(true, true).animate({left: "-50px",  opacity: 1}, 250);
	});
	jQuery("#search-wrap img").hover(function() {
		jQuery(this).animate({opacity: .5}, 250);
		}, function(){
		jQuery(this).animate({opacity: 1}, 250);
	});
	jQuery("#posts_big div.black").hover(function() {
		jQuery(this).animate({opacity: .8}, 250);
		jQuery(this).children("img.zoom").animate({opacity: "show"}, 250);
		}, function(){
		jQuery(this).stop(true, true).animate({opacity: 1}, 250);
		jQuery(this).children("img.zoom").animate({opacity: "hide"}, 250);
	});
	jQuery("#posts_big div.gallery-black").hover(function() {
		jQuery(this).animate({opacity: .9}, 250);
		jQuery(this).children("img.zoom").animate({opacity: "show"}, 250);
		}, function(){
		jQuery(this).stop(true, true).animate({opacity: 1}, 250);
		jQuery(this).children("img.zoom").animate({opacity: "hide"}, 250);
	});
	jQuery("#logo").hover(function() {
		jQuery(this).animate({opacity: .5}, 250);
		}, function(){
		jQuery(this).stop(true, true).animate({opacity: 1}, 250);
	});
	jQuery("#posts_big img.close").click(function() {
		location.reload(true);
	});
	jQuery("#search-form").css({"left" : "-170px", "display" : "none"});
	jQuery("#posts_big div.big_post").css({"top" : "-100px", "display" : "none"});
	jQuery("#search").click(function(){						 
			if (jQuery("#search-form").filter(':hidden').length == 1)	
				jQuery(this).next("#search-form").animate({left: "-150px", opacity: "toggle"}, "slow")
			else
				jQuery(this).next("#search-form").animate({left: "-170px", opacity: "toggle"}, "slow")
			return false;
	});
	
	/*
	// This code breaks the display of flash on the pages with listing (more than one instance) under IE //stu - 21.12.10
if ( !jQuery.support.htmlSerialize ) {
        jQuery('div.big_post object')
            .each(function() {
                jQuery(this).replaceWith(jQuery(this).attr('altHtml'));
            });
    }
*/
	
	// comment form interactivity
	jQuery ( '.wpcf7-form .name input').focus ( function (event)
	{
		var target = jQuery ( event.target );
		if ( target.val () == 'Contact Name' )
		{
			target.val ();
		}	
	});

	jQuery ( '.wpcf7-form .name input').focusout ( function (event)
	{
		
		var target = jQuery ( event.target );
		if ( target.val () == '' )
		{
			target.val ('Contact Name');
		}
	});


	jQuery ( '.wpcf7-form .phone input').focus ( function (event)
	{
		var target = jQuery ( event.target );
		if ( target.val () == 'Mobile Phone' )
		{
			target.val ();
		}	
	});

	jQuery ( '.wpcf7-form .phone input').focusout ( function (event)
	{
		
		var target = jQuery ( event.target );
		if ( target.val () == '' )
		{
			target.val ('Mobile Phone');
		}
	});

	jQuery ( '.wpcf7-form .email input').focus ( function (event)
	{
		var target = jQuery ( event.target );
		if ( target.val () == 'Email Box' )
		{
			target.val ();
		}	
	});

	jQuery ( '.wpcf7-form .email input').focusout ( function (event)
	{
		
		var target = jQuery ( event.target );
		if ( target.val () == '' )
		{
			target.val ('Email Box');
		}
	});	

	jQuery ( '.wpcf7-form .skype input').focus ( function (event)
	{
		var target = jQuery ( event.target );
		if ( target.val () == 'Skype Name' )
		{
			target.val ();
		}	
	});

	jQuery ( '.wpcf7-form .skype input').focusout ( function (event)
	{
		
		var target = jQuery ( event.target );
		if ( target.val () == '' )
		{
			target.val ('Skype Name');
		}
	});	

	jQuery ( '.wpcf7-form .facebook input').focus ( function (event)
	{
		var target = jQuery ( event.target );
		if ( target.val () == 'Facebook Page' )
		{
			target.val ();
		}	
	});

	jQuery ( '.wpcf7-form .facebook input').focusout ( function (event)
	{
		
		var target = jQuery ( event.target );
		if ( target.val () == '' )
		{
			target.val ('Facebook Page');
		}
	});	


	jQuery ( '.wpcf7-form .details textarea').focus ( function (event)
	{
		var target = jQuery ( event.target );
		if ( target.val () == 'Your Request' )
		{
			target.val ();
		}	
	});

	jQuery ( '.wpcf7-form .details textarea').focusout ( function (event)
	{
		
		var target = jQuery ( event.target );
		if ( target.val () == '' )
		{
			target.val ('Your Request');
		}
	});	
    jQuery('div.big_post embed') //  *3*
        .attr('wmode','transparent')
		.eq(0).after('<div></div>');
});

