// JavaScript Document
var cookies = {
	date: new Date(),
	criar: function(strName, strValue, intDays) {
		if ( intDays ) {
			this.date.setTime(this.date.getTime()+(intDays*24*60*60*1000));
			var expires = "; expires=" + this.date.toGMTString();
		} else {
			var expires = "";
		}
		document.cookie = strName + "=" + strValue + expires + "; path=/";
	},
	ler: function(strName) {
		var strNameIgual = strName + "=";
		var arrCookies = document.cookie.split(";");
		for ( var i = 0, strCookie; strCookie = arrCookies[i]; i++ ) {
			while ( strCookie.charAt(0) == " ") {
				strCookie = strCookie.substring(1,strCookie.length);
			}
			if ( strCookie.indexOf(strNameIgual) == 0 ) {
				return strCookie.substring(strNameIgual.length,strCookie.length);
			}
		}
		return null;
	},
	apagar: function(strName) {
		var $cookie_data = new Date ( );
 		$cookie_data.setTime ( $cookie_data.getTime() - 1 );
	  	document.cookie = strName += "= ; expires=" + $cookie_data.toGMTString()+ ";" + ";";
	},
	busca:function ( cookie_name ){
		var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );
		if ( results ){
			return ( unescape ( results[1] ) );
		}else{
			return null;
		}
	}
}

var URL = location.href;
var PARAMS = URL.substring(URL.indexOf("?")+1);
var PARAM = new Array();
PARAM = PARAMS.split("&");
var par = new Array();
for(var x=0; x < PARAM.length; x++){
	var VALOR = new Array();
	VALOR = PARAM[x].split("=");
	par[VALOR[0]] = VALOR[1];
}

var re = /^\//;
var Path = (document.location.pathname).replace(re,"");
var Paths = new Array;
Paths = Path.split('/');
for(var x=0;x <= 1;x++){
	if(Paths[x]){
		Path = Paths[x];
	}
}