jQuery.noConflict();
jQuery(document).ready(
	function(){
		Cufon.replace("h1, h2, h3, h4, h5, h6, .navfont",{fontFamily:"Bebas Neue",hover:false,textShadow:"#fff 1px 1px"});
		Cufon.replace(".dividerbig, .dividersmall",{fontFamily:"Bebas Neue",hover:false,textShadow:"#fff 1px 1px"});
		Cufon.replace(".footertitle_white, .footertitle_blue",{fontFamily:"Bebas Neue",hover:false,textShadow:"#000 1px 1px"});
		jQuery("img.captionmeblue").each(
			function(){
				var _1=jQuery(this).attr("title");
				jQuery(this).wrap("<div class='imgpost'></div>");
				jQuery(this).parent().append("<div class='thecaptionblue'>"+_1+"</div>");
			}
		);
		jQuery("img.captionmegrey").each(
			function(){
				var _2=jQuery(this).attr("title");
				jQuery(this).wrap("<div class='imgpost'></div>");
				jQuery(this).parent().append("<div class='thecaptiongrey'>"+_2+"</div>");
			}
		);
		jQuery("img.captionmered").each(
			function(){
				var _3=jQuery(this).attr("title");
				jQuery(this).wrap("<div class='imgpost'></div>");
				jQuery(this).parent().append("<div class='thecaptionred'>"+_3+"</div>");
			}
		);
		jQuery("a[rel^='fadeimg'] img").hover(
			function(){
				jQuery(this).stop().fadeTo("fast",0.5);
			},
			function(){
				jQuery(this).stop().fadeTo("fast",1);
			}
		);
		addPrettyPhoto();
		addFacebook();
		addTwitter();
		addYoutubeVideo();
		addSidebarSlider();
		if(jQuery(".smoothTabs").length!=0)
		{
			jQuery(".smoothTabs").smoothTabs(200);
		}
		addPortfolio("4");
		addPortfolio("3");
		addPortfolio("2");
		addPortfolio("1");
		jQuery("#contactform").validate();
	}
);
jQuery(window).load(
	function(){
		if(jQuery("#slider").length!=0){
			jQuery("#slider").nivoSlider({
				effect:"random",
				slices:10,
				boxCols:5,
				boxRows:4,
				animSpeed:500,
				pauseTime:5000,
				startSlide:0,
				directionNav:false,
				directionNavHide:false,
				controlNav:true,
				controlNavThumbs:true,
				controlNavThumbsFromRel:false,
				controlNavThumbsSearch:".jpg",
				controlNavThumbsReplace:"_thumb.jpg",
				keyboardNav:true,
				pauseOnHover:true,
				manualAdvance:false,
				captionOpacity:0.9,
				prevText:"Prev",
				nextText:"Next",
				beforeChange:function(){},
				afterChange:function(){},
				slideshowEnd:function(){},
				lastSlide:function(){},
				afterLoad:function(){},
				customChange:function(){Cufon.replace(".slidercaption",{fontFamily:"Bebas Neue",hover:true});}
			});
		}
		addPiecemaker();
		loadGoogleMaps();
	}
);
function addPrettyPhoto(){
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
		theme:"facebook",
		overlay_gallery:true,
		show_title:false,
		hideflash:true
	});
	jQuery("a[rel^='prettyPhoto'] img").hover(
		function(){
			jQuery(this).stop().fadeTo("fast",0.5);
		},
		function(){
			jQuery(this).stop().fadeTo("fast",1);
		}
	);
};
function addFacebook(){
	if(jQuery("#facebooklike").length!=0){
		window.fbAsyncInit=function(){
			jQuery("#facebooklike").append("<fb:like href=\"http://www.facebook.com/pages/Comercializadora-Acura-SA-de-CV/254683471215488\" layout=\"button_count\" show_faces=\"false\" width=\"90\"></fb:like>");
			jQuery("#facebooklike").delay(500).fadeIn(1000);
		};
		var _4=document.createElement("script");
		_4.type="text/javascript";
		_4.src="http://connect.facebook.net/en_US/all.js#xfbml=1";
		document.getElementsByTagName("head")[0].appendChild(_4);
	}
};
function addTwitter(){
	if(jQuery("#twittertweet").length!=0){
		jQuery("#twittertweet").append("<a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://www.twitter.com/@akura_inf\" data-text=\"Like\" data-count=\"horizontal\" data-lang=\"es\">Tweet</a>");
		jQuery("#twittertweet").delay(500).fadeIn(1000);
		var _5=document.createElement("script");
		_5.type="text/javascript";
		_5.src="http://platform.twitter.com/widgets.js";
		document.getElementsByTagName("head")[0].appendChild(_5);
	}
};
function addYoutubeVideo(){
	if(jQuery("#youtubevideo").length!=0){
		jQuery("#youtubevideo").append("<object type=\"application/x-shockwave-flash\" style=\"width:670px; height:404px;\" data=\"http://www.youtube.com/v/oRLTU5E2JVU?hl=en&amp;fs=1&amp;hd=1\">"+"<param name=\"movie\" value=\"http://www.youtube.com/v/oRLTU5E2JVU?hl=en&amp;fs=1&amp;hd=1\" />"+"<param name=\"allowFullScreen\" value=\"true\" />"+"</object>");
	}
};
function addPiecemaker(){
	if(jQuery("#piecemaker").length!=0){
		jQuery("head").append("<script>swfobject.embedSWF(\"images/piecemaker2/piecemaker.swf\" , \"piecemaker\", \"920\", \"445\", \"10\", null, flashvars, params, null)</script>");
	}
};
function addSidebarSlider(){
	if(jQuery("#sidebarslider").length!=0){
		jQuery("#sidebarslider").tinycarousel({controls:false,pager:true,interval:true,intervaltime:3000});
	}
};
function initGoogleMaps(){
	var _6=new google.maps.LatLng(19.438509,-99.191823);
	var _7={zoom:12,center:_6,popup:true,mapTypeId:google.maps.MapTypeId.ROADMAP};
	var _8=new google.maps.Map(document.getElementById("googlemap"),_7);
};
function loadGoogleMaps(){
	if(jQuery("#googlemap").length!=0){
		var _9=document.createElement("script");
		_9.type="text/javascript";
		_9.src="http://maps.google.com/maps/api/js?sensor=false&callback=initGoogleMaps";
		document.body.appendChild(_9);
	}
};
function addPortfolio(_a){
	var _b=jQuery("#portfoliolist"+_a+"column");
	if(jQuery(_b).length!=0){
		var _c=_b.clone();
		jQuery(".portfoliofilter li").click(function(e){
			jQuery(".portfoliofilter li a").addClass("portfoliobutton_noselect");
			jQuery(".portfoliofilter li a").removeClass("portfoliobutton");
			jQuery(this).children("a").removeClass("portfoliobutton_noselect");
			jQuery(this).children("a").addClass("portfoliobutton");
			var _d=jQuery(this).attr("class");
			if(_d=="all"){
				var _e=_c.find(".portfolioentry"+_a+"column");
			}else{
				var _e=_c.find(".portfolioentry"+_a+"column[data-type="+_d+"]");
			}
			jQuery(_b).quicksand(_e,{
				duration:500,
				easing:"easeInOutQuad",
				adjustHeight:"dynamic",
				enhancement:function(){
					if(typeof Cufon!=="undefined"){
						Cufon.refresh();
					}
				}
			},
			function(){addPrettyPhoto();}
			);
			return false;
		});
	}
};
(function($){
	$.fn.smoothTabs=function(_1b){
		var _1c=0;
		var _1d="smoothTabsLiCurrent";
		var _1e="smoothTabsDivHidden";
		var _1f="smoothTabsDivVisible";
		var _20=document.location.hash.substr(1,document.location.hash.length);
		if(_20&&$("#"+_20,this).size()){
			_1c=$("#"+_20,this).index();
		}
		this.each(function(){
			$("ul li:eq("+_1c+")",this).addClass(_1d);
			$(this).children("div").addClass(_1e);
			$("div:eq("+_1c+")",this).fadeIn(_1b).addClass(_1f).removeClass(_1e);});
			$("ul li",this).click(function(){
				var _21=$(this).parent();
				var _22=$(_21).parent();
				$("li",_21).removeClass(_1d);
				$(this).addClass(_1d);
				var _23=$("li",_21).index(this);
				var _24=$("div",_22).get(_23);
				if($(_24).attr("class")==_1f){
					return false;
				}
				$("."+_1f,_22).fadeOut(_1b,function(){$(_24).fadeIn(_1b).addClass(_1f).removeClass(_1e);
			});
			$("."+_1f,_22).removeClass(_1f).addClass(_1e);
		});
	};
})
(jQuery);
				
				
				
				
				
				
				
				
