// JavaScript Document

function arg_cont(arg_id){
	var addr_value = arg_id;
	var addr_final = addr_value.split("/");
	var er_addr = /\x3F\b/;
	if (arg_id == "/") {
		$('#content').animate({opacity: 0.0, left: '-=100px'},'fast','easeInExpo', function(){
		$('#carregando').css('display', 'block');
		$('#content').animate({left: '+=200px'},0);
		$('#content').load('http://www.argcast.com/wordpress/wp-content/themes/2010/arg_home.php?header=0', function(){
			$('#carregando').css('display', 'none');
			$('#content').animate({opacity: 1.0, left: '-=100px'},'fast','easeOutExpo');
		})});
	} else {
		if (er_addr.test(arg_id)) {
			$('#content').load('http://www.argcast.com' + arg_id + '&header=0', function(){
				$('#carregando').css('display', 'none');
			});
		} else {
			$('#content').animate({opacity: 0.0, left: '-=100px'},'fast','easeInExpo', function(){
			$('#carregando').css('display', 'block');
			$('#content').animate({left: '+=200px'},0);
			$('#content').load('http://www.argcast.com' + arg_id + '?header=0', function(){
				$('#carregando').css('display', 'none');
				$('#content').animate({opacity: 1.0, left: '-=100px'},'easeOutExpo','');
			})});
		}
	}
}

function arg_podcast(id) {
	$('#pc_desc').load('http://www.argcast.com/wordpress/wp-content/themes/2010/arg_pcdesc.php?id=' + id);
	$('#pc_lateral').load('http://www.argcast.com/wordpress/wp-content/themes/2010/arg_pclateral.php?id=' + id);
}

function arg_pctip(id) {
	$('#pc_tip').load('http://www.argcast.com/wordpress/wp-content/themes/2010/arg_pctip.php?id=' + id);
}

function arg_buscar(arg_s) {
	var s = arg_s.replace(/[^\w|\s]/gi,'');
	$.address.value('/?s='+s.replace(/\s/g,'+'));
}

/*function arg_carregando() {
	var altura = $(window).height() + 'px';
	$('#carregando').height(altura);
}*/

function populateElement(selector, defvalue) {
   $(selector).each(function() {
       if($.trim(this.value) == "") {
           this.value = defvalue;
       }
   });
 
   $(selector).focus(function() {
       if(this.value == defvalue) {
           this.value = "";
       }
   });
   
   $(selector).blur(function() {
       if($.trim(this.value) == "") {
           this.value = defvalue;
       }
   });
}

$(document).ready(function() {
	populateElement('#s', 'Busque aqui...');
});

/*function arg_divulgar() {
		$("div#divulgar").slideToggle("fast");
}*/