﻿////////////// main flash banner

$(document).ready(function(){
						       		   
    $('#flash-banner').flash(
        { 
          src: 'http://www.uxperienced.com/wp-content/themes/uxperienced/swf/UX-Header-good-big.swf',
          width: 360,
          height: 185,
		  wmode: 'transparent',
          flashvars: { wmode: 'transparent' }
        },
        { version: 8 }
    );
	   
	$("ul#footer-menu li:last").after("<li><a class='external' href='http://www.aussisimple.com' title='Conception Web AussiSimple | www.aussisimple.com'>Credits</a></li>");
	$("ul#footer-menu li a:last").css('border', 'none');
	$('a.external').attr('target', '_blank');
	
	
/////////////// swich display portfolio page
	$("a.switch_thumb").toggle(function(){
	  $(this).addClass("swap"); 
	  $(".intervention-wrapper").fadeOut("fast");
	  $("ul.display").fadeOut("fast", function() {
		$(this).fadeIn("fast").addClass("thumb_view");
		$(".intervention-wrapper").css("display", "none");
		$("ul.projectThumbs").css("display", "none");
		 });
	  }, function () {
      $(this).removeClass("swap");
	  $("ul.display").fadeOut("fast", function() {											  
	  	$(".intervention-wrapper").css("display", "block").fadeIn("fast");
	  	$("ul.projectThumbs").css("display", "block").fadeIn("fast");
		$(this).fadeIn("fast").removeClass("thumb_view");
		});
	}); 
	
///////////////// make me part of this page
	$('a.media').media({width:780, height:1000});
	
	
//////////////// make me move 
	$("#section1").click(function(){
      $("#scrollable").animate({"top": "0px"}, "slow");
    });
	$("#section2").click(function(){
      $("#scrollable").animate({"top": "-220px"}, "slow");
    });
	$("#section3").click(function(){
      $("#scrollable").animate({"top": "-410px"}, "slow");
    });
	$("#section4").click(function(){
      $("#scrollable").animate({"top": "-550px"}, "slow");
    });
	$("#section5").click(function(){
      $("#scrollable").animate({"top": "-690px"}, "slow");
    });
	$("#section6").click(function(){
      $("#scrollable").animate({"top": "-830px"}, "slow");
    });
	
	$("#section1-fr").click(function(){
      $("#scrollable").animate({"top": "0px"}, "slow");
    });
	$("#section2-fr").click(function(){
      $("#scrollable").animate({"top": "-220px"}, "slow");
    });
	$("#section3-fr").click(function(){
      $("#scrollable").animate({"top": "-460px"}, "slow");
    });
	$("#section4-fr").click(function(){
      $("#scrollable").animate({"top": "-600px"}, "slow");
    });
	$("#section5-fr").click(function(){
      $("#scrollable").animate({"top": "-740px"}, "slow");
    });
	$("#section6-fr").click(function(){
      $("#scrollable").animate({"top": "-880px"}, "slow");
    });
	
////////////////////////give me your langue
	$("a.cvfr").toggle(function(){
      $(".media").find('iframe').attr("src","http://uxperienced.com/wp-content/themes/uxperienced/files/CV_Consultant_Web_Fra.pdf");
	  $("a.cvfr").text('English Version');
    }, function () {
		$(".media").find('iframe').attr("src","http://uxperienced.com/wp-content/themes/uxperienced/files/CV_Web_Consultant_Eng.pdf");
	  $("a.cvfr").text('Version Française');
	});
	
	$("a.cven").toggle(function(){
	  $(".media").find('iframe').attr("src","http://uxperienced.com/wp-content/themes/uxperienced/files/CV_Web_Consultant_Eng.pdf");
	  $("a.cven").text('Version Française');
    }, function () {
      $(".media").find('iframe').attr("src","http://uxperienced.com/wp-content/themes/uxperienced/files/CV_Consultant_Web_Fra.pdf");
	  $("a.cven").text('English Version');
	});
	
	$("a[rel*='colorbox']").colorbox();
	$("a[rel*='lightbox']").colorbox();
	
	$('a[href=""]').each(function(){
		$(this).removeAttr("href");	
	});
	
/////////// Scroll des pages
		/*		$(".page-item-63 a,.page-item-9 a").click(function(){

					$("html, body").animate({
						scrollTop: $("#home_container").offset().top
					}, 2000);
					return false;

				 });
				$(".page-item-60 a,.page-item-275 a").click(function(){

					$("html, body").animate({
						scrollTop: $("#services_container").offset().top
					}, 2000);
					return false;

				 });
				$(".page-item-54 a,.page-item-23 a").click(function(){
					$("html, body").animate({
						scrollTop: $("#resume_container").offset().top
					}, 2000);
					return false;

				 });
				$(".page-item-18 a,.page-item-535 a").click(function(){
					$("html, body").animate({
						scrollTop: $("#portfolio_container").offset().top
					}, 2000);
					return false;

				 });
				$(".page-item-51 a,.page-item-31 a").click(function(){
					$("html, body").animate({
						scrollTop: $("#contact_container").offset().top
					}, 2000);
					return false;

				 });
				 */
				 
///////////////scroller

		var wichItem = $("#home_container");
		var itemPos = wichItem.position();
		$(".page-item-63 a,.page-item-9 a").click(function(){
			//alert(itemPos.left);
			$('#pdf-resume').hide();
			$('#toScroll').css("height", "1300px");
			$("#items").animate({"left": -itemPos.left}, "slow");
			return false;
		});
		var wichItem29 = $("#services_container");
		var itemPos29 = wichItem29.position();
		$(".page-item-60 a,.page-item-275 a").click(function(){
			//alert(itemPos.left);
			$('#pdf-resume').hide();
			$('#toScroll').css("height", "1500px");
			$("#items").animate({"left": -itemPos29.left}, "slow");
			return false;
		});
		var wichItem28 = $("#resume_container");
		var itemPos28 = wichItem28.position();
		$(".page-item-54 a,.page-item-23 a").click(function(){
			//alert(itemPos.left);
			$('#pdf-resume').hide();
			$('#toScroll').css("height", "1500px");
			$("#items").animate({"left": -itemPos28.left}, "slow");
			$('#pdf-resume').show();
			return false;
		});
		var wichItem27 = $("#portfolio_container");
		var itemPos27 = wichItem27.position();
		$(".page-item-18 a,.page-item-535 a").click(function(){
			//alert(itemPos.left);
			$('#pdf-resume').hide();
			$('#toScroll').css("height", "4000px");
			$("#items").animate({"left": -itemPos27.left}, "slow");
			return false;
		});
		var wichItem26 = $("#contact_container");
		var itemPos26 = wichItem26.position();
		$(".page-item-51 a,.page-item-31 a").click(function(){
			//alert(itemPos.left);
			$('#pdf-resume').hide();
			$('#toScroll').css("height", "500px");
			$("#items").animate({"left": -itemPos26.left}, "slow");
			return false;
		});
		
		
		/*var p = $("#page_id=246");
var position = p.position();
$("#mainNav a").click(function(){
			alert(position);
			//$("#items").animate({"left": -itemPos.left}, "slow");
			return false;
		});*/

	
});
 
