/* ****************************************** 
 *	Translator combo ui 
 * 		Fortes @ noumeni.us
 * 			http://fortes.extendr.com
 * 			http://netvibes.com/fortes
 * 
 * ******************************************/


/**Requires Cookie plugin (2006 Klaus Hartl (stilbuero.de) */
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}('q.5=x(k,d,a){4(m d!=\'H\'){a=a||{};4(d===p){d=\'\';a=$.A({},a);a.3=-1}2 g=\'\';4(a.3&&(m a.3==\'u\'||a.3.s)){2 f;4(m a.3==\'u\'){f=F C();f.B(f.z()+(a.3*y*o*o*v))}n{f=a.3}g=\'; 3=\'+f.s()}2 b=a.7?\'; 7=\'+(a.7):\'\';2 e=a.9?\'; 9=\'+(a.9):\'\';2 l=a.t?\'; t\':\'\';6.5=[k,\'=\',L(d),g,b,e,l].K(\'\')}n{2 h=p;4(6.5&&6.5!=\'\'){2 c=6.5.E(\';\');D(2 i=0;i<c.8;i++){2 j=q.G(c[i]);4(j.r(0,k.8+1)==(k+\'=\')){h=I(j.r(k.8+1));J}}}w h}};',48,48,'||var|expires|if|cookie|document|path|length|domain|||||||||||||typeof|else|60|null|jQuery|substring|toUTCString|secure|number|1000|return|function|24|getTime|extend|setTime|Date|for|split|new|trim|undefined|decodeURIComponent|break|join|encodeURIComponent'.split('|'),0,{}))

//*****************
// combo - traductor
//******************
	
		
function crearTraductor(contenedor,combo, label, loader, showLabel,defaultText,cookies,idCombo) { 

  $.translate(function(){ 
    $.translate.ui('select', 'option')
	.attr('id',idCombo)
	  .addClass('comboTranslate')
	  .prepend('<option>'+defaultText+'</div>')
	  .val(defaultText)
      .change(function(){ 
	  
	    $('body').translate( 'en',  $(this).val(), { 
          not: '.jq-translate-ui, .countdownContMain', 
          fromOriginal: true,
		  async: false,
          complete: function(){ $(loader).fadeOut('fast')},
          start: function(){ $(loader).fadeIn('slow')},
		  error: function(o){   $(loader).hide(); console.log("Error: "+o.message)   }
        })
			if(true) {  //cookies
				if($(this).val() == 'en')
					$.cookie('destLang', null );  
				else
					 $.cookie('destLang', $(this).val() );  
			}
      })
	  .appendTo(combo)
	  .ready(function(){
		if(cookies)
		{
		  var destLang = $.cookie('destLang');  
		    if( destLang && destLang != 'en')   
				$('#'+idCombo).val(destLang).change();
		}
		});
	 
  });
  
  if(showLabel != 0)
  {
  	$(contenedor).bind("mouseenter",function() {
  	$(label).slideDown(300);
  	}).bind("mouseleave",function(){
  	setTimeout (function() {$(label).slideUp(500);}, 1500 );

    
			$(contenedor).unbind("mouseenter").unbind("mouseleave");
    });
  }
 

}
