if (typeof SAN == "undefined") {
    var SAN = {};
}
SAN.namespace = function() {
	var object = null, arrObjects = [];
    for (var i=0; i<arguments.length; i++) {
		object = SAN;
		
        for (var objI = arguments[i].split("."), j=(objI[0]=="SAN")? 1 : 0; j<objI.length; j++) {
            object[ objI[j] ] 	= object[ objI[j] ] || {};
            object 				= object[ objI[j] ];
        }
		arrObjects.push(object);
    }
    return (arrObjects.length>1)? arrObjects : object;
};
/*Captura de elementos*/
SAN.$ = function(){
	return function(){
		var elements = [];
				
		for(var i=0; i<arguments.length; i++){
			var obj = null;
			
			if(typeof arguments[i] === "string")		var obj = document.getElementById(arguments[i]) || null;
			else if(typeof arguments[i] === "object")	var obj = arguments[i];
			if(obj==null && arguments[i]== "html")		var obj = document.getElementsByTagName("html")[0];
			if(obj==null && arguments[i]== "body")		var obj = document.body;
			if(obj==null && arguments[i]== "window")	var obj = window;
			
			if(obj!=null)elements.push(obj);
		}
		
		if(elements.length==1)return elements[0];
		if(elements.length>1) return elements;
			
		return null;
	}
}();
/*Cria elementos*/
SAN.create = function(){
	return function(element, props){
		var el = document.createElement(element);
		if(!el) return null;
		
		for(var attr in props){
			if(attr=="innerHTML")
				el.innerHTML = props[attr];
			else
				el[attr] = props[attr];
		}
		
		return el;
	}
}();


SAN.addDOMLoadEvent = (function(){
								
   var _callbacks = [];
   var _intervalVerify;
   var _isLoaded;
   
   var _doLoad = function () {
	   clearInterval(_intervalVerify);
	   
        _isLoaded = true;   
		var callback;
        while (callback = _callbacks.shift())
            callback();

        if(document.onreadystatechange) document.onreadystatechange = null;
    };

    return function (func) {
        if (_isLoaded) return func();        
        if (!_callbacks[0]) {
            //Mozilla/Opera9
            if(document.addEventListener)
               document.addEventListener("DOMContentLoaded", _doLoad, false);

			//Internet Explorer
            document.onreadystatechange = function(){
             	if(this.readyState == "complete")_doLoad();
            }

            //Safari
            if (/WebKit/i.test(navigator.userAgent)) { // sniff
                _intervalVerify = setInterval(function() {
                    if (/loaded|complete/.test(document.readyState))_doLoad();
                }, 10);
            }

            //Outros
            var oldOnload = window.onload;
            window.onload = function() {
                _doLoad();
                if(oldOnload)oldOnload();
            };
        }
        _callbacks.push(func);
    }
})();

/**Versão**/
SAN.namespace("Browser");
SAN.Browser.version = function(){
	var o={
	    ie:0,
	    opera:0,
        gecko:0,
        webkit:0
    };
    var ua=navigator.userAgent, m;

    if ((/KHTML/).test(ua)) {
        o.webkit=1;
    }

    m=ua.match(/AppleWebKit\/([^\s]*)/);
    if (m&&m[1]) {
        o.webkit=parseFloat(m[1]);
    }

    if (!o.webkit) {
        m=ua.match(/Opera[\s\/]([^\s]*)/);
        if (m&&m[1]) {
            o.opera=parseFloat(m[1]);
        } else {
            m=ua.match(/MSIE\s([^;]*)/);
            if (m&&m[1]) {
                o.ie=parseFloat(m[1]);
            } else {
                m=ua.match(/Gecko\/([^\s]*)/);
                if (m) {
                    o.gecko=1;
                    m=ua.match(/rv:([^\s\)]*)/);
                    if (m&&m[1]) {
                        o.gecko=parseFloat(m[1]);
                    }
                }
            }
        }
    }
    return o;
}();

SAN.namespace("SAN.util");
SAN.util.css = function(){
	var _isIe 		= SAN.Browser.version.ie;
	var _isOpera 	= SAN.Browser.version.opera;
	
	var _getStyle	= function(element, style) {
		element = (typeof element === "object")? element: SAN.$(element);
		var value = undefined;
		
		style = (style == 'float' || style == 'cssFloat') ? (_isIe? 'styleFloat' : 'cssFloat') : SAN.util.html.camelize(style);
		if (!value && !_isIe) {
			var css = document.defaultView.getComputedStyle(element, null);
			value = css ? css[style] : null;
		}		
		
		if (!value && element.currentStyle && _isIe) value = element.currentStyle[style];
		
		if (style == 'opacity' && _isIe) {
			if(value = (SAN.util.css.getStyle(element, 'filter') || '').match(/alpha\(opacity=(.*)\)/))
				if (value[1])return parseFloat(value[1]) / 100;
		 
			return 1.0;
		}else if(style == 'opacity'){
			return value ? parseFloat(value) : 1.0;
		}
		
		if (value == 'auto' && _isIe) {
		  if ((style == 'width' || style == 'height') && (SAN.util.css.getStyle('display') != 'none'))
			return element['offset'+SAN.util.html.capitalize(style)] + 'px';
		  
		  return null;
		}
		
		return value == 'auto' ? null : value;		  
	}
	
	var _setStyle = function(element, styles, camelized) {
		element = (typeof element === "object")? element: SAN.$(element);
		
		var elementStyle = element.style, match;
		if (typeof styles === "string") {
			element.style.cssText += ';' + styles;
			return styles.indexOf('opacity') > -1 ? _setOpacity(element, styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
		}
	
		for (var property in styles)
			if (property == 'opacity')
				element.setOpacity(styles[property])
			else
				elementStyle[(property == 'float' || property == 'cssFloat') ?
					(elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') : (camelized ? property : SAN.util.html.camelize(property))] = styles[property];
	
		return element;
	}
	
	var _setOpacity = function(element, value) {
		
		
		element = (typeof element === "object")? element: SAN.$(element);	
		
		if(!_isIe){
			element.style.opacity = (value == 1 || value === '') ? '' :  (value < 0.00001) ? 0 : value;	
		}else {
			
			var filter = _getStyle(element, 'filter') || "", style = element.style;
			if (value == 1 || value === '') {
				style.filter = filter.replace(/alpha\([^)]*\)/,'');
				return element;
			}else if(value < 0.00001){
				value = 0;
			}
			style.filter = filter.replace(/alpha\([^)]*\)/, ''); + 'alpha(opacity=' + (value * 100) + ')';
		}
		
		return element;
	}
	
	var _getDimensions = function(element) {
		element = (typeof element === "object")? element: SAN.$(element);
				
		var display = SAN.util.css.getStyle(element, 'display');
		
		// bug Safari
		if (display != 'none' && display != null)return{width: element.offsetWidth, height: element.offsetHeight};
		
		var els = element.style;
		
		var originalVisibility = els.visibility;
		var originalPosition = els.position;
		var originalDisplay = els.display;
		
		els.visibility = 'hidden';
		els.position = 'absolute';
		els.display = 'block';
		
		var originalWidth = element.clientWidth;
		var originalHeight = element.clientHeight;
		
		els.display = originalDisplay;
		els.position = originalPosition;
		els.visibility = originalVisibility;
		
		return {width: originalWidth, height: originalHeight};
	}
	
	var _getPosition = function(element){
		var x = 0, y = 0;
		if (!document.layers) {
			
			var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
			var mac = document.all && !onWindows && getExplorerVersion() == 4.5;
			var par = element;
			var lastOffsetTop = 0;
			var lastOffsetLeft = 0;
			
			while(par){
				if(par.leftMargin && !onWindows) x += parseInt(par.leftMargin);
				if(par.topMargin && !onWindows ) y += parseInt(par.topMargin);
				
				if((par.offsetLeft != lastOffsetLeft) && par.offsetLeft) 	x += parseInt(par.offsetLeft);
				if((par.offsetTop != lastOffsetTop) && par.offsetTop) 		y += parseInt(par.offsetTop);
				
				if(par.offsetLeft != 0) lastOffsetLeft 	= par.offsetLeft;
				if(par.offsetTop != 0 ) lastOffsetTop 	= par.offsetTop;
				
				par = mac ? par.parentElement : par.offsetParent;
			}
			
		} else if(element.x && element.y){
			x += element.x;
			y += element.y;
		}
		
		return {x: x, y: y};
	}
	
	var _addClass = function(element, _class){
		if(typeof element === "string") element = SAN.$(element);
		
		if (!element.className) element.className = ''; 
		var className = element.className;		
		if (!className.match(RegExp("\\b"+_class+"\\b"))) className = className.replace(/(\S$)/,'$1 ')+_class;		
		element.className = className;
	}
	var _removeClass = function(element, _class){
		if(typeof element === "string") element = SAN.$(element);
		
		if (!element.className) element.className = ''; 
		var className = element.className; 
		className = className.replace(RegExp("(\\s*\\b"+_class+"\\b(\\s*))*","g"),'$2');
		element.className = className;
	}
	
	var _checkClass = function(element, _class){
		if(typeof element === "string") element = SAN.$(element);
		
		if (!element.className) element.className = ''; 
		var className = element.className; 
		
		return className.match(RegExp("\\b"+_class+"\\b"));
	}
	
	var _log = function(message){
	}
			
	return {
		getStyle:function(element, style){
			if(!SAN.util.html)_log("Erro: O uso desse metodo (SAN.util.css.getStyle) exige o pacote SAN.util.html ja carregado");
			
			if(_isOpera){
				switch(style) {
				  case 'left':
				  case 'top':
				  case 'right':
				  case 'bottom':
					if (_getStyle(element, 'position') == 'static') return null;
				  default: return _getStyle(element, style);
				}
			}else{
				return _getStyle(element, style);
			}			
		},
		setStyle:function(element, styles, camelized){
			if(!SAN.util.html)_log("Erro: O uso desse metodo (SAN.util.css.setStyle) exige o pacote SAN.util.html ja carregado");			
			return 	_setStyle(element, styles, camelized);
		},
		getHeight: function(element) {
			return _getDimensions(element).height;
		},		
		getWidth: function(element) {
			return _getDimensions(element).width;
		},
		getPosition:function(element){
			return _getPosition(element);
		},
		addClass:function(element, _class){
			return _addClass(element, _class);
		},
		removeClass:function(element, _class){
			return _removeClass(element, _class);
		},
		checkClass:function(element, _class){
			return _checkClass(element, _class);
		}
	}
}();



SAN.namespace("SAN.util");
SAN.util.html = function(){
	return {
		stripTags:function(htmlText){
			return htmlText.replace(/<\/?[^>]+>/gi, '');
		},
		escape:function(htmlText){
			var div = document.createElement('div');
			var text = document.createTextNode(htmlText);
			div.appendChild(text);
			
			return div.innerHTML;	
		},
		unescape:function(htmlText){
			var div = document.createElement('div');
			div.innerHTML = stripTags(htmlText);
			
			return div.childNodes[0].nodeValue;
		},
		camelize:function(htmlText) {
			var parts = htmlText.split('-'), len = parts.length;
			if (len == 1) return parts[0];
			
			var camelized = htmlText.charAt(0) == '-' ? 
				parts[0].charAt(0).toUpperCase() + parts[0].substring(1) : parts[0];
			
			for (var i = 1; i < len; i++)
				camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
			
			return camelized;
		},		
		capitalize:function(htmlText) {
			return htmlText.charAt(0).toUpperCase() + htmlText.substring(1).toLowerCase();
		}
	}
}();

SAN.namespace("SAN.util");
SAN.util.httpRequest = function(){
	var _events = ["onStart", "onOpen", "onSend", "onLoad", "onComplete"];
	var _filter = encodeURIComponent;
	var	_objectsHTTP = [
						function(){return new XMLHttpRequest();},
						function(){return new ActiveXObject("MSXML2.XMLHTTP.3.0");},
						function(){return new ActiveXObject("Msxml2.XMLHTTP");},
						function(){return new ActiveXObject("Microsoft.XMLHTTP");}
						];
	var _isSupported = function(){
		return !!_getConnection();
	};

var _getConnection = function(){
		for(var i=0; i<_objectsHTTP.length; i++){
			try{
				return _objectsHTTP[i]();
			}catch(e){};
		}
		return null;
	};

	var _formatParams = function(params){
		var i, r = [];
		for(i in params){
			r[r.length] = i + "=" + (_filter ? _filter(params[i]) : params[i]);
		}
		return r.join("&");
	};

	var _request = function(method, url, params, handler, headers, waitResponse){
		if(!SAN.util.delegate && handler)_log("Erro: O uso desse m?todo (get || post) exige o pacote SAN.util.delegate j? carregado");
		var i, o = _getConnection(), f = typeof handler === "function", a = typeof handler === "object" && handler.arguments;
		try{
			if(typeof handler === "object" && handler.arguments)handler.arguments.result = o;

			o.open(method, url, !waitResponse);

			waitResponse || (o.onreadystatechange = function(){
				var s = _events[o.readyState];
				var func = f ? handler : (handler[s] ? handler[s]: null);
				if(func){
					if(typeof handler === "object" && typeof handler.scope==="object")var func = SAN.util.delegate.create(handler.scope, func);			
					func((typeof handler === "object" && handler.arguments)? handler.arguments : o)
				}				
			});
			
			o.setRequestHeader("HTTP_USER_AGENT", "XMLHttpRequest");
			
			for(i in headers)o.setRequestHeader(i, headers[i]);
			o.send(params);
			
			var func = f ? handler : ((handler["onComplete"])? handler["onComplete"]: null);			
			if(waitResponse && func){
				if(typeof handler === "object" && typeof handler.scope === "object")var func = SAN.util.delegate.create(handler.scope, "onComplete");
				func((typeof handler === "object" && handler.arguments)? handler.arguments : o)
			}			
			
			return o;
		}
		catch(e){
			return false;
		}
	};
	
	var _log = function(message){
		alert(" >> "+message);
	}
	
	return {

		get:function(url, params, handler, waitResponse){
			return _request("GET", url + (url.indexOf("?") + 1 ? "&" : "?") + _formatParams(params), null, handler, {
				"Content-Type": "text/html; charset:UTF-8",
				"Content-length": 0,
				"Connection": "close"			
			}, waitResponse);
		},

		post:function(url, params, handler, waitResponse){
			return _request("POST", url, params = _formatParams(params), handler, {
				"Connection": "close",
				"Content-Length": params.length,
				"Method": "POST " + url + " HTTP/1.1",
				"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"
			}, waitResponse);
		}
	}	
}();

// JavaScript Document
SAN.namespace("SAN.util");
SAN.namespace("SAN.common");
SAN.util.pox = function(){

	var _animate	 = {shadow:false, window:true, content:true}
	
	var _elOculta	 = "box-pox-oculta";
	var _elOverlay	 = "box-pox-sombra";
	var _elLoad	 	 = "box-pox-load";
	var _elWindow	 = "box-pox";
	var _elCtClose	 = "box-pox-fechar";
	var _elClose	 = "link-fechar-pox";
	var _elTitle	 = "titulo-pox";
	var _elContent	 = "conteudo-pox";
	var _elCaption	 = "legenda-pox";
	var _elCtCredito = "credito-pox";
	var _elImage	 = "imagem-pox";
	var _zindex		 = 99999;
	
	
	var _position = function() {
		
		var Css	 	= SAN.util.css;
		
		var TB_PDLEFT	= Number(Css.getStyle(SAN.$(_elWindow), "paddingLeft").replace("px", ""));
		var TB_PDRIGHT	= Number(Css.getStyle(SAN.$(_elWindow), "paddingRight").replace("px", ""));
		var TB_WIDTH 	= Css.getWidth(SAN.$(_elImage)? SAN.$(_elImage): SAN.$(_elWindow)) + TB_PDLEFT + TB_PDRIGHT;
		var TB_HEIGHT 	= Css.getHeight(SAN.$(_elWindow));	
				
		var fl = parseInt(Css.getStyle(SAN.$(_elWindow), "padding-left").replace("px" ,""), 10) || 0;
		var fr = parseInt(Css.getStyle(SAN.$(_elWindow), "padding-right").replace("px" ,""), 10) || 0;
		var ft = parseInt(Css.getStyle(SAN.$(_elWindow), "padding-top").replace("px" ,""), 10) || 0;
		var fb = parseInt(Css.getStyle(SAN.$(_elWindow), "padding-bottom").replace("px" ,""), 10) || 0;
		
		var l = parseInt(((_page().w - TB_WIDTH) / 2),10);
		var t = parseInt(_scroll().yScroll + ((_page().h - TB_HEIGHT) / 2),10);
		var w = TB_WIDTH  - (fl+fr);
		var h = TB_HEIGHT - (ft+fb);

		
		if(_animate.window && SAN.common.animation){
			var Tween 	= SAN.common.animation.Tween;
			
			SAN.$(_elWindow).style.overflow = "hidden";
			//SAN.$(_elWindow).style.position = "fixed";
			
			
			SAN.util.css.setStyle((SAN.$(_elImage)? SAN.$(_elImage): SAN.$(_elContent)), "visibility: hidden");
			if(SAN.$(_elCaption))SAN.util.css.setStyle(SAN.$(_elCaption), "visibility: hidden");
			
			var anim = new Tween([0, 0, _page().w/2, _scroll().yScroll + _page().h/2], [w, h, l, t], 500, {element: SAN.$(_elWindow)});
			//var anim = new Tween([0, 0, _page().w/2, _scroll().yScroll + _page().h/2], [w, h, '50%', '50%'], 500, {element: SAN.$(_elWindow)});
			//anim.onAnimation 	= _adjustSize;
			anim.onEndAnimation =_endAdjustSize;
			anim.init();	
		}else{
			SAN.$(_elWindow).style.width = w + 'px';
			SAN.$(_elWindow).style.height  = h + 'px';
			SAN.$(_elWindow).style.left = l + 'px';
			SAN.$(_elWindow).style.top  = t + 'px';		
			
			//SAN.$(_elWindow).style.left = parseInt(((_page().w - TB_WIDTH) / 2),10) + 'px';
			//SAN.$(_elWindow).style.top  = parseInt(_scroll().yScroll + ((_page().h - TB_HEIGHT) / 2),10) + 'px';
		}
		
			//SAN.$(_elWindow).style.margin = '-12.5% 0px 0px -12.5%';			
			//SAN.$(_elWindow).style.left = '50%';
			//SAN.$(_elWindow).style.top  = '50%';	
		
	}
	var _t = "";
	var _adjustSize = function(values, args){	
		if(!args.element)return;
		
		args.element.style.width 	= Math.round(values[0])+"px";
		args.element.style.height 	= Math.round(values[1])+"px";		
		args.element.style.left 	= Math.round(values[2])+'px';
		args.element.style.top  	= Math.round(values[3])+'px';	
		
		_t += args.element.id+" -> "+Math.round(values[0])+"px"+" - "+Math.round(values[1])+"px";
	}
	var _endAdjustSize = function(values, args){		
		_adjustSize(values, args);
		
		if(_animate.content && SAN.common.animation){
			var anim = new SAN.common.animation.Tween(0, 100, 500, {element: (SAN.$(_elImage)? SAN.$(_elImage): SAN.$(_elContent))});
			anim.onAnimation 	= anim.onEndAnimation = _adjustAlpha;
			anim.init();
			
			if(SAN.$(_elCaption)){
				var anim2 = new SAN.common.animation.Tween(0, 100, 500, {element: SAN.$(_elCaption)});
				anim2.onAnimation 	= anim2.onEndAnimation = _adjustAlpha;
				anim2.init();
			}
		}else{
			SAN.$(_elWindow).style.overflow = "";
			SAN.util.css.setStyle(SAN.$(_elContent), "visibility: visible");
			if(SAN.$(_elCaption))SAN.util.css.setStyle(SAN.$(_elCaption), "visibility: visible");
		}
		
		
	}

	var _adjustAlpha = function(values, args){	
		if(!args.element)return;
		SAN.util.css.setStyle(args.element, "opacity: "+(Math.round(values)/100));
		args.element.style.visibility = "";
	}
	
	var _page = function() {
		var _body = SAN.$("body");
		var _html = SAN.$("html");
		
		var de = document.documentElement;
		var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || _body.clientWidth;
		var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || _body.clientHeight;

		return {w: w,h: h};
	}
	
	var _scroll = function(){
		var yScroll;
		if (self.pageYOffset) yScroll = self.pageYOffset;
		else if (document.documentElement && document.documentElement.scrollTop) yScroll = document.documentElement.scrollTop;
		else if (document.body) yScroll = document.body.scrollTop;

		return {yScroll:yScroll};
	}
	
	var _hide = function() {
		var _body = SAN.$("body");
		var _html = SAN.$("html");
		
		SAN.$(_elOverlay).onclick = "";
		SAN.$(_elWindow).onclick = "";
		SAN.$(_elClose).onclick = "";
		
		SAN.$(_elWindow) 		&& 	_body.removeChild(SAN.$(_elWindow));
		SAN.$(_elLoad)	 	&& 	_body.removeChild(SAN.$(_elLoad));
		//SAN.$(_elOculta) 	&& 	_body.removeChild(SAN.$(_elOculta));
		SAN.$(_elOverlay) 	&& 	_body.removeChild(SAN.$(_elOverlay));
		
		if (typeof _body.style.maxHeight == "undefined") {
			_body.style.height = _body.style.width = "auto";
			_html.style.height = _html.style.width = "auto";
			_html.style.overflow = "";
		}
		return false;
	}
	
	var _onLoadContent = function(arguments){
		var args = arguments.result;
		
		SAN.$(_elWindow).appendChild(SAN.create("div", {id: _elCtClose}));
		if(arguments.title!=undefined)SAN.$(_elCtClose).appendChild(SAN.create("h3", {id: _elTitle, innerHTML: arguments.title}));
		SAN.$(_elCtClose).appendChild(SAN.create("a", {href: "#fechar", id: _elClose, innerHTML: "x fechar"}));
		SAN.$(_elWindow).appendChild(SAN.create("div", {id: _elContent, innerHTML: args.responseText}));
		SAN.$(_elWindow).appendChild(SAN.create("div", {id: _elCaption, innerHTML: arguments.lang}));
									
		SAN.$(_elClose).onclick = _hide;
		SAN.$(_elOverlay).onclick = _hide;
				
		SAN.$("body").removeChild(SAN.$(_elLoad));
		
		setTimeout(_position, 50);
	}
	
	var _onLoadImage = function(){
		var Css	 	= SAN.util.css;
		
		this.onload = null;
		
		var x = _page().w - 150;
		var y = _page().h - 150;
		
		SAN.$(_elWindow).appendChild(SAN.create("div", {id: _elCtClose}));
		SAN.$(_elCtClose).appendChild(SAN.create("a", {href: "#fechar", id: _elClose, innerHTML: "x fechar"}));
		SAN.$(_elCtClose).appendChild(SAN.create("div", {id: _elTitle, innerHTML: this.caption}));
		SAN.$(_elWindow).appendChild(SAN.create("div", {id: _elContent, align:"center"}));
		SAN.$(_elWindow).appendChild(SAN.create("div", {id: _elCaption, innerHTML: this.alt}));
		SAN.$(_elContent).appendChild(SAN.create("img", {src: this.src, id: _elImage, alt: this.caption}));
				
		var imageWidth = this.width>0? this.width : Css.getWidth(SAN.$(_elImage));
		var imageHeight = this.height>0? this.height: Css.getHeight(SAN.$(_elImage));
		
		if (imageWidth/x > imageHeight/y) {
			imageHeight = imageHeight * (Math.min(x, imageWidth)/ imageWidth); 
			imageWidth = Math.min(x, imageWidth); 
		}else{
			imageWidth = imageWidth * (Math.min(y, imageHeight) / imageHeight); 
			imageHeight = Math.min(y, imageHeight); 
		}
		
		SAN.$(_elImage).width = imageWidth;
		SAN.$(_elImage).height = imageHeight;

		SAN.$(_elClose).onclick = _hide;
		SAN.$(_elOverlay).onclick = _hide;
		
		SAN.$("body").removeChild(SAN.$(_elLoad));
		
		SAN.$(_elWindow).style.height = Math.round(Css.getHeight(SAN.$(_elWindow)) - 25) + Math.round(this.alt.length/5) + 'px';
		
		setTimeout(_position, 50);
	}
	
	var _show = function(args, type) {		
		
		var _body 		= SAN.$("body");
		var _html 		= SAN.$("html");
		
		var Css	  = SAN.util.css;
		
		if (typeof SAN.$("body").style.maxHeight === "undefined") { //if IE 6	
			
			_body.style.height = _body.style.width = "100%";
			_html.style.height = _html.style.width = "100%";

			//if (SAN.$(_elOculta) === null)_body.appendChild(SAN.util.css.setStyle(SAN.create("iframe", {id: _elOculta}), "opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;"));
		
		}
			
		_body.appendChild(SAN.util.css.setStyle(SAN.create("div", {id: _elOverlay}), "z-index:"+(_zindex+1)+"; visibility:"+(_animate.shadow? "hidde": "")));
		_body.appendChild(SAN.util.css.setStyle(SAN.create("div", {id: _elWindow}), "z-index:"+(_zindex+2)));									 
		_body.appendChild(SAN.util.css.setStyle(SAN.create("div", {id: _elLoad}), "z-index:"+(_zindex+3)));
		
		scroll(0,0);
		
		var h = (_body.scrollHeight > _body.offsetHeight) ? _body.scrollHeight :_body.offsetHeight + 'px';
		//if(SAN.$(_elOculta))SAN.$(_elOculta).style.height = h;
		//SAN.$(_elOverlay).style.height = h;	
		SAN.$(_elWindow).style.position = "fixed";
		SAN.$(_elWindow).style.minWidth = "200px";
		SAN.$(_elWindow).style.minHeight = "50px";
		SAN.$(_elLoad).style.visible = "visible";
		//SAN.$(_elWindow).style.display = "block";
		
		//--Centralizando
		var loadW 	= Css.getWidth(SAN.$(_elLoad));
		var loadH 	= Css.getHeight(SAN.$(_elLoad));	
		var fl = parseInt(Css.getStyle(SAN.$(_elLoad), "padding-left").replace("px" ,""), 10) || 0;
		var fr = parseInt(Css.getStyle(SAN.$(_elLoad), "padding-right").replace("px" ,""), 10) || 0;
		var ft = parseInt(Css.getStyle(SAN.$(_elLoad), "padding-top").replace("px" ,""), 10) || 0;
		var fb = parseInt(Css.getStyle(SAN.$(_elLoad), "padding-bottom").replace("px" ,""), 10) || 0;
			
		var w = loadW - (fl+fr);
		var h = loadH - (ft+fb);
		
		var l = parseInt(((_page().w - loadW) / 2),10);
		var t = parseInt(_scroll().yScroll + ((_page().h - loadH) / 2),10);
		
		SAN.$(_elLoad).style.left = parseInt(((_page().w - loadW) / 2),10) + 'px';
		SAN.$(_elLoad).style.top  = parseInt(_scroll().yScroll + ((_page().h - loadH) / 2),10) + 'px';

		if(_animate.shadow && SAN.common.animation){
			var anim = new SAN.common.animation.Tween(0, 80, 500, {element: SAN.$(_elOverlay)});
			anim.onAnimation = anim.onEndAnimation = _adjustAlpha;
			anim.init();
		}
		if(type=="content"){
			//Carregando dados;
			if(args.method && args.method.toLowerCase() == "post")
				SAN.util.httpRequest.post(args.src, args.params || "", {onComplete: _onLoadContent, arguments: args}, true);
			else
				SAN.util.httpRequest.get(args.src, args.params || "", {onComplete: _onLoadContent, arguments: args}, true);
				
		}else if(type=="image"){
			//Carregando Imagem
			var imgPreloader = SAN.create("img");
			imgPreloader.caption = args.caption || "";
			imgPreloader.alt = args.alt || "";
			imgPreloader.lang = args.lang || "";
			imgPreloader.onload = _onLoadImage;
			imgPreloader.src = args.src;
		}
		
	}
	return {
		showContent: function(args){_show(args, "content");},
		showImage: function(args){_show(args, "image");},
		hide: _hide
	}

}();

// JavaScript Document
SAN.namespace("SAN.common");
SAN.common.animation = function(){
	var _easingEquation = function(t,b,c,d,a,p)
	{
		return c/2 * ( Math.sin( Math.PI * (t/d-0.5) ) + 1 ) + b;
	}
	var _bounceEquation = function(t,b,c,d,a,p)
	{
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	}
	var _elasticEquation = function(t,b,c,d,a,p)
	{
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
	}
	/*Class*/
	var $anim = function(inivalue, endvalue, duration, args){
		this._duration 	= duration;
		this._inicial 	= inivalue;	
		this._final 	= endvalue;
		this._args		= args;		
	}
	$anim.prototype = {
		init:function(){
			if(typeof this._inicial === "array" && typeof this._final === "array" && this._inicial.length != this._final.length)return;
			
			var _self = this;
		
			this._iniTime = new Date().getTime();
			this._interval = setInterval(function(){
				_self.setAnimation();
			}, 5);
		},
		setAnimation:function(){
			var curTime = new Date().getTime()-this._iniTime;	
			
			if (curTime >= this._duration){
				  this.onEndAnimation && this.onEndAnimation(this._final, this._args || {});
				 clearInterval(this._interval);
				 return;
			}
			
			if(typeof this._inicial === "object"){
				var _tempArr = [];
				for(var i=0; i<this._inicial.length; i++){
					_tempArr.push(this.easingEquation(curTime, this._inicial[i], parseInt(this._final[i]-this._inicial[i]), this._duration));
				}
				this.onAnimation && this.onAnimation(_tempArr, this._args || {});
			}else
				this.onAnimation && this.onAnimation(this.easingEquation(curTime, this._inicial, parseInt(this._final-this._inicial), this._duration), this._args || {});
		},
		easingEquation:_easingEquation
	}
	
	return {
		Tween			: $anim,
		easingEquation	: _easingEquation,
		bounceEquation	: _bounceEquation,
		elasticEquation	: _elasticEquation
	}
}();

SAN.namespace("SAN.common");
SAN.common.thumbImage = function() {
	var _classNameDefault = "zoom-box";

	var _initialize = function(){
		var items = document.getElementsByTagName("a");		

		for(var i=0; i<items.length; i++){
			if((items[i].className.indexOf(_classNameDefault)!=-1 && _classNameDefault.length==items[i].className.length) ||
				items[i].className.indexOf(_classNameDefault+" ")!=-1 || items[i].className.indexOf(" "+_classNameDefault)!=-1)
			{
				_createEvent(items[i]);
			}
		}
		
		
	}
	
	var _createEvent = function(element){
		element.onclick = _clickElement;	
	}
	
	var _clickElement = function(){	
		var img = this.href || "";
		var cap = this.title || "";
		var leg = this.lang || "";
		var rev = this.rev || "";
		
		if (rev != ""){ac.abrirPag(rev);}
		
		//var credito = (this.getElementsByTagName("div").length>0)? this.getElementsByTagName("div")[0].innerHTML : "";
		//var credito = (this.getElementsByTagName("span").length>0)? this.getElementsByTagName("span")[0].innerHTML : credito;
		
		if(img=="" || img == "#")return false;
		
		SAN.util.pox.showImage({src:img, caption: cap, alt:leg}); 
		
		return false;
	}
	
	return {
		init: _initialize
	}
}();

SAN.namespace("SAN.common");
SAN.common.oItem = function() {
	var _value		= 1.175;
	var _valueAdd	= 0.085;
	
	var _limitMais	= 1.425;
	var _limitMenos	= 0.915;
	
	var _updateFont = function(container) {
		var pObjs = document.getElementById(container).getElementsByTagName("p");
		for (var i=0; i<pObjs.length; i++)
			pObjs[i].style.fontSize = _value+'em';
	}
	
	var _classNameDefault = "box-sh";
	var _idBoxBusca = "box-sh-teste";
	var _idBoxLoad	= "box-sh-load";
	var _idClose	= "box-sh-fechar";
	var _classClose = "close";
	
	var _srcSearch	= "";
	
	var _offsetX	= 0;
	var _offsetY	= 40;
	var _lastSearch = null;
	
	var _search = function(element){
		
		var node 	= element.cloneNode(true);
		var img 	= node.getElementsByTagName('img')[0];
		
		var q 		= escape(node.innerHTML);
		var opt 	= "?q=" + q + "&=&idate=&edate=&initday=&initmonth=&inityear=&endday=&endmonth=&endyear=&op=fotos&query=" + q;
		var url 	= _srcSearch + opt;
		
		if(img)node.removeChild(img);
		
		var divT 	= SAN.create("div", {id: _idBoxBusca});
		var divC 	= SAN.create("div", {id: _idBoxLoad});
		var h4C	 	= SAN.create("h4", {innerHTML: "carregando..."});
				
		divC.appendChild(h4C);
		divT.appendChild(divC);
		
		SAN.$("body").appendChild(divT);
		
		divT.style.position = "absolute";
		divT.style.left 	= (SAN.util.css.getPosition(element).x + _offsetX) +"px";
		divT.style.top 		= (SAN.util.css.getPosition(element).y + (_value/0.085)*2.5) +"px";	
		
		SAN.util.httpRequest.get(url, "", {onLoad: _onLoadSearch, arguments: {container: divT}});
		
		if(_lastSearch) _lastSearch.parentNode.removeChild(_lastSearch);
		_lastSearch = divT;
	}
	
	var _closeSearch = function(obj) {
		_lastSearch = null;		
		obj.parentNode.removeChild(obj);
	}
	
	var _onLoadSearch = function(args){
		var div = args.container;
		div.innerHTML = '';
		div.innerHTML = args.result.responseText;
		
		var aObjs = div.getElementsByTagName("a");
		
		for(var i=0; i<aObjs.length; i++){
			
			if((aObjs[i].id.indexOf(_idClose)!=-1 && _idClose.length==aObjs[i].id.length) ||
				aObjs[i].id.indexOf(_idClose+" ")!=-1 || aObjs[i].id.indexOf(" "+_idClose)!=-1)
			{
				aObjs[i].closeSearch = _closeSearch;
				aObjs[i].onclick = function(){ this.closeSearch(div); return false; };
			}
		}
	}
	
	var _searchInit = function(){
		var items = document.getElementsByTagName("a");		
				
		for(var i=0; i<items.length; i++){
			if((items[i].className.indexOf(_classNameDefault)!=-1 && _classNameDefault.length==items[i].className.length) ||
				items[i].className.indexOf(_classNameDefault+" ")!=-1 || items[i].className.indexOf(" "+_classNameDefault)!=-1)
			{
				_createEvent(items[i]);
			}
		}
	}
	
	var _createEvent = function(element){
		element.onclick = _clickElement;
	}
	
	var _clickElement = function(){	
		_search(this);		
		return false;
	}
	
	return {
		aumentaFonte:function(container){
			_value = Math.min(_limitMais, _value+_valueAdd);
			_updateFont(container);
		},
		diminuiFonte:function(container){
			_value = Math.max(_limitMenos, _value-_valueAdd);
			_updateFont(container);
		},
		searchInit: _searchInit
	}
}();

SAN.namespace("SAN.common");
SAN.common.flash = function() {
	var _get = function(a) {
		if(!a.swf) return false;
		if(typeof SWFObject == 'undefined') return false;
		
		if(a.required){
			if(!_validVersion(a.required)){
				a.onFlashFail && a.onFlashFail();
				return false;
			}
		}
		
		var width = a.width||100;
		var height = a.height||100;
		var id = a.id||'mymovie';
		var version = a.version||8;
		var color = a.color||'#000000';
		var so = new SWFObject(a.swf, id, width, height, version, color);
		if(a.quality) so.addParam("quality", a.quality);
		if(a.wmode) so.addParam("wmode", a.wmode);
		if(a.allowScriptAccess) so.addParam("allowScriptAccess", a.allowScriptAccess);		
		if(a.variables && typeof a.variables === "object")for(var vars in a.variables) so.addVariable(vars, a.variables[vars]);
		
		return so;
	};
	var _validVersion = function(ver){
		var verInstalled 	= deconcept.SWFObjectUtil.getPlayerVersion();
		var verReq 			= ver.split(".");
		
		if(verInstalled.major < verReq[0]) return false;
		if(verInstalled.major > verReq[0]) return true;
		if(verInstalled.minor < verReq[1]) return false;
		if(verInstalled.minor > verReq[1]) return true;
		if(verInstalled.rev < verReq[2]) return false;
		return true;
	};	
	return function (a) {
		if(a && a.constructor == Object) {
			var so = _get(a);
			if(!so) return false;
			if(a.div && document.getElementById(a.div)){
				so.write(a.div);
				return so;
			} else {
				var id = 'flash-' + (new Date()).getTime();
				document.write('<div id="'+id+'"></div>');
				if(document.getElementById(id))so.write(document.getElementById(id));
				
				return so;
			}				
		}
	};
}();

SAN.namespace("SAN.common");


/*if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
*/

