// JavaScript Document
/*
 * .tabSwitch
 * Version: 1.0
 * http://www.hieu.co.uk/blog/index.php/tabswitch/
 *
 * Copyright (c) 2009 Hieu Pham - http://www.hieu.co.uk
 * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
 * http://www.opensource.org/licenses/cddl1.php
 *
 * Date: 14/04/2009
 */
(function($){$.fn.tabSwitch=function(command,Arguements,EndFunction){var defaults={type:"slide",cols:2,toggle:"fade",ease:40,easeType:"linear",loopback:1,width:400,height:400,index:0,speed:1000,interval:5000,step:1,wrapperClass:"",viewportClass:""};var Args=$.extend(defaults,Arguements);var Obj=this;var jFirstObj=Obj.eq(1);var DOMFirstObj=Obj.eq(1).get(0);if(!$.isFunction(EndFunction)){var Callback=function(){$.data(DOMFirstObj,"index",Args.index)}}else{var Callback=function(){$.data(DOMFirstObj,"index",Args.index);EndFunction()}}StoreToCache=function(){$.data(DOMFirstObj,"type",Args.type);$.data(DOMFirstObj,"toggle",Args.toggle);$.data(DOMFirstObj,"cols",Args.cols);$.data(DOMFirstObj,"ease",Args.ease);$.data(DOMFirstObj,"easeType",Args.easeType);$.data(DOMFirstObj,"index",Args.index);$.data(DOMFirstObj,"loopback",Args.loopback);if(jFirstObj.attr("style")){$.data(DOMFirstObj,"orgAttr",jFirstObj.attr("style"))}else{$.data(DOMFirstObj,"orgAttr","")}};backFromCache=function(){Obj.attr("style",$.data(DOMFirstObj,"orgAttr"));var ViewPortObj=$("#ViewPort"+$.data(DOMFirstObj));ViewPortObj.replaceWith(Obj);stopAuto();$.removeData(DOMFirstObj)};var createTab=function(){StoreToCache();if(Args.width){Obj.width(Args.width)}if(Args.height){Obj.height(Args.height)}var WraperSelector="WideDiv"+$.data(DOMFirstObj);Obj.wrapAll("<div id='"+WraperSelector+"'></div>");var WraperObj=$("#"+WraperSelector);WraperObj.addClass(Args.wraperClass);WraperObj.css({position:"relative"});WraperObj.wrap("<div id='"+WraperSelector.replace("WideDiv","ViewPort")+"'></div>");var ViewPortObj=$("#"+WraperSelector.replace("WideDiv","ViewPort"));ViewPortObj.width(Args.width);ViewPortObj.height(Args.height);ViewPortObj.css({display:"block",overflow:"hidden",position:"relative"});ViewPortObj.addClass(Args.viewportClass);switch(Args.type){case"slide":Obj.css({"float":"left"});WraperObj.width((Args.width+2)*Obj.length);break;case"scroll":WraperObj.width(Args.width);WraperObj.height((Args.height+2)*Obj.length);break;case"toggle":WraperObj.width(Args.width);WraperObj.height(Args.height);Obj.css({position:"absolute",left:"-999px"});Obj.eq(Args.index).css({left:"0px",top:"0px"});Obj.eq(Args.index).css("opacity",1);break;case"table":WraperObj.width(Args.width*Args.cols);Obj.css("float","left")}moveTo()};var moveTo=function(){var ease=0;if(!Args.easeType){Args.easeType=(DOMFirstObj,"easeType")}if(Args.index>Obj.length-1){if($.data(DOMFirstObj,"loopback")!=0){Args.index=0;ease=-$.data(DOMFirstObj,"ease")}else{return}}if(Args.index<0){if($.data(DOMFirstObj,"loopback")!=0){Args.index=Obj.length-1;ease=$.data(DOMFirstObj,"ease")}else{return}}var WraperSelector="WideDiv"+$.data(DOMFirstObj);var WraperObj=$("#"+WraperSelector);switch($.data(DOMFirstObj,"type")){case"slide":if(ease!=0){var easeLevel=(parseInt(WraperObj.css("left").replace("px",""))+ease);WraperObj.animate({left:easeLevel+"px"},Args.speed,function(){WraperObj.animate({left:-(Obj.outerWidth(true)*Args.index)+"px"},Args.speed,Args.easeType,Callback())})}else{WraperObj.animate({left:-(Obj.outerWidth(true)*Args.index)+"px"},Args.speed,Args.easeType,Callback())}break;case"scroll":if(ease!=0){var easeLevel=(parseInt(WraperObj.css("top").replace("px",""))+ease);WraperObj.animate({top:easeLevel+"px"},Args.speed,function(){WraperObj.animate({top:-(Obj.outerHeight(true)*Args.index)+"px"},Args.speed,Args.easeType,Callback())})}else{WraperObj.animate({top:-(Obj.outerHeight(true)*Args.index)+"px"},Args.speed,Args.easeType,Callback())}break;case"toggle":Obj.eq(Args.index).css({left:"0px",top:"0px"});switch($.data(DOMFirstObj,"toggle")){case"fade":Obj.eq(Args.index).css({opacity:0});Obj.eq(Args.index).animate({opacity:1},Args.speed);if($.data(DOMFirstObj,"index")!=Args.index){Obj.eq($.data(DOMFirstObj,"index")).animate({opacity:0},Args.speed,function(){$(this).css("left",-999);Callback()})}break;case"toggle":if($.data(DOMFirstObj,"index")!=Args.index){Obj.eq(Args.index).css({display:"none"});Obj.eq($.data(DOMFirstObj,"index")).slideUp(Args.speed,function(){Obj.eq(Args.index).slideDown(Args.speed,function(){Callback()});$(this).css("left",-999)})}break;case"show":if($.data(DOMFirstObj,"index")!=Args.index){Obj.eq(Args.index).css({display:"none"});Obj.eq($.data(DOMFirstObj,"index")).hide(Args.speed,function(){Obj.eq(Args.index).show(Args.speed,function(){Callback()});$(this).css("left",-999)})}break;case"noeffect":if($.data(DOMFirstObj,"index")!=Args.index){Obj.eq($.data(DOMFirstObj,"index")).css("left",-999);Callback()}break}break;case"table":var cols=$.data(DOMFirstObj,"cols");var nextX=-(Args.index%cols)*Obj.width();var nextY=-Math.floor(Args.index/cols)*Obj.height();WraperObj.animate({left:nextX},Args.speed,Args.easeType,function(){WraperObj.animate({top:nextY},Args.speed,Args.easeType,Callback())});break;default:$("html,body").animate({scrollTop:Obj.eq(Args.index).offset().top},Args.speed);break}};moveStep=function(){var currentIdx=$.data(DOMFirstObj,"index");Args.index=parseInt(currentIdx)+parseInt(Args.step);moveTo()};startAuto=function(){$.data(DOMFirstObj,"AutoSwitch",setInterval(moveStep,Args.interval))};stopAuto=function(){clearInterval($.data(DOMFirstObj,"AutoSwitch"));$.removeData(DOMFirstObj,"AutoSwitch")};toggleAuto=function(){if(isAuto()){stopAuto()}else{startAuto()}};isAuto=function(){if($.data(DOMFirstObj,"AutoSwitch")){return true}else{return false}};if(!command){command=""}switch(command.toLowerCase()){case"index":if($.data(DOMFirstObj,"index")){return $.data(DOMFirstObj,"index")}else{return 0}break;case"moveto":moveTo();break;case"movestep":moveStep();break;case"destroy":backFromCache();break;case"create":createTab();break;case"isauto":return isAuto();break;case"toggleauto":toggleAuto();break;case"startauto":startAuto();break;case"stopauto":stopAuto();break}}})(jQuery);

/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.2, 09.03.2009
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Changelog:
 *    09.03.2009 Version 1.2
 *    - Update for jQuery 1.3.x, removed @ from selectors
 *    11.09.2007 Version 1.1
 *    - removed noConflict
 *    - added png-support for input type=image
 *    - 01.08.2007 CSS background-image support extension added by Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
 *    31.05.2007 initial Version 1.0
 * --------------------------------------------------------------------
 * @example $(function(){$(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready
 *
 * jQuery(function(){jQuery(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready when using noConflict
 *
 * @example $(function(){$('div.examples').pngFix();});
 * @desc Fixes all PNG's within div with class examples
 *
 * @example $(function(){$('div.examples').pngFix( { blankgif:'ext.gif' } );});
 * @desc Fixes all PNG's within div with class examples, provides blank gif for input with png
 * --------------------------------------------------------------------
 */

(function($) {

jQuery.fn.pngFix = function(settings) {

	// Settings
	settings = jQuery.extend({
		blankgif: 'blank.gif'
	}, settings);

	var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
	var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

	if (jQuery.browser.msie && (ie55 || ie6)) {

		//fix images with png-source
		jQuery(this).find("img[src$=.png]").each(function() {

			jQuery(this).attr('width',jQuery(this).width());
			jQuery(this).attr('height',jQuery(this).height());

			var prevStyle = '';
			var strNewHTML = '';
			var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : '';
			var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : '';
			var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : '';
			var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : '';
			var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : '';
			var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : '';
			if (this.style.border) {
				prevStyle += 'border:'+this.style.border+';';
				this.style.border = '';
			}
			if (this.style.padding) {
				prevStyle += 'padding:'+this.style.padding+';';
				this.style.padding = '';
			}
			if (this.style.margin) {
				prevStyle += 'margin:'+this.style.margin+';';
				this.style.margin = '';
			}
			var imgStyle = (this.style.cssText);

			strNewHTML += '<span '+imgId+imgClass+imgTitle+imgAlt;
			strNewHTML += 'style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;
			strNewHTML += 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;';
			strNewHTML += 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + jQuery(this).attr('src') + '\', sizingMethod=\'scale\');';
			strNewHTML += imgStyle+'"></span>';
			if (prevStyle != ''){
				strNewHTML = '<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;'+'">' + strNewHTML + '</span>';
			}

			jQuery(this).hide();
			jQuery(this).after(strNewHTML);

		});

		// fix css background pngs
		jQuery(this).find("*").each(function(){
			var bgIMG = jQuery(this).css('background-image');
			if(bgIMG.indexOf(".png")!=-1){
				var iebg = bgIMG.split('url("')[1].split('")')[0];
				jQuery(this).css('background-image', 'none');
				jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
			}
		});
		
		//fix input with png-source
		jQuery(this).find("input[src$=.png]").each(function() {
			var bgIMG = jQuery(this).attr('src');
			jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');';
   		jQuery(this).attr('src', settings.blankgif)
		});
	
	}
	
	return jQuery;

};

})(jQuery);


/*JCarousellite*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.1g.1w=6(o){o=$.1f({r:n,x:n,N:n,17:q,J:n,L:1a,16:n,y:q,u:12,H:3,B:0,k:1,K:n,I:n},o||{});8 G.R(6(){p b=q,A=o.y?"15":"w",P=o.y?"t":"s";p c=$(G),9=$("9",c),E=$("10",9),W=E.Y(),v=o.H;7(o.u){9.1h(E.D(W-v-1+1).V()).1d(E.D(0,v).V());o.B+=v}p f=$("10",9),l=f.Y(),4=o.B;c.5("1c","H");f.5({U:"T",1b:o.y?"S":"w"});9.5({19:"0",18:"0",Q:"13","1v-1s-1r":"S","z-14":"1"});c.5({U:"T",Q:"13","z-14":"2",w:"1q"});p g=o.y?t(f):s(f);p h=g*l;p j=g*v;f.5({s:f.s(),t:f.t()});9.5(P,h+"C").5(A,-(4*g));c.5(P,j+"C");7(o.r)$(o.r).O(6(){8 m(4-o.k)});7(o.x)$(o.x).O(6(){8 m(4+o.k)});7(o.N)$.R(o.N,6(i,a){$(a).O(6(){8 m(o.u?o.H+i:i)})});7(o.17&&c.11)c.11(6(e,d){8 d>0?m(4-o.k):m(4+o.k)});7(o.J)1p(6(){m(4+o.k)},o.J+o.L);6 M(){8 f.D(4).D(0,v)};6 m(a){7(!b){7(o.K)o.K.Z(G,M());7(o.u){7(a<=o.B-v-1){9.5(A,-((l-(v*2))*g)+"C");4=a==o.B-v-1?l-(v*2)-1:l-(v*2)-o.k}F 7(a>=l-v+1){9.5(A,-((v)*g)+"C");4=a==l-v+1?v+1:v+o.k}F 4=a}F{7(a<0||a>l-v)8;F 4=a}b=12;9.1o(A=="w"?{w:-(4*g)}:{15:-(4*g)},o.L,o.16,6(){7(o.I)o.I.Z(G,M());b=q});7(!o.u){$(o.r+","+o.x).1n("X");$((4-o.k<0&&o.r)||(4+o.k>l-v&&o.x)||[]).1m("X")}}8 q}})};6 5(a,b){8 1l($.5(a[0],b))||0};6 s(a){8 a[0].1k+5(a,\'1j\')+5(a,\'1i\')};6 t(a){8 a[0].1t+5(a,\'1u\')+5(a,\'1e\')}})(1x);',62,96,'||||curr|css|function|if|return|ul|||||||||||scroll|itemLength|go|null||var|false|btnPrev|width|height|circular||left|btnNext|vertical||animCss|start|px|slice|tLi|else|this|visible|afterEnd|auto|beforeStart|speed|vis|btnGo|click|sizeCss|position|each|none|hidden|overflow|clone|tl|disabled|size|call|li|mousewheel|true|relative|index|top|easing|mouseWheel|padding|margin|200|float|visibility|append|marginBottom|extend|fn|prepend|marginRight|marginLeft|offsetWidth|parseInt|addClass|removeClass|animate|setInterval|0px|type|style|offsetHeight|marginTop|list|jCarouselLite|jQuery'.split('|'),0,{}))

// JavaScript Document Funciones

$(function(){
		function play(id,auto)
						{
					   var html  = '';
					   html += '<object width="260" height="200">';
					   html += '<param name="movie" value="http://www.youtube.com/v/"'+id+'"&rel=0&hl=es&fs=1&color1=0x234900&color2=0x4e9e00&showinfo=0"></param>';
					   html += '<param name="allowFullScreen" value="false"></param>';
					   html += '<param name="autoplay" value="'+auto+'"></param>';
					   html += '<param name="wmode" value="transparent"></param>';
					   html += '<embed src="http://www.youtube.com/v/'+id+'&rel=0&autoplay='+auto+'&showinfo=0" type="application/x-shockwave-flash" wmode="transparent" width="260" height="200" ></embed>';
					   html += '</object>';
					   return html;
						};
	$('#view').click(function(){
		$(this).hide();					  
	 	$('#video').html(play('-qq0eNYIvxw',1));
	  });					
	$('.video_slider img').click(function(){
		var id = $(this).attr('name');
		$('#video').html(play(id,1));
	});
    $("#testimonios_slider .video_slider").jCarouselLite({
        btnNext: "#testimonios_slider .next_t",
        btnPrev: "#testimonios_slider .prev_t"
    });
	 $("#notas #notas_slider").jCarouselLite({
        btnNext: "#notas .next_n",
        btnPrev: "#notas .prev_n",
		vertical: true,
		circular: false,
	    visible: 1
    });

		
		$('.SlideTab').tabSwitch('create',{type: 'toggle', toggle: 'fade', width: 760, height: 256});
		$('.tabSelect').click(function(e){
			$('.SlideTab').tabSwitch('moveTo',{index: parseInt($(this).attr("rel"))});
			e.preventDefault();
		});
		$('.Nav').click(function(e){
			$('.SlideTab').tabSwitch('moveStep',{step: parseInt($(this).attr("rel"))});
			e.preventDefault();
		});
		$('.SlideTab').tabSwitch('startAuto',{interval: 6000});
		
		
	});
