/**
 * 
 */
$.extend({
  getUrlVars: function(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
      hash = hashes[i].split('=');
      vars.push(hash[0]);
      vars[hash[0]] = hash[1];
    }
    return vars;
  },
  getUrlVar: function(name){
    return $.getUrlVars()[name];
  }
});
function cID(el, t){
	$(el).attr('id', t);
}
function cCL(el, t){
	$(el).attr('class', t);
}
function cVI(el, t){
	if(t==''){
		$(el).css('background-image', 'none');
	}else{
		$(el).css('background-image', 'url('+t+')');
	}
}
function validaForm(f){
	var elementos = f.elements;
	for (var i=0; i< elementos.length; i++){
		if ((elementos[i].getAttribute("type")=="text")||(elementos[i].getAttribute("type")=="password")) {
			if (elementos[i].getAttribute("obrigatorio")=="sim") {
				if (elementos[i].value=="") {
					alerta("O campo \""+elementos[i].getAttribute("txt")+"\" &eacute; obrigatorio.", 'Aten&ccedil;&atilde;o!', {tipo:'alerta', color:'#0F59AA'});
					elementos[i].focus();
					return false;
				}
			}
		}
	}
	return true;
}
$(document).ready(function(){
	$('#topo').slideDown('slow');
});
