$.noConflict();
jQuery(document).ready(function($) {
$("body").addClass("jQ");
//constants, variables, etc.
jQuery.easing.def = 'easeInOutQuad';
$.ajaxSetup({cache:false});
$iteURL = 'http://acepek.com';
$iteThemeURL = 'http://acepek.com/wp-content/themes/acepek'
var turnSpeed = 1600;
$navCodeClick = 0;
$navVisualClick = 0;
$interactHover=false;
$codeFlyOut=false;
$visualFlyOut=false;
$onlyOnce = true;
$hireHover = false;
$fm_cont = '';
$hown = false;

//acepek hover
$('#core header#aaron-cepek').hover(
	function(){	
				$interactHover=true;
				if ($('#contact .first-slide').css('width')=='0px'){
				$('#contact .first-slide').stop().animate({'width':'98'},400,function(){$('#contact .second-slide').stop().animate({'width':'98'},400,function(){});});
				$('#social-media .first-slide').stop().animate({'width':'115'},400,function(){$('#social-media .second-slide').stop().animate({'width':'115'},400,function(){});});}
			  }, function(){$interactHover=false;});

$('#core header#aaron-cepek').mouseleave(function(){setTimeout(function(){if (!$interactHover & $('#contact .first-slide').css('width')=='98px') {
	$('#contact .second-slide').animate({'width':'0'},300,function(){$('#contact .first-slide').stop().animate({'width':'0'},300,function(){});});
	$('#social-media .second-slide').animate({'width':'0'},300,function(){$('#social-media .first-slide').stop().animate({'width':'0'},300,function(){});});
}}, 3000);});

//nav hover->open
$("#coding div").hover(
  function () {$('#coding section').stop().animate({width:259},800, function() {$codeFlyOut=true;}); $("#coding div.more").css({"backgroundPosition":'right top'});}, 
  function () {/**/}
);
$("#visual div").hover(
  function () {$('#visual section').stop().animate({width:259},800, function() {$visualFlyOut=true;}); $("#visual div.more").css({"backgroundPosition":'left top'});}, 
  function () {/**/}
);
//nav click->hide<-show
$("#coding div.more").click(function(){if ($codeFlyOut) {$('#coding section').stop().animate({width:66},600, function() {$codeFlyOut=false; initialSubMenuStates (true,false); deActivate(); }); $("#coding div.more").css({"backgroundPosition":'37px top'});} else {$('#coding section').stop().animate({width:259},800, function() {$codeFlyOut=true;}); $("#coding div.more").css({"backgroundPosition":'right top'});} });
$("#visual div.more").click(function(){if ($visualFlyOut) {$('#visual section').stop().animate({width:66},600, function() {$visualFlyOut=false; initialSubMenuStates (false,true); deActivate(); }); $("#visual div.more").css({"backgroundPosition":'-37px top'});} else {$('#visual section').stop().animate({width:259},800, function() {$visualFlyOut=true;}); $("#visual div.more").css({"backgroundPosition":'left top'});} });

//sub-menu->rotate
function initialSubMenuStates (codeState,visualState) {
if (codeState) {
	if ($navCodeClick) {
		$("#web-dev div").animate({rotate: '-90deg'}, 600);
		$("#technical div").animate({rotate: '-90deg'}, 600);
	}
	else {
			$("#web-dev div").rotate('-90deg');
			$("#technical div").rotate('-90deg');
	}
}
if (visualState) {
	if ($navCodeClick) {
		$("#design div").animate({rotate: '90deg'}, 600);
		$("#animation div").animate({rotate: '90deg'}, 600);
	}
	else {
		$("#design div").rotate('90deg');
		$("#animation div").rotate('90deg');
	}
}
} initialSubMenuStates (true,true);
	$('#web-dev a').click( function(e) {e.preventDefault(); $navCodeClick=1; deActivate($('#web-dev h2 a')); $("#technical div").animate({rotate: '-90deg'}, 600*$navCodeClick,function() { $("#web-dev div").animate({rotate: '0deg'}, 600);}); });
	$('#technical a').click( function(e) {e.preventDefault(); $navCodeClick=1; deActivate('#technical h2 a'); $("#web-dev div").animate({rotate: '-90deg'}, 600*$navCodeClick, function() { $("#technical div").animate({rotate: '0deg'}, 600);}); });
	$('#design a').click( function(e) {e.preventDefault(); $navVisualClick=1; deActivate('#design h2 a'); $("#animation div").animate({rotate: '90deg'}, 600*$navVisualClick,function() { $("#design div").animate({rotate: '0deg'}, 600);}); hideTheresMore(); $("section#intro #hire-me").hide(); $hown = false;});
	$('#animation a').click( function(e) {e.preventDefault(); $navVisualClick=1; deActivate('#animation h2 a'); $("#design div").animate({rotate: '90deg'}, 600*$navVisualClick, function() { $("#animation div").animate({rotate: '0deg'}, 600);}); hideTheresMore(); $("section#intro #hire-me").hide(); $hown = false;});
//sub-menu post->meta
$("nav ul li ul li").hover(
   	function () {$postID=$(this).attr('data-pid'); $postID=$postID.substr(3);
	$('nav ul li ul li #post-'+$postID+'-details dd:hidden').slideDown(500,'easeInOutQuart');},
	function () {$('nav ul li ul li dd').hide();} );
$("nav ul#code-mode li ul li a").hover(function () {if ($(this).attr('rel')=='post') {$('nav ul#code-mode li ul li .arrow').stop().css({top:0}).animate({top:12},300,'easeOutBounce');}});
$("nav ul#eye-candy li ul li a").hover(function () {if ($(this).attr('rel')=='post') {$('nav ul#eye-candy li ul li .arrow').stop().css({left:-25}).animate({left:-11},300,'easeOutBounce');}});
//sub-menu post->meta fx
$("nav ul#code-mode li ul li details dt").hover(
  function () {$(this).stop().animate({width:57,marginLeft:-4},200);}, 
  function () {$(this).stop().animate({width:53,marginLeft:0},200);}
);
$("nav ul#code-mode li ul li details dd").hover(
   function () {
	   			$meta=$(this).attr('data-meta');
  			    $('nav ul li ul li details dt').filter(function(){return $(this).attr('data-meta')==$meta;}).stop().animate({width:57,marginLeft:-4},200);
   			   },
   function () {$('nav ul li ul li details dt').filter(function(){return $(this).attr('data-meta')==$meta;}).stop().animate({width:53,marginLeft:0},200);}
);
$("nav ul#eye-candy li ul li details dt").hover(
  function () {$(this).stop().animate({width:57},200);}, 
  function () {$(this).stop().animate({width:53},200);}
);
$("nav ul#eye-candy li ul li details dd").hover(
   function () {$meta=$(this).attr('data-meta');
  			    $('nav ul li ul li details dt').filter(function(){return $(this).attr('data-meta')==$meta;}).stop().animate({width:57},200);
   			   }, 
   function () {$('nav ul li ul li details dt').filter(function(){return $(this).attr('data-meta')==$meta;}).stop().animate({width:53},200);}
);
//sub-menu->load post
$("a, article .content div.post-excerpt").live('click', function (e) {
																  
	if ($(this).attr('rel')=='post') {
		e.preventDefault();
		$dpid=$(this).attr('data-pid');
		$hemi=$(this).attr('data-hemisphere');
		$vids=$(this).attr('data-video');
		if (!$(this).attr('href')) {$permalink=$(this).attr('data-href');} else {$permalink=$(this).attr('href');}
		ajaxLoad ($(this).attr('data-pid'),"."+$hemi,1,$permalink,$(this).attr('title'));
		$("section#intro #hire-me").hide();
		hideTheresMore();
		videoBG ($vids);
	}
	if ($(this).attr('rel')=='category' 	|
		$(this).attr('rel')=='tag'			|
		$(this).attr('rel')=='category tag'	) {
		if ($(this).attr('rel')=='tag') {window.location.href=$(this).attr('href')} else {e.preventDefault();
		$dpid=$(this).attr('data-catid');
		if ($dpid=="") {$dpid=$(this).attr('data-pid');}
		$hemi=$(this).attr('data-hemisphere');
		$vids=$(this).attr('data-video');
		ajaxLoadCategory ($dpid,"."+$hemi,1,$(this).attr('href'),$(this).attr('title'));
		$("section#intro #hire-me").hide();
		hideTheresMore();
		videoBG ($vids);}
	}
	/*if ($(this).attr('rel')=='influence') {
		e.preventDefault();
		$hemi=$(this).attr('data-hemisphere');
		ajaxLoadInfluence ($(this).attr('data-taxonomy'),$(this).attr('data-term'),"."+$hemi,1,$(this).attr('href'),$(this).attr('title'));
		$("section#intro #hire-me").hide();
		hideTheresMore();
	}*/
});

//intro
$('#intro #there-is-more').click(function(e){
	e.preventDefault();
	if ($onlyOnce) {
	$.scrollTo('#read-more',500,{offset:-50});
	$(this).animate({'letter-spacing':'1'},200,function() {$keepIntro = $(this).html(); $(this).html('<strong>-</strong> less');});
	$('#intro #read-more').css({width:200});
	for ($n=5;$n>0;$n--){
		$('#intro #read-more #distance'+$n).animate({left:0},200*$n,function(){if ($onlyOnce) {$('#intro #read-more p').delay(1000).animate({opacity:1},800); $onlyOnce = false; $moreOpen=true;}});
	$("section#intro #hire-me").hide();
	initialSubMenuStates (false,true);
	
		} 
	} else {if (!$onlyOnce){hideTheresMore();}}
});
//intro -> more
$('section#intro').mouseenter(function(){$moreHover=true;});
$('section#intro').mouseleave(function(){$moreHover=false;
setTimeout(function(){if(!$moreHover){hideTheresMore();}},15000);
});
// intro -> hire
$("section#intro a#hire").hover(
  function () {$hireHover=true; animateArrow();}, 
  function () {$("section#intro a span").stop().animate({"letter-spacing":5},600); $hireHover=false;}
);
function animateArrow() {$("section#intro a span").animate({"letter-spacing":1},400,function(){ $("section#intro a span").animate({"letter-spacing":15},400,function(){if ($hireHover) {animateArrow();} });});} 

$("section#intro a#hire, .contact-me").click(function (e) {
	e.preventDefault();
	if ($("section#intro #hire-me").css("display")=="block"){
		$("section#intro #hire-me").hide();
		$("#meeru,#renraku,#send").hide();
		$("#black-bg, .contact").show();
		displayPost (".right-hemisphere",1);
		}
	else {
		$("section#intro #hire-me").show();
		$("#meeru,#renraku,#send").hide();
		$("#black-bg, .contact").show(); 
		initialSubMenuStates (false,true);
		displayPost (".right-hemisphere",0);
		$.scrollTo('a#hire',500,{offset:-200});
		hideTheresMore();
		}
	if (!$fm_cont==''){
			$("#meeru,#renraku,#send").hide();
			$("#black-bg, .contact").show();
		}
});

$("section#intro a#phone-number").hover(function () {$("section#intro #give-me-a-call").show(); $.scrollTo('section#intro #give-me-a-call',500,{offset:-200});});
$("section#intro a#phone-number, .phone-hover").click(function (e) {e.preventDefault(); $("section#intro #give-me-a-call").toggle();});

//direct-link post auto-display & focus
if ($("article").hasClass("direct-link")) {
	$dlParent = $(".direct-link").parent();
	if ($("article").hasClass("archival"))
		{archival=true;} else {archival=false;}
	$('aside').addClass($("article").parent().attr('class')+"-meta").load('/ajaxmeta?pid='+$(".direct-link").attr('data-pid')+"&directLink=true&archival="+archival, function(){displayPost ($dlParent,1);});
		$postHeight = $($dlParent).innerHeight()-500;
		$('#interior').css({"height":$postHeight});
	$vids=$(".direct-link").attr('data-video');
	//videoBG ($vids);
	}

//post aside icons
$('#influences').live("hover",function(){
	orbitBody('aside #influences .icon div:not(.icon div div)','-=7.5deg',80);
	orbitBody('aside #influences .icon div div','+=20deg',80);
});

if ( $.browser.msie & $.browser.version < 9) {$LameBrowser = true; ieHTML5fix();} else {$LameBrowser = false;}
function ieHTML5fix() {(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(',');for(var i=0;i<e.length;i++){document.createElement(e[i])}})();
}
function hideTheresMore() {
if (!$onlyOnce) {
	$('#intro #read-more p').stop().css({"opacity":1}).delay(100).animate({opacity:0},300);
	$('#intro #there-is-more').animate({'letter-spacing':'5'},0,function() {$('#intro #there-is-more').html($keepIntro);});
	for ($n=5;$n>0;$n--){
		$('#intro #read-more #distance'+$n).animate({left:-200},200*$n,'easeInQuad',function(){$('#intro #read-more').delay(1000).queue(function() {$(this).css({width:0});}); $onlyOnce=true; $moreOpen=false;});}
}
						  }
setInterval(function () {$('#clockwork img, .left-hemisphere .minaret div').animate({rotate: '+=7.5deg'}, turnSpeed,'easeInOutElastic');},800);
setInterval(function () { var numRand = Math.floor(Math.random()*800); if (numRand%2) {var sign="+"} else {var sign="-"} $spinCandy = sign+"="+numRand+"deg"; $('#candy img, .right-hemisphere .minaret div').animate({rotate: $spinCandy}, 1800);},4800);

function orbitBody($_body,$degs,$peed) {
	$($_body).animate({rotate: $degs}, $peed,'linear', function() {orbitBody($_body,$degs,$peed);});
}

//$('nav ul#code-mode li ul li a').click (function (q) {q.preventDefault; ajaxLoad ($(this).attr('data-pID'),'.coding-post')});
function deActivate($activate) {
	$('nav ul li h2 a').removeClass('active').addClass('inactive');
	$($activate).addClass('active').removeClass('inactive');
}

function ajaxLoad (pid,$container,ikutsu,permalink,title) {
	//if ($container.innerWidth() > 0) {$direction=0;} else {$direction=1;}
	//displayPost ($container,$direction);
	$('body').css({'cursor':'progress'});
	$('#post-'+pid+'-details summary span').before('<p class="loading-post">loading</p>');
	$($container).load('/ajaxload?ikutsu='+ikutsu+'&pid='+pid,
	function(response, status, xhr){
		displayPost ($container,1);
		$postHeight = $($container).innerHeight()-500;
		$('#interior').animate({"height":$postHeight},$postHeight);
		if ($container.substr(1)=="right-hemisphere") {displayPost (".left-hemisphere",0);}
		else {displayPost (".right-hemisphere",0);}
		if (status == "error") {$('.loading-post').text("still loading").delay(100, function() {window.location = permalink;}); } 
		else {makeMeta ($container,pid); }
		}
	);
	window.history.pushState({page:0},title, permalink);
}

function ajaxLoadCategory (catid,$container,ikutsu,permalink,title) {
	//alert ('/ajaxloadcategory?ikutsu='+ikutsu+'&catid='+catid)
	//if ($container.innerWidth() > 0) {$direction=0;} else {$direction=1;}
	//displayPost ($container,$direction);
	$('body').css({'cursor':'progress'});
	$postHeight = $($container).innerHeight()-500;
	$('#interior').animate({"height":$postHeight},$postHeight);
	$($container).load('/ajaxloadcategory?ikutsu='+ikutsu+'&catid='+catid,
	function(response, status, xhr){
		displayPost ($container,1);
		if ($container.substr(1)=="right-hemisphere") {displayPost (".left-hemisphere",0);}
		else {displayPost (".right-hemisphere",0);}
		if (status == "error") {$('.loading-post').text("still loading").delay(100, function() {window.location = permalink;}); } 
		else {makeMeta ($container,catid); }
		}
	);
	window.history.pushState({page:0},title, permalink);
}

/*function ajaxLoadInfluence (taxonomy,term,$container,ikutsu,permalink,title) {
	$('body').css({'cursor':'progress'});
	$($container).load('/ajaxloadinfluences?ikutsu='+ikutsu+'&taxid='+taxonomy+'&termid='+term,
	function(response, status, xhr){
		displayPost ($container,1);
		if ($container.substr(1)=="right-hemisphere") {displayPost (".left-hemisphere",0);}
		else {displayPost (".right-hemisphere",0);}
		if (status == "error") {$('.loading-post').text("still loading").delay(100, function() {window.location = permalink;}); } 
		else {makeMeta ($container,""); }
		}
	);
	window.history.pushState({page:0},title, permalink);
}*/

function displayPost ($container,$direction) {
	$($container).css({'overflow':'hidden'}).stop().delay(50).animate({width:390*$direction},800,
		function(){
			$.scrollTo($container,800,{offset:-50});
			$('body').css({'cursor':'auto'}); 
			if($direction==1){$($container).css({'overflow':'visible'});}
			});} 

function makeMeta ($container,pid) {
		if (pid == "") {pid=0;}
		$postHeight = $($container).innerHeight()-$("aside section details:first").innerHeight();
		$('aside').removeClass().addClass($container.substr(1)+"-meta");
		$('.loading-post').fadeOut(400,function(){$(this).remove();}); 
		$('aside').load('/ajaxmeta?pid='+pid, function(response, status, xhr){
			$('aside #interior').animate({height:$postHeight},$postHeight);
			document.title = $($container+" header h2").text()+" @ acepek";
			});
}

//reload page on back
//setInterval(function(){if (window.location != permalink){window.location = permalink;}}, 100);

//comment form
$("#commentform input").focus(function(){if($(this).next("input,textarea").is(":hidden")){$(this).next().slideDown(400);}});
$("#commentform textarea").focus(function(){if($("#commentform #submit").is(":hidden")){$("#commentform #submit").fadeIn(400);}});

//search form
$(".form").live('click', function () {$(".form .submit-button").fadeIn(250,'easeOutBounce');});
//contact form

	//contact form
	
	$("#namae").focus(
	function () {
		if ($("#meeru").is(":hidden")) {
			$("#meeru").slideDown(400);
		}
	});
	
	$("#meeru").focus(
	function () {
		if ($("#renraku").is(":hidden")) {
			$("#renraku").slideDown(400);
		}
	});
	
	$("#renraku").focus(
	function () {
		$("#send").fadeIn(400);
	});
		
	$("#himon").focus(
	function () {
		if ($("#send").is(":hidden")) {
			$("#send").fadeIn(400);
		}
	});
	
	$('#contact_form').submit(function() {
						
									   
			if (1 == 1) {
			$("input").attr('disabled', 'true');
			$("textarea").attr('disabled', 'true');
			$('#send').val('sending');
			var namae = $("#namae").val();
			var meeru = $("#meeru").val();
			var renraku = $("#renraku").val();
			var dataString = 'namae='+ namae + '&meeru=' + meeru + '&renraku=' + renraku;
			$.ajax({
				type: "POST",
				url: "/post.php",
				data: dataString,
				success: function() {
					$fm_cont = $('#contact_form').html();
					$('#contact_form').html("<span id='msg'></span>");
					$('#msg').html("<h4>Your message has been sent.</h4>")
					.append("<p>I will contact you soon. Thank you!</p>")
					.hide()
					.fadeIn(2500, function() { 	$("#black-bg").hide(1200,'easeInOutElastic');
												$(".contact").hide(1600,'easeInOutElastic', function() {displayPost(".right-hemisphere",0);});
												$("section#intro #give-me-a-call").hide();
												displayPost (".right-hemisphere",1);
					//$('#message').append("<img id='checkmark' src='images/check.png' />");
					});
				}
			});
			return false;
			}
			else {
			$('#himonchigaimasu').show(200);
			$('#himon').focus();
			return false;}
			}
		);

$("#commentform #submit").live('click', function () {$('#submit').val('submitting');});
	
$.localScroll({lazy:true,hash:true});

$video = [
		  "Lj2qqoZzZ3M", //0 HD EARTH VIEWS FROM SPACE STATION
		  "zWpD-fCC9lc", //1 100 Million Years Later, Galactic Collision Continues
		  "rQ4n2HjppWo", //2 Chandra Presents the Rosette Nebula
		  "WTP1HZqjSaM", //3 M.C. Escher-Adventures in Perception pt.2
		  "6nmVylTpE7w", //4 1 Million Particle Liquid
		  "wdZ-P6V-4Zs", //5 1,000,000 Particle Kelvin-Helmholtz Instability [ad]
		  "wLyFIj8A9Lc", //6 Light & MPM
		  "alL4eqBUk60", //7 Blob High-Resolution [annotations]
		  "AlYoHWHVQk4", //8 he Kuroshio Sea with all large "fishes" inside~~~
		  "YjGHXNhzY0k", //9 Melody Underwater Test Shots
		  "Q43izaD2g0w", //10 Q43izaD2g0w
		  "sdkIwaF2ujs", //11 Time Lapse Sunrise
		  "TC304V9UUUE", //12 Fractal animation 2
		  "NXk4UPYwp8E", //13 Time-Lapse: Tucson Arizona Sunset
		  //"O0pc2Q6tQxw", //14 Timelapse Fisheye - Tree / Sunset / Moonrise
		  "Wtm2Kq3amDw", //15 nikon D7000 super macro 336mm test footage
		  "vx4CREppX8c", //16 Sonja Henie
		  "IEqccPhsqgA", //17 Race Horse First Film Ever 1878 Eadweard Muybridge
		  "V7CPDaE2l-I", //18 Normal Live Blood Cells(4)
		  "z8zu_EvXnuk", //19 Giants (t2i w/ Macro Lens)
		  "iVGh5-PGT5c", //20 Time Lapse Snowy Tree Panning
		  "FtICi4lc27Q", //21 Fun with Bokeh in Renderman
		  "tuto-IdsM5Q", //22 Blurred City Lights - VFX
		  "vh-QHGkeaUQ"  //23 Starlings swarm in, murmurating, then totally fill the sky before roosting!
		  ];
/*if($(body).hasClass('home')){$videoID=21;} else{$videoID=Math.floor(Math.random()*23);}
$('body').tubular($video[$videoID],'div');
$vids=$(".direct-link").attr('data-video');
if  ($vids="") {$vids=$video[Math.floor(Math.random()*22)];}
$('body').tubular($vids,'div');*/
$('body').tubular($video[Math.floor(Math.random()*22)],'div');

$(".pause-vbg").live('click', function(e) {
							   e.preventDefault(); 
							   ytplayer = document.getElementById("myytplayer");
							   $tate  = ytplayer.getPlayerState();
							   
							   if($tate==1 | $tate==3) {ytplayer.pauseVideo(); $(".pause-vbg").html("show video"); $("#yt-container").animate({"opacity":0},1000);}
							   if($tate==-1 | $tate==2 | $tate==5) {ytplayer.playVideo(); $(".pause-vbg").html("hide video").attr('disabled', true); $("#yt-container").animate({"opacity":1},4000, function(){$(".pause-vbg").attr('disabled', false)});}
							   });
$(".new-vbg").click(function(e) {e.preventDefault(); ytplayer = document.getElementById("myytplayer"); ytplayer.loadVideoById($video[Math.floor(Math.random()*22)]);});
function videoBG (vidID) {if (vidID!=""){ytplayer = document.getElementById("myytplayer"); ytplayer.loadVideoById(vidID);} }

/*misc*/

$("#anchor, .pause-vbg").hover(function(){$("#anchor").css({"opacity":1,"background":"#000000"});});

$("#sitemap span").each(function() {$(this).wrapInner('<div class="wrapper" />');});

$(".content ul li a").live('mouseover mouseout', function (event) {
								if ( event.type == "mouseover" ) {$(this).parent().css("background-position","left top");}
								else {$(this).parent().css("background-position","-384px bottom");}
});
						
}); //omega

function shapeWrapper(lineHeight,Xs) {
	var out = '';
	Xvalues = Xs.split('|');
	for(i=0; i < Xvalues.length; i++) {
		parts = Xvalues[i].split(',');
		out += '<div style="float:left;clear:left;height:'+lineHeight+'px;width:'+ parts[1]+'px"></div>';
		out += '<div style="float:right;clear:right;height:'+lineHeight+'px;width:'+ parts[2]+'px"></div>';
	}
	document.write(out);
}

/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert(jQuery.easing.default);
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158; 
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
 
(function ($) {
    // Monkey patch jQuery 1.3.1+ css() method to support CSS 'transform'
    // property uniformly across Webkit/Safari/Chrome, Firefox 3.5+, and IE 9+.
    // 2009-2011 Zachary Johnson www.zachstronaut.com
    // Updated 2011.05.04 (May the fourth be with you!)
    function getTransformProperty(element)
    {
        // Try transform first for forward compatibility
        // In some versions of IE9, it is critical for msTransform to be in
        // this list before MozTranform.
        var properties = ['transform', 'WebkitTransform', 'msTransform', 'MozTransform', 'OTransform'];
        var p;
        while (p = properties.shift())
        {
            if (typeof element.style[p] != 'undefined')
            {
                return p;
            }
        }
        
        // Default to transform also
        return 'transform';
    }
    
    var _propsObj = null;
    
    var proxied = $.fn.css;
    $.fn.css = function (arg, val)
    {
        // Temporary solution for current 1.6.x incompatibility, while
        // preserving 1.3.x compatibility, until I can rewrite using CSS Hooks
        if (_propsObj === null)
        {
            if (typeof $.cssProps != 'undefined')
            {
                _propsObj = $.cssProps;
            }
            else if (typeof $.props != 'undefined')
            {
                _propsObj = $.props;
            }
            else
            {
                _propsObj = {}
            }
        }
        
        // Find the correct browser specific property and setup the mapping using
        // $.props which is used internally by jQuery.attr() when setting CSS
        // properties via either the css(name, value) or css(properties) method.
        // The problem with doing this once outside of css() method is that you
        // need a DOM node to find the right CSS property, and there is some risk
        // that somebody would call the css() method before body has loaded or any
        // DOM-is-ready events have fired.
        if
        (
            typeof _propsObj['transform'] == 'undefined'
            &&
            (
                arg == 'transform'
                ||
                (
                    typeof arg == 'object'
                    && typeof arg['transform'] != 'undefined'
                )
            )
        )
        {
            _propsObj['transform'] = getTransformProperty(this.get(0));
        }
        
        // We force the property mapping here because jQuery.attr() does
        // property mapping with jQuery.props when setting a CSS property,
        // but curCSS() does *not* do property mapping when *getting* a
        // CSS property.  (It probably should since it manually does it
        // for 'float' now anyway... but that'd require more testing.)
        //
        // But, only do the forced mapping if the correct CSS property
        // is not 'transform' and is something else.
        if (_propsObj['transform'] != 'transform')
        {
            // Call in form of css('transform' ...)
            if (arg == 'transform')
            {
                arg = _propsObj['transform'];
                
                // User wants to GET the transform CSS, and in jQuery 1.4.3
                // calls to css() for transforms return a matrix rather than
                // the actual string specified by the user... avoid that
                // behavior and return the string by calling jQuery.style()
                // directly
                if (typeof val == 'undefined' && jQuery.style)
                {
                    return jQuery.style(this.get(0), arg);
                }
            }

            // Call in form of css({'transform': ...})
            else if
            (
                typeof arg == 'object'
                && typeof arg['transform'] != 'undefined'
            )
            {
                arg[_propsObj['transform']] = arg['transform'];
                delete arg['transform'];
            }
        }
        
        return proxied.apply(this, arguments);
    };
})(jQuery);

(function ($) {
    // Monkey patch jQuery 1.3.1+ to add support for setting or animating CSS
    // scale and rotation independently.
    // 2009-2010 Zachary Johnson www.zachstronaut.com
    // Updated 2010.11.06
    var rotateUnits = 'deg';
    
    $.fn.rotate = function (val)
    {
        var style = $(this).css('transform') || 'none';
        
        if (typeof val == 'undefined')
        {
            if (style)
            {
                var m = style.match(/rotate\(([^)]+)\)/);
                if (m && m[1])
                {
                    return m[1];
                }
            }
            
            return 0;
        }
        
        var m = val.toString().match(/^(-?\d+(\.\d+)?)(.+)?$/);
        if (m)
        {
            if (m[3])
            {
                rotateUnits = m[3];
            }
            
            $(this).css(
                'transform',
                style.replace(/none|rotate\([^)]*\)/, '') + 'rotate(' + m[1] + rotateUnits + ')'
            );
        }
        
        return this;
    }
    
    // Note that scale is unitless.
    $.fn.scale = function (val, duration, options)
    {
        var style = $(this).css('transform');
        
        if (typeof val == 'undefined')
        {
            if (style)
            {
                var m = style.match(/scale\(([^)]+)\)/);
                if (m && m[1])
                {
                    return m[1];
                }
            }
            
            return 1;
        }
        
        $(this).css(
            'transform',
            style.replace(/none|scale\([^)]*\)/, '') + 'scale(' + val + ')'
        );
        
        return this;
    }

    // fx.cur() must be monkey patched because otherwise it would always
    // return 0 for current rotate and scale values
    var curProxied = $.fx.prototype.cur;
    $.fx.prototype.cur = function ()
    {
        if (this.prop == 'rotate')
        {
            return parseFloat($(this.elem).rotate());
        }
        else if (this.prop == 'scale')
        {
            return parseFloat($(this.elem).scale());
        }
        
        return curProxied.apply(this, arguments);
    }
    
    $.fx.step.rotate = function (fx)
    {
        $(fx.elem).rotate(fx.now + rotateUnits);
    }
    
    $.fx.step.scale = function (fx)
    {
        $(fx.elem).scale(fx.now);
    }
    
    /*
    
    Starting on line 3905 of jquery-1.3.2.js we have this code:
    
    // We need to compute starting value
    if ( unit != "px" ) {
        self.style[ name ] = (end || 1) + unit;
        start = ((end || 1) / e.cur(true)) * start;
        self.style[ name ] = start + unit;
    }
    
    This creates a problem where we cannot give units to our custom animation
    because if we do then this code will execute and because self.style[name]
    does not exist where name is our custom animation's name then e.cur(true)
    will likely return zero and create a divide by zero bug which will set
    start to NaN.
    
    The following monkey patch for animate() gets around this by storing the
    units used in the rotation definition and then stripping the units off.
    
    */
    
    var animateProxied = $.fn.animate;
    $.fn.animate = function (prop)
    {
        if (typeof prop['rotate'] != 'undefined')
        {
            var m = prop['rotate'].toString().match(/^(([+-]=)?(-?\d+(\.\d+)?))(.+)?$/);
            if (m && m[5])
            {
                rotateUnits = m[5];
            }
            
            prop['rotate'] = m[1];
        }
        
        return animateProxied.apply(this, arguments);
    }
})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/11/2009
 * @author Ariel Flesler
 * @version 1.2.7
 **/
;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);

/* jQuery tubular plugin
|* by Sean McCambridge
|* http://www.seanmccambridge.com/tubular
|* Copyright 2010
|* licensed under the MIT License
|* Do not remove this copyright notice
|* Enjoy.
|* 
|* Thanks,
|* Sean */
// set params
var videoWidth = 853;
var videoRatio = 16/9; // either 4/3 or 16/9
jQuery.fn.tubular = function(videoId,wrapperId) {
	t = setTimeout("resizePlayer()",1000);
	jQuery('html,body').css('height','100%');
	jQuery('body').prepend('<div id="yt-container" style="overflow: hidden; position: fixed; z-index: 1;"><div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div></div><div id="video-cover" style="position: fixed; width: 100%; height: 100%; z-index: 2;"></div>');
	jQuery('#' + wrapperId).css({position: 'relative', 'z-index': 99});
	// initiailize vars
	var ytplayer = 0;
	var pageWidth = 0;
	var pageHeight = 0;
	var videoHeight = videoWidth / videoRatio;
	var duration;
	// swfobject embed yt player
	var params = { allowScriptAccess: "always", wmode: "transparent" };
	var atts = { id: "myytplayer" };
	swfobject.embedSWF("http://www.youtube.com/v/" + videoId + "?enablejsapi=1&playerapiid=ytplayer&loop=1&autoplay=0&controls=0&iv_load_policy=3&autohide=1&showinfo=0&rel=0&color1=000000&color2=000000&modestbranding=1", "ytapiplayer", videoWidth, videoHeight, "8", null, null, params, atts);
	jQuery(window).resize(function() {
		resizePlayer();
	});
	return this;
}
// player calls this function on ready
function onYouTubePlayerReady(playerId) {
	ytplayer = document.getElementById("myytplayer");
	ytplayer.setPlaybackQuality('default');
	ytplayer.mute();
}
function onStateChange(playerId) {
	$("#anchor").css({"opacity":1,"background":"000"});
}
function onError (errorCode) {
	$("#yt-container").css({"display":"none"});
}
function resizePlayer() {
	var newWidth = jQuery(window).width(); // original page width
	var newHeight = jQuery(window).height(); // original page height
	jQuery('#yt-container, #video-cover').width(newWidth).height(newHeight);
	if (newHeight > newWidth / videoRatio) { // if window ratio becomes taller than video
		newWidth = newHeight * videoRatio; // overflow video to sides instead of bottom
	}
	jQuery('#myytplayer').width(newWidth).height(newWidth/videoRatio);
}
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9573980-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
