$(document).ready(function(){
	
	getWork();

if ( $.browser.msie ) {
 $("#msie").attr('href','css/iespecs.css');
 $('.fix_right').html('&nbsp;');

}

$.preload( '.inmural img', {
    placeholder:'placeholder.jpg',
    notFound:'notfound.jpg'
});



/*
$(function () {
  var img = new Image();
  
  // wrap our new image in jQuery, then:
  $(img)
    // once the image has loaded, execute this code
    .load(function () {
      // set the image hidden by default    
      $(this).hide();
    
      // with the holding div #loader, apply:
      $('#loader')
        // remove the loading class (so no background spinner), 
        .removeClass('loading')
        // then insert our image
        .append(this);
    
      // fade our image in to create a nice effect
      $(this).fadeIn();
    })
    
    // if there was an error loading the image, react accordingly
    .error(function () {
      // notify the user that the image could not be loaded
    })
    
    // *finally*, set the src attribute of the new image to our image
    .attr('src', 'images/alien.gif');
});*/


	//APP
		
		//form functionality
		/*
		$(function() {  
		
		$(".translate").toggle(
		
		 function() {
			$('.translate').html('<a href="#">English <img src="images/us.png" align="absmiddle" alt="English" />');
			$("#budgetlabel").html('Presupuesto: ');
			$("#fromlabel").html('Comienzo: ');
			$("#tolabel").html('Lanzamiento: ');
			$("#prioritylabel").html('Prioridades: <!--<span class="note">(Drag list items to sort)</span>-->');
			$("#pri_budget").html('<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Presupuesto<div class="number" id="numbera">1</div>');
			$("#pri_timing").html('<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Horario/Prisa<div class="number" id="numberb">2</div>');
			$("#pri_function").html('<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Funcionalidad<div class="number" id="numberc">3</div>');
			$("#pri_design").html('<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Dise&ntilde;o<div class="number" id="numberd">4</div>');
			$("#namelabel").html('Nombre:<sup>* </sup> ');
			$("#messagelabel").html('Mensaje:<sup>* </sup> ');
			$("#phonelabel").html('Telefono: ');
			$("#countrycodelabel").html('Pais ');
			$("#areacodelabel").html('Area ');
			$("#emaillabel").html('Correo Electr&oacute;nico:<sup>* </sup> ' );
			$("#localnumberlabel").html('Local ');
			$("#captcha").html('Eres humano?<sup>* </sup>');
			$("#captcha2").html('<b>32</b> mas <b>1</b> es?&nbsp;&nbsp;');
			return false; 

			
		},
		function() {
			$('.translate').html('<a href="#">Espa&ntilde;ol <img src="images/translate.png" align="absmiddle" alt="Trasladar al Espanol" />');
			$("#budgetlabel").html('Budget Range:  ');
			$("#fromlabel").html('Start Date: ');
			$("#tolabel").html('Launch Date: ');
			$("#prioritylabel").html('Priority List: <span class="note">(Drag list items to sort)</span>');
			$("#pri_budget").html('<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Budget<div class="number" id="numbera">1</div>');
			$("#pri_timing").html('<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Timing<div class="number" id="numberb">2</div>');
			$("#pri_function").html('<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Functionality<div class="number" id="numberc">3</div>');
			$("#pri_design").html('<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Design<div class="number" id="numberd">4</div>');
			$("#namelabel").html('Name:<sup>* </sup> ');
			$("#messagelabel").html('Note:<sup>* </sup> ');
			$("#phonelabel").html('Phone: ');
			$("#countrycodelabel").html('Country Code ');
			$("#areacodelabel").html('Area Code');
			$("#emaillabel").html('Email:<sup>* </sup> ' );
			$("#localnumberlabel").html('Local Number ');
			$("#captcha").html('Are You Human?<sup>* </sup>');
			$("#captcha2").html('What number follows <b>32</b>?&nbsp;&nbsp;');
			return false; 
				
		});
		
		
		
		var pri_budget = $("#pri_budget").offset().top;
		pri_budget = Math.ceil(pri_budget);

		var pri_timing = $("#pri_timing").offset().top;
		pri_timing = Math.ceil(pri_timing);
		
		var pri_function = $("#pri_function").offset().top;
		pri_function = Math.ceil(pri_function);
		
		var pri_design = $("#pri_design").offset().top;
		pri_design = Math.ceil(pri_design);
		
		$("#pri_budget").click(
		function () {
			pri_budget = $("#pri_budget").offset().top;
			pri_budget = Math.ceil(pri_budget);
			if(pri_budget == 827){pri_budget = 1;}
			if(pri_budget == 852){pri_budget = 2;}
			if(pri_budget == 877){pri_budget = 3;}
			if(pri_budget == 902){pri_budget = 4;}
		    $("#numbera").html(pri_budget);
		    
		    pri_timing = $("#pri_timing").offset().top;
			pri_timing = Math.ceil(pri_timing);
			if(pri_timing == 827){pri_timing = 1;}
			if(pri_timing == 852){pri_timing = 2;}
			if(pri_timing == 877){pri_timing = 3;}
			if(pri_timing == 902){pri_timing = 4;}
		    $("#numberb").html(pri_timing);
		    
		    pri_function = $("#pri_function").offset().top;
			pri_function = Math.ceil(pri_function);
			if(pri_function == 827){pri_function = 1;}
			if(pri_function == 852){pri_function = 2;}
			if(pri_function == 877){pri_function = 3;}
			if(pri_function == 902){pri_function = 4;}
		    $("#numberc").html(pri_function);
		    
		    pri_design = $("#pri_design").offset().top;
			pri_design = Math.ceil(pri_design);
			if(pri_design == 827){pri_design = 1;}
			if(pri_design == 852){pri_design = 2;}
			if(pri_design == 877){pri_design = 3;}
			if(pri_design == 902){pri_design = 4;}
		    $("#numberd").html(pri_design);
		  
		});
		
		$("#pri_timing").click(
		function () {
			pri_budget = $("#pri_budget").offset().top;
			pri_budget = Math.ceil(pri_budget);
			if(pri_budget == 827){pri_budget = 1;}
			if(pri_budget == 852){pri_budget = 2;}
			if(pri_budget == 877){pri_budget = 3;}
			if(pri_budget == 902){pri_budget = 4;}
		    $("#numbera").html(pri_budget);
		    
		    pri_timing = $("#pri_timing").offset().top;
			pri_timing = Math.ceil(pri_timing);
			if(pri_timing == 827){pri_timing = 1;}
			if(pri_timing == 852){pri_timing = 2;}
			if(pri_timing == 877){pri_timing = 3;}
			if(pri_timing == 902){pri_timing = 4;}
		    $("#numberb").html(pri_timing);
		    
		    var pri_function = $("#pri_function").offset().top;
			pri_function = Math.ceil(pri_function);
			if(pri_function == 827){pri_function = 1;}
			if(pri_function == 852){pri_function = 2;}
			if(pri_function == 877){pri_function = 3;}
			if(pri_function == 902){pri_function = 4;}
		    $("#numberc").html(pri_function);
		    
		    pri_design = $("#pri_design").offset().top;
			pri_design = Math.ceil(pri_design);
			if(pri_design == 827){pri_design = 1;}
			if(pri_design == 852){pri_design = 2;}
			if(pri_design == 877){pri_design = 3;}
			if(pri_design == 902){pri_design = 4;}
		    $("#numberd").html(pri_design);
		  
		});
		
		$("#pri_function").click(
		function () {
			pri_budget = $("#pri_budget").offset().top;
			pri_budget = Math.ceil(pri_budget);
			if(pri_budget == 827){pri_budget = 1;}
			if(pri_budget == 852){pri_budget = 2;}
			if(pri_budget == 877){pri_budget = 3;}
			if(pri_budget == 902){pri_budget = 4;}
		    $("#numbera").html(pri_budget);
		    
		    pri_timing = $("#pri_timing").offset().top;
			pri_timing = Math.ceil(pri_timing);
			if(pri_timing == 827){pri_timing = 1;}
			if(pri_timing == 852){pri_timing = 2;}
			if(pri_timing == 877){pri_timing = 3;}
			if(pri_timing == 902){pri_timing = 4;}
		    $("#numberb").html(pri_timing);
		    
		    pri_function = $("#pri_function").offset().top;
			pri_function = Math.ceil(pri_function);
			if(pri_function == 827){pri_function = 1;}
			if(pri_function == 852){pri_function = 2;}
			if(pri_function == 877){pri_function = 3;}
			if(pri_function == 902){pri_function = 4;}
		    $("#numberc").html(pri_function);
		    
		    pri_design = $("#pri_design").offset().top;
			pri_design = Math.ceil(pri_design);
			if(pri_design == 827){pri_design = 1;}
			if(pri_design == 852){pri_design = 2;}
			if(pri_design == 877){pri_design = 3;}
			if(pri_design == 902){pri_design = 4;}
		    $("#numberd").html(pri_design);
		  
		});
		
		$("#pri_design").click(
		function () {
			pri_budget = $("#pri_budget").offset().top;
			pri_budget = Math.ceil(pri_budget);
			if(pri_budget == 827){pri_budget = 1;}
			if(pri_budget == 852){pri_budget = 2;}
			if(pri_budget == 877){pri_budget = 3;}
			if(pri_budget == 902){pri_budget = 4;}
		    $("#numbera").html(pri_budget);
		    
		    pri_timing = $("#pri_timing").offset().top;
			pri_timing = Math.ceil(pri_timing);
			if(pri_timing == 827){pri_timing = 1;}
			if(pri_timing == 852){pri_timing = 2;}
			if(pri_timing == 877){pri_timing = 3;}
			if(pri_timing == 902){pri_timing = 4;}
		    $("#numberb").html(pri_timing);
		    
		    pri_function = $("#pri_function").offset().top;
			pri_function = Math.ceil(pri_function);
			if(pri_function == 827){pri_function = 1;}
			if(pri_function == 852){pri_function = 2;}
			if(pri_function == 877){pri_function = 3;}
			if(pri_function == 902){pri_function = 4;}
		    $("#numberc").html(pri_function);
		    
		    pri_design = $("#pri_design").offset().top;
			pri_design = Math.ceil(pri_design);
			if(pri_design == 827){pri_design = 1;}
			if(pri_design == 852){pri_design = 2;}
			if(pri_design == 877){pri_design = 3;}
			if(pri_design == 902){pri_design = 4;}
		    $("#numberd").html(pri_design);
		  
		});
		
		$("#submit").click(function() {
		
		var name = $("input#name").val();
		var email = $("input#email").val();
		var message = $("textarea#message").val();
		var budget = $("input#amount").val();
		var country = $("select#country").val();
		var fromdate = $("input#from").val();
		var todate = $("input#to").val();
		var countrycode = $("input#countrycode").val();
		var areacode = $("input#areacode").val();
		var localnumber = $("input#localnumber").val();
		var captcha = $("input#captcha").val();
						
		if(name == ''){
		$("#error1").html('Please tell us your name.');
		}
		if(email == ''){
		$("#error2").html('Please provide an email address.');
		}
		if(message == ''){
		$("#error3").html('Please describe your project.');
		}
		if(captcha != '33'){
		$("#error4").html('That\'s incorrect. Try again.');
		}
		
		//Process Form
		var dataString = '&name= '+ name + '&email= ' + email + '&message= ' + message + '&country= ' + country + '&budget= ' + budget + '&fromdate= ' + fromdate + '&todate= ' + todate + '&countrycode= ' + countrycode + '&areacode= ' + areacode + '&localnumber= ' + localnumber + '&pri_budget=' + pri_budget + '&pri_timing=' + pri_timing + '&pri_function=' + pri_function + '&pri_design=' + pri_design + '&captcha=' + captcha; 
 		
		
		if(name && email && message && captcha == '33'){
						
		
		 $.ajax({
    type: "POST",
    url: "form/process.php",
    data: dataString,
    success: function() {
      $('.logiform').css("display", "none");  
     	$('#sent').html('<img src="images/thanks.jpg" alt="thanks" align="absmiddle" /><b>Thanks! We\'ll get back to you shortly.</b>  <br /><div class="main_articles"><h3>Snapshot of AMtoPM Creative</h3><p>Here\'s what we\'re not. We\'re not the over-the-top, creative cowboys who overwhelm you with web philosophy. We\'re the ones who crave a more intuitive and simplified web <a href="http://blog.amtopmcreative.com/?p=29">[...]</a> </p></div>'); 
    }
  });
  return false;

		
 		
		}//end if
		return false;
		});
		});
		
		
		//slider
		$(function() {
		$("#slider").slider({
			range: true,
			min: 500,
			max: 10000,
			values: [1200, 3000],
			slide: function(event, ui) {
				$("#amount").val('$' + ui.values[0] + ' - $' + ui.values[1]);
			}
		});
		$("#amount").val('$' + $("#slider").slider("values", 0) + ' - $' + $("#slider").slider("values", 1));
		});
		
		//dates
		$(function() {
		var dates = $('#from, #to').datepicker({
			defaultDate: "+2w",
			changeMonth: true,
			numberOfMonths: 1,
			onSelect: function(selectedDate) {
				var option = this.id == "from" ? "minDate" : "maxDate";
				var instance = $(this).data("datepicker");
				var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
				dates.not(this).datepicker("option", option, date);
			}
		});
	});
	
	
	//sortable
	$(function() {
	
		$("#sortable").sortable({
			placeholder: 'ui-state-highlight'
		});
		
		$("#sortable").disableSelection();
	});

  */
  $(".sample1").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample1').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
    $(".bigsample").html("<div class='bigimages'><img src='images/samples/isla.jpg' alt=Shopisla.com' /></div><!-- end bigimages --><div class='description'><h1>Shopisla.com</h1>It was a large task, but definitely an exciting undertaking. We developed a self sustaining e-commerce community for Shopisla.com, complete with a comprehensive shop dashboard for sellers and a highly intuitive interface for buyers. We've recently completed an abbreviated mobile version of the site. </div><!-- end description -->");
    $(".visit").html("<a href='http://www.shopisla.com/' target='_blank'>&nbsp;</a>");
    
  });
  
  $(".sample2").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample2').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
    $(".bigsample").html("<div class='bigimages'><img src='images/samples/china.jpg' alt='SCN - China' /></div><!-- end bigimages --><div class='description'><h1>Small Cap Network - China</h1>After completing the refresh for the SmallCap Network site, the Levelogic team came back to us to expand the SmallCap brand east. Far east. With many American investors looking to invest in the Chinese Market, SmallCap expanded their very successful brand to target those investors.<br /><br />We partnered with Levelogics' talented developers and designed a dynamic site (still in development) that exudes market success. </div><!-- end description -->");
    $(".visit").html("<a href='http://www.amtopmcreative.com/samples/china2.html' target='_blank'>&nbsp;</a>");
    
  });
  
  $(".sample3").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample3').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
   $(".bigsample").html("<div class='bigimages'><img src='images/samples/eb.jpg' alt='EB Exchange Funds' /></div><!-- end bigimages --><div class='description'><h1>EB Exchange Funds</h1>When Larry Albukerk's company received a mention in the Wall Street Journal, traffic to their outdated site went from 10 clicks to nearly 300 in of 48 hours. We scrambled to put together a modern and press-ready brand for his three divisions in time to capitalize on their sudden rise. </div><!-- end description -->");
   $(".visit").html("<a href='http://www.ebexchangefunds.com' target='_blank'>&nbsp;</a>");

  });
  
  $(".sample4").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample4').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
   $(".bigsample").html("<div class='bigimages'><img src='images/samples/divine.jpg' alt='Divine Word Art' /></div><!-- end bigimages --><div class='description'><h1>Divine Word Art</h1>Hogan Imaging approached us looking for a unique way to translate their collection of word art to the web. We developed an online app where users can almost instantaneously assemble a name or message using photographs. The user can then purchase their custom artwork with one click. We also created a logo/identity for their new brand.</div><!-- end description -->");
   $(".visit").html("<a href='http://www.divinewordart.com' target='_blank'>&nbsp;</a>");

  });
  
  $(".sample5").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample5').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
   $(".bigsample").html("<div class='bigimages'><img src='images/samples/harvest.jpg' alt='Harvest Blade' /></div><!-- end bigimages --><div class='description'><h1>Harvest Blade</h1>The folks at Harvest Blade had a small window, but we were able to pull off a Wordpress driven site with scalability and flexibility at a very competitive price. </div><!-- end description -->");
   
   $(".visit").html("<a href='http://www.harvestblade.com' target='_blank'>&nbsp;</a>");

  });
  
  $(".sample6").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample6').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
    $(".bigsample").html("<div class='bigimages'><img src='images/samples/hoppers.jpg' alt='Hoppers' /></div><!-- end bigimages --><div class='description'><h1>Hoppers.tv</h1><em>Let us do the hopping for you.</em> Ricardo Marti and Marialex Del Toro came to us wanting to develop a website that would do exactly that. We developed a video channel that taps in to live video feeds of the hottest bars and restaurants in the San Juan area. We packed this site with a comprehensive custom content management system. We also developed a companion mobile site complete with streaming.   </div><!-- end description -->");
    $(".visit").html("<a href='http://hoppers.tv' target='_blank'>&nbsp;</a>");
  });
  
  
  $(".sample7").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample7').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
    $(".bigsample").html("<div class='bigimages'><img src='images/samples/chairs.jpg' alt='Chairs 4 Charity' /></div><!-- end bigimages --><div class='description'><h1>Chairs 4 Charity</h1>Barry Mendelson, a Testicular Cancer survivor, sought a way to turn two of his hobbies (skiing and wood working) into a valuable community service. He organized Chairs 4 Charity, turning old skis, snowboards, and salvaged lumber into  Adirondack chairs and benches. The furniture is sold at auction to support some great causes in the San Francisco Bay area. When Barry's friend David Morris (our client) mentioned it to us, we were on board.  </div><!-- end description -->");
    $(".visit").html("<a href='http://www.chairs4charity.org' target='_blank'>&nbsp;</a>");
  });
  
  $(".sample8").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample8').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
    $(".bigsample").html("<div class='bigimages'><img src='images/samples/metro.jpg' alt='Metro Charlotte Market' /></div><!-- end bigimages --><div class='description'><h1>Metro Charlotte Market</h1>Competing in the Real Estate Market is a difficult task for even the most promising Realtors. Eric Layne was looking for some edge and concise way to share his unique take with his demographic.<br /><br />We designed and developed a comprehensive site, rich with market resources, an integrated blog, and IDX realty search.</div><!-- end description -->");
    $(".visit").html("<a href='http://www.metrocharlottemarket.com' target='_blank'>&nbsp;</a>");
  });
  
  
  
  $(".sample9").click(
    function () {
    $('.recent').fadeIn("fast");
    $('.bigsample9').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
    $(".bigsample").html("<div class='bigimages'><img src='images/samples/carolina.jpg' alt='Carolina Comfort Food' /></div><!-- end bigimages --><div class='description'><h1>Carolina Comfort Food</h1>North and South Carolina are well known for some of the most comforting and mouth watering food in the south. Carolina Comfort Food put together a list of some of the rarest and the best. <br/><br /> We developed a rating system, dynamic mapping, and a shop for their Sweet Tees brand. This one was a lot of fun, except that we were constantly hungry. </div><!-- end description -->");
    $(".visit").html("<a href='http://www.carolinacomfortfood.com' target='_blank'>&nbsp;</a>");
  });
  
    $(".info").mouseenter(function() {
         $('.description').fadeIn("fast");
    	 $('.bigimages').fadeOut("fast");
    	 $('.bigimages').css('height','1px');
   }).mouseleave(function() {
     	$('.description').hide();
     	$('.bigimages').fadeIn("fast");
     	$('.bigimages').css('height','341px');
  });
   
   $(".info").click(function() {
   //$('.description').fadeIn("fast");
   return false;
   });
   
   $(".closerecent").click(
    function () {
    $('.recent').fadeOut("fast");
    $('.worksamples').fadeIn("fast");
  });
  
 
   
  $(".sample1").mouseenter(function() {
  $('.samp1a').find(':first').stop();
			$('.samp1a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp1b').find(':first').stop();
			$('.samp1b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp1a').find(':first').stop();
			$('.samp1a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp1b').find(':first').stop();
			$('.samp1b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });
  
  $(".sample2").mouseenter(function() {
  $('.samp2a').find(':first').stop();
			$('.samp2a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp2b').find(':first').stop();
			$('.samp2b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp2a').find(':first').stop();
			$('.samp2a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp2b').find(':first').stop();
			$('.samp2b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });


$(".sample3").mouseenter(function() {
  $('.samp3a').find(':first').stop();
			$('.samp3a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp3b').find(':first').stop();
			$('.samp3b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp3a').find(':first').stop();
			$('.samp3a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp3b').find(':first').stop();
			$('.samp3b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });
  
  $(".sample4").mouseenter(function() {
  $('.samp4a').find(':first').stop();
			$('.samp4a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp4b').find(':first').stop();
			$('.samp4b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp4a').find(':first').stop();
			$('.samp4a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp4b').find(':first').stop();
			$('.samp4b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });
  
   $(".sample5").mouseenter(function() {
  $('.samp5a').find(':first').stop();
			$('.samp5a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp5b').find(':first').stop();
			$('.samp5b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp5a').find(':first').stop();
			$('.samp5a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp5b').find(':first').stop();
			$('.samp5b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });


 $(".sample6").mouseenter(function() {
  $('.samp6a').find(':first').stop();
			$('.samp6a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp6b').find(':first').stop();
			$('.samp6b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp6a').find(':first').stop();
			$('.samp6a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp6b').find(':first').stop();
			$('.samp6b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });
  
  $(".sample7").mouseenter(function() {
  $('.samp7a').find(':first').stop();
			$('.samp7a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp7b').find(':first').stop();
			$('.samp7b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp7a').find(':first').stop();
			$('.samp7a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp7b').find(':first').stop();
			$('.samp7b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });
  
   $(".sample8").mouseenter(function() {
  $('.samp8a').find(':first').stop();
			$('.samp8a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp8b').find(':first').stop();
			$('.samp8b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp8a').find(':first').stop();
			$('.samp8a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp8b').find(':first').stop();
			$('.samp8b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });
  
   $(".sample9").mouseenter(function() {
  $('.samp9a').find(':first').stop();
			$('.samp9a').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

	$('.samp9b').find(':first').stop();
			$('.samp9b').find(':first').animate({
				marginTop: -63
			}, 250, 'easeOutQuad');

  }).mouseleave(function() {
    $('.samp9a').find(':first').stop();
			$('.samp9a').find(':first').animate({
				marginTop: 0
			}, 250, 'easeInQuad');
	
	$('.samp9b').find(':first').stop();
			$('.samp9b').find(':first').animate({
				marginTop: 0
			}, 250, 'easeOutQuad');

  });
  
  
  var left;
  //MORE WORK SAMPLES
   $(".next").click(
  function () {
	  left = $('.workcarousel').find(':first').css("marginLeft");
	  
	 left = left.replace('px','');
	 
	 if(left > -498) {
	$('.workcarousel').find(':first').stop();
	$('.workcarousel').find(':first').animate({
		'marginLeft': '-=98px'
	}, 250, 'easeOutQuad');
	 }//left
    return false;
  });

 $(".previous").click(
  function () {
	
	left = $('.workcarousel').find(':first').css("marginLeft");
	left = left.replace('px','');
	
	if(left < 0){
	$('.workcarousel').find(':first').stop();
	$('.workcarousel').find(':first').animate({
		'marginLeft': '+=98px'
	}, 250, 'easeOutQuad');  
	}//left
  	return false;
  });

      
  //TEAM
   	$(".ourteam").click(getTeam);
    $(".n_team").click(getTeam);
    
    function getTeam() {
    $('.team').fadeIn("fast");
	
    if (!$(".services").is(":hidden")) {
    $('.services').hide();
    };
    if (!$(".worksamples").is(":hidden")) {
    $('.worksamples').hide();
    };
    if (!$(".recent").is(":hidden")) {
    $('.recent').hide();
    };  
    if (!$(".testimonial").is(":hidden")) {
    $('.testimonial').hide();
    }; 
	
 	};//end getTeam
 	
 	
 	
 	//Email team
 	
 	/**/
 	 $(".jill").simpletip({ 
  	 content: '<div class="tip"><a href="mailto:jill@amtopmcreative.com">Email Jill</a></div>',
 	 position: [11, 330],
 	 fixed: true	 
 	 });

	 $(".carlos").simpletip({ 
  	 content: '<div class="tip2"><a href="mailto:carlos@amtopmcreative.com">Email Carlos</a></div>',
 	 position: [7, 330],
 	 fixed: true
 	 });
 	 
 	 if ( $.browser.msie ) {
  		 var x = 297;
 		 var y = -52;
		}else{
		 var x = 297;
 		 var y = -56;
		}
 	
 	 
 	 $(".contact").simpletip({ 
  	 content: '<div class="ctip"><ul><li><div class="bgwhite"><a href="mailto:jill@amtopmcreative.com"><b>Jill</b><br /><span  class="gray">jill@amtopmcreative.com</span></a></div></li><li><div class="bgray"><a href="mailto:carlos@amtopmcreative.com"><b>Carlos</b><br /><span class="gray">carlos@amtopmcreative.com</span></a></div></li><li><div class="bgray2"><a href="mailto:team@amtopmcreative.com"><b>General Info</b><br /><span class="gray">team@amtopmcreative.com</span></a></div></li></ul></div></ul></div>',
 	 position: [x, y],
 	 fixed: true
 	 });
 	 
  
 	$(".closeteam").click(
    function () {
    $('.team').fadeOut("fast");
 	  });


$(".jill").click(
    function () {
    $('.jill').hide();
    $('.carlos').fadeIn("fast");
 	  });


$(".carlos").click(
    function () {
    $('.carlos').hide();
    $('.jill').fadeIn("fast");
 	  });

  //CAPABILITiES	
  
   Capa();

   $(".capabilities").click(Capa)
   $(".n_capa").click(Capa)
  
    function Capa () {
    var menu = "<a href='#' class='service1'>User Interface Design &raquo;</a><br /><a href='#' class='service2'>Data Driven Applications &raquo;</a><br /><a href='#' class='service3'>Identity/Branding &raquo;</a><br /><a href='#' class='service5'>Wordpress &raquo;</a><br /><a href='#' class='service6'>E-Commerce &raquo;</a><br /><a href='#' class='service7'>Mobile Sites &raquo;</a><br /><a href='http://blog.amtopmcreative.com/?cat=7' target='_blank'>More &raquo;</a>";
	
	var ui = "<b>User Interface Design</b><br /><b>UI</b> is all about <em>ebb and flow</em>. Our expertise and our passion is for a more simplified and intuitive web.";
	
	var apps = "<b>Data Driven Applications</b><br />Web apps are what we love. They give us the opportunity to turn your raw database into an experience that users appreciate and enjoy.";
	
	var branding = "<b>Identity/Branding</b><br />A sketch on a napkin, some clipart in MS Word, or just a thought in your head. Let us translate your identity into a brand you and others will love.";
	
	var wordpress = "<b>Wordpress</b><br />Driving traffic to a site means having fresh content. We can equip you with a custom Wordpress site, so that updating content is a breeze.";
	
	var shops = "<b>E-Commerce</b><br />We're proven in developing dynamic e-shops. Sell 10 products or 10,000. We can help you build your store-front, and catalog.";
	
	var mobile = "<b>Mobile Sites</b><br />Mobile sites, apps, and games. Mobile UI design/programming is our expertise.";
    
	var cap = 'ui';
	
	var nxt = "<a href='#' id='nxt' style='float:right; margin-right:24px;'>Next &raquo;</a>";
	var prv = "<a href='#' id='prv' >&laquo; Prev</a>";
	
	function getPrev(){
	if(curcap == 0){
		prv = '';	
		}else{
		prv = "<a href='#' id='prv' >&laquo; Prev</a>";	
		}	
	}
	
	var caps = new Array(ui,apps,branding,wordpress,shops,mobile);
	var curcap = 0;
	function prvnxt(){
		
		
	
	$("#nxt").click(function(){
		if(curcap <= 4){
			++curcap;
		}else{
			curcap = 0;	
		}
		getPrev();
		$(".service").html(caps[curcap]+"<div class='yellow'><br />"+prv+"  "+nxt+"</div>");
		prvnxt();
		
		//alert(curcap);
		return false;
	})
	
	$("#prv").click(function(){
		if(curcap > 0){
			--curcap;
		}else{
			curcap = 0;	
		}
		getPrev();
		$(".service").html(caps[curcap]+"<div class='yellow'><br />"+prv+"  "+nxt+"</div>");
		prvnxt();
		
		//alert(curcap);
		return false;
	})
	}
	
    $(".back").click(
    function () {
	$(".service").html(menu);
	});

    $('.services').fadeIn("fast");
    $(".service").html(menu);
 	 if (!$(".worksamples").is(":hidden")) {
   // $('.worksamples').hide();
    };
    if (!$(".recent").is(":hidden")) {
    //$('.recent').hide();
    };  
    if (!$(".testimonial").is(":hidden")) {
   // $('.testimonial').hide();
    }; 
    
    $(".service1").click(
    function () {
	$(".service").html(caps[0]+"<div class='yellow'><br />"+nxt+"</div>");
	prvnxt();
	curcap = 0;
		return false;

	});
	
	$(".service2").click(
    function () {
	$(".service").html(caps[1]+"<div class='yellow'><br />"+prv+nxt+"</div>");
	prvnxt();
	curcap = 1;
		return false;

	});
	
	$(".service3").click(
    function () {
	$(".service").html(caps[2]+"<div class='yellow'><br />"+prv+nxt+"</div>");
	prvnxt();
	curcap = 2;
		return false;

	
	});
	
	/*
	$(".service4").click(
    function () {
	$(".service").html('');
		return false;
	});
	*/
	
	$(".service5").click(
    function () {
	$(".service").html(caps[3]+"<div class='yellow'><br />"+prv+nxt+"</div>");
	prvnxt();
	curcap = 3;
		return false;

		});
	
	$(".service6").click(
    function () {
	$(".service").html(caps[4]+"<div class='yellow'><br />"+prv+nxt+"</div>");
	prvnxt();
	curcap = 4;
		return false;

	
	});
	
	$(".service7").click(
    function () {
	$(".service").html(caps[5]+"<div class='yellow'><br />"+prv+nxt+"</div>");
	prvnxt();
	curcap = 5;
		return false;

		});
	
   }//end Capa function
   
     

   
     $(".closecapa").click(
    function () {
    $('.services').fadeOut("fast");
   });
  
   //WORK	
   $(".recentwork").click(getWork);
   $(".n_work").click(getWork);
   
    function getWork() {
    $('.worksamples').fadeIn("fast");
    $('.testimonial').fadeOut("fast");
     if (!$(".services").is(":hidden")) {
    $('.services').hide();
    };
   };
   
   $(".closesamples").click(
    function () {
    $('.worksamples').fadeOut("fast");
   });
   
  
  //TESTIMONIALS 
  var slide = 0;
   
  $(".testimonials").click(function () {
	   
		
	if(slide == 0){
	$('.less').hide();	
	}
	  
    $('.testimonial').fadeIn("fast");
    $('.worksamples').fadeOut("fast");
    if (!$(".team").is(":hidden")) {
    $('.team').hide();
    };
     if (!$(".services").is(":hidden")) {
    $('.services').hide();
    }; 
  });
  
  $(".closetestimonials").click(
    function () {
    $('.testimonial').fadeOut("fast");
   });
   
	/*if ( $.browser.msie ) {
	var margintop = '-=65px';
	var marginbot = '+=65px';
	var marginend = '7';
	}else{
	var margintop = '-=60px';
	var marginbot = '+=60px';
	var marginend = '0';
	}*/

   var lft;
   //MORE
   $(".more").click(function () {
	    lft = $('.quote').find(':first').css("marginLeft");
	  	lft = lft.replace('px','');
	 
	   $('.less').show();
		if(lft <= 0 && lft > -1212){
		   
		
		$('.quote').find(':first').stop();
		$('.quote').find(':first').animate({
				'marginLeft': '-=267'
			}, 250, 'easeOutQuad');
		
		}//lft
			
			return false;
  });
  
   $(".less").click(function () {
	   lft = $('.quote').find(':first').css("marginLeft");
	  	lft = lft.replace('px','');
	
	   
		if(lft != 0){
		 
			
			$('.quote').find(':first').stop();
			$('.quote').find(':first').animate({
					'marginLeft': '+=267'
				}, 250, 'easeOutQuad');
		}//lft
		
		
			return false;
  });

    

  
   /* if (!$(".worksamples").is(":hidden")) {
    $('.worksamples').hide();
    };*/
  
});

