/* onload manager */
var onload_replaced = window.onload ;
var onload_functions_stack = new Array () ;
function onload_manager ( stacked , priority ) {
	var default_priority = 0 ;
	var size = onload_functions_stack.length ;
	if ( priority ) {
		onload_functions_stack[size] = new Array ( stacked , priority ) ;
	}
	else {
		onload_functions_stack[size] = new Array ( stacked , default_priority ) ;
	}
}
function onload_call () {
	onload_functions_stack.sort ( onload_sort ) ;
	for ( var i = 0 ;  i < onload_functions_stack.length ; i++ ) {
		if ( onload_functions_stack[i][0] ) {
			onload_functions_stack[i][0] () ;
		}
	}
}
function onload_sort ( a , b ) {
    return b[1] - a[1] ;
}
window.onload = onload_call ;
onload_manager ( onload_replaced ) ;
/* /onload manager */

function get_obj ( obj ) {
	if ( document.getElementById ) {
		if ( document.getElementById ( obj ) ) {
			return document.getElementById ( obj ) ;
		}
	}
	return null ;
}

function get_tag_parent ( obj , tag , nameClass ) {
	var localClass = nameClass || null ;
	if ( obj == null ) {
		return null ;
	}
	else {
		// gecko bug, supposed to be uppercase
		if ( obj.nodeType == 1 && obj.tagName.toLowerCase () == tag.toLowerCase () ) {
			if ( localClass ) {
				if ( localClass == obj.className ) {
					return obj ;
				}
			}
			else {
				return obj ;
			}
			return get_tag_parent ( obj.parentNode , tag , localClass ) ;
		}
		else {
			return get_tag_parent ( obj.parentNode , tag , localClass ) ;
		}
	}
}

function get_tag_obj ( tag , obj , name_class ) {
	var local_class = name_class || null ;
	if ( document.getElementsByTagName ) {
		if ( obj ) {
			var tmp = obj.getElementsByTagName ( tag ) ;
			if ( tmp ) {
				if ( local_class ) {
					for ( var i = 0 , limit = tmp.length ; i < limit ; i++ ) {
						if ( tmp[i].className == local_class ) {
							return tmp[i] ;
						}
					}
				}
				else {
					return tmp ;
				}
			}
		}
		else {
			var tmp = document.getElementsByTagName ( tag ) ;
			if ( tmp ) {
				if ( local_class ) {
					for ( var i = 0 , limit = tmp.length ; i < limit ; i++ ) {
						if ( tmp[i].className == local_class ) {
							return tmp[i] ;
						}
					}
				}
				else {
					return tmp ;
				}
			}
		}
	}
	return null ;
}

function abreFecha(actLink,objName){
	obj = document.getElementById(objName);
	ac = actLink.className;
	if(obj.className == ''){
		obj.className = 'esc'
		actLink.className = ac.replace(/a/,"f")
	} else {
		obj.className = ''
		actLink.className = ac.replace(/f/,"a")
	}
	return false;
}
function gotoURL(obj){
var gourl = obj.options[obj.selectedIndex].value;
if (gourl!="") window.open(gourl, '_blank');
}
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
function get_url () {
	return window.location.toString () ;
}
function url_encode ( str ) {
	var encoded = "" ;
	var valid_uri_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$-_.+!*'()," ;
	var hex_chars = "0123456789ABCDEF" ;
	for ( var i = 0 , limit = str.length ; i < limit ; i++ ) {
		if ( valid_uri_chars.indexOf ( str.charAt ( i ) ) == -1 ) {
			encoded += "%" + hex_chars.charAt ( str.charCodeAt ( i ) >> 4 ) + hex_chars.charAt ( str.charCodeAt ( i ) & 0xF ) ;
		}
		else {
			encoded += str.charAt ( i ) ;
		}
	}
	return encoded ;
}
/* gallery image */
function GallerySearchInPage ( localClass ) {
	if ( document.getElementsByTagName ) {
		var obj = document.getElementsByTagName ( "table" ) ;
		var tables = new Array () ;
		var count = 0 ;
		for ( var i = 0 , limit = obj.length ; i < limit ; i++ ) {
			if ( obj[i].className == localClass ) {
				tables[count++] = obj[i] ;
			}
		}
	}
	if ( tables.length > 0 ) {
		return tables ;
	}
	return false ;
}

function Gallery ( localClass , tables ) {

	// attribute
	this.localClass = localClass || "" ;
	this.tables = tables || null ;
	this.imageBorder = 0 ;
	this.imageWidth ;
	this.imageAmountVisible ;
	this.delay = 30 ;
	this.increment = 15 ;
	this.imagePrevious = "/images/img_seta_esq2.gif" ;
	this.imageNext = "/images/img_seta_dir2.gif" ;
	this.imagePreviousDisable = "/images/x.gif" ;
	this.imageNextDisable = "/images/x.gif" ;

	var localTableSize = tables.length ;
	var movementStatus = new Array ( localTableSize ) ;
	var itemPointer = new Array ( localTableSize ) ;
	var amountItem = new Array ( localTableSize ) ;
	var list = new Array ( localTableSize ) ;
	var timer = new Array ( localTableSize ) ;
	var flagSize = new Array ( localTableSize ) ;

	// list auxiliary, used to check loaded images
	var listAuxiliary = new Array ( localTableSize ) ;

	// method
	this.initialize = initialize ;
	this.addExtraItem = addExtraItem ;
	this.itemPrevious = itemPrevious ;
	this.itemNext = itemNext ;
	this.addNextPrevious = addNextPrevious ;
	this.scrollerNext = scrollerNext ;
	this.scrollerPrevious = scrollerPrevious ;

	function initialize () {

		// add UL
		for ( var i = 0 , limit = tables.length ; i < limit ; i++ ) {
			var currentItem , start , end ;
			var content = "" ;
			var container = tables[i].getElementsByTagName ( "div" ).item ( 0 ).getElementsByTagName ( "div" ).item ( 0 ) ;
			var newUl = "<ul class=\"setImage\"><\/ul>" ;
			amountItem[i] = imageSet[i].length ;
			container.innerHTML = newUl ;
			movementStatus[i] = false ;
			flagSize[i] = 0 ;

			// init aux
			listAuxiliary[i] = new Array () ;

			// check the current item
			for ( var j = 0 , limit_j = amountItem[i] ; j < limit_j ; j++ ) {
				if ( imageSet[i][j][2] == true ) {
					currentItem = j ;
				}
			}

			// initialize variable start and end
			if ( ( currentItem + ( this.imageAmountVisible - 1 ) ) < amountItem[i] ) {
				start = currentItem ;
				itemPointer[i] = start ;
			}
			else {
				start = currentItem - ( ( this.imageAmountVisible - 1 ) - ( amountItem[i] - ( currentItem + 1 ) ) ) ;
				itemPointer[i] = start ;
			}
			end = start ;
			if ( amountItem[i] <= this.imageAmountVisible ) {
				start = 0 ;
			}

			// add LIs
			list[i] = container.getElementsByTagName ( "ul" ).item ( 0 ) ;
			for ( var j = start , limit_j = ( end + this.imageAmountVisible ) ; j < limit_j ; j++ ) {
				if ( imageSet[i][j][2] == true ) {
					var contentClass = " class=\"current\"" ;
				}
				else {
					var contentClass = "" ;
				}
				content += "<li" + contentClass + "><a href=\"" + imageSet[i][j][0] + "\"><img src=\"" + imageSet[i][j][1] + "\" width=\"" + this.imageWidth + "\" height=\"" + this.imageWidth + "\" border=\"0\" alt=\"\" class=\"show\" id=\"" + imageSet[i][j][3] + "\"><\/a><\/li>" ;
				listAuxiliary[i][j] = imageSet[i][j][3] ;
			}
			list[i].innerHTML = content ;

			// add extra LIs
			this.addExtraItem ( start , i ) ;

			// change position
			if ( amountItem[i] > this.imageAmountVisible && currentItem > 0 ) {
				list[i].style.left = "-" + ( this.imageWidth + ( this.imageBorder ) ) + "px" ;
			}

			// add previous and next
			if ( amountItem[i] > this.imageAmountVisible ) {
				this.addNextPrevious ( tables[i] , itemPointer[i] , i ) ;
			}
		}
	}

	function addExtraItem ( start , table ) {

		// add item in first position
		if ( start != 0 ) {
			var item = document.createElement ( "li" ) ;
			item.innerHTML = "<a href=\"" + imageSet[table][start-1][0] + "\"><img src=\"" + imageSet[table][start-1][1] + "\" width=\"" + this.imageWidth + "\" height=\"" + this.imageWidth + "\" border=\"0\" alt=\"\" class=\"show\" id=\"" + imageSet[table][start-1][3] + "\"><\/a>" ;
			list[table].insertBefore ( item , list[table].getElementsByTagName ( "li" ).item ( 0 ) ) ;
			listAuxiliary[table][start-1] = imageSet[table][start-1][3] ;
		}

		// add item in last position
		if ( ( start + this.imageAmountVisible ) < imageSet[table].length ) {
			var pos = start + this.imageAmountVisible ;
			var item = document.createElement ( "li" ) ;
			item.innerHTML = "<a href=\"" + imageSet[table][pos][0] + "\"><img src=\"" + imageSet[table][pos][1] + "\" width=\"" + this.imageWidth + "\" height=\"" + this.imageWidth + "\" border=\"0\" alt=\"\" class=\"show\" id=\"" + imageSet[table][pos][3] + "\"><\/a>" ;
			list[table].appendChild ( item ) ;
			listAuxiliary[table][pos] = imageSet[table][pos][3] ;
		}
	}

	// control arrows
	function addNextPrevious ( table , currentItem , i ) {
		if ( currentItem != 0 ) {
			table.tBodies[0].rows[1].cells[0].innerHTML = "<a href=\"#\" onClick=\"gallery.itemPrevious ( this , " + i + " ) ; return false ;\" ondblclick=\"return false ;\"><img src=\"" + this.imagePrevious + "\" border=\"0\" alt=\"Anterior\"><\/a>" ;
		}
		else {
			table.tBodies[0].rows[1].cells[0].innerHTML = "&nbsp;"; //"<img src=\"" + this.imagePreviousDisable + "\">" ;
		}
		if ( amountItem[i] > ( currentItem + this.imageAmountVisible ) ) {
			table.tBodies[0].rows[1].cells[2].innerHTML = "<a href=\"#\" onClick=\"gallery.itemNext ( this , " + i + " ) ; return false ;\" ondblclick=\"return false ;\"><img src=\"" + this.imageNext + "\" border=\"0\" alt=\"Próximo\"><\/a>" ;
		}
		else {
			table.tBodies[0].rows[1].cells[2].innerHTML = "&nbsp;"; //"<img src=\"" + this.imageNextDisable + "\">" ;
		}
	}

	// control add previous item
	function itemPrevious ( obj , i ) {
		// check movement
		if ( movementStatus[i] ) {
			return ;
		}
		movementStatus[i] = true ;

		// insert before new element
		var newPos = itemPointer[i] - 2 ;
		if ( ( newPos >= 0 ) && ( imageSet[i][newPos][3] != listAuxiliary[i][newPos] ) ) {
			var elementNew = document.createElement ( "li" ) ;
			elementNew.innerHTML = "<a href=\"" + imageSet[i][newPos][0] + "\"><img src=\"" + imageSet[i][newPos][1] + "\" width=\"" + this.imageWidth + "\" height=\"" + this.imageWidth + "\" border=\"0\" alt=\"\" class=\"show\" id=\"" + imageSet[i][newPos][3] + "\"><\/a>" ;
			list[i].insertBefore ( elementNew , list[i].getElementsByTagName ( "li" ).item ( 0 ) ) ;
			list[i].style.left = "-" + ( 2 * ( ( this.imageBorder ) + this.imageWidth ) ) + "px" ; // back
			listAuxiliary[i][newPos] = imageSet[i][newPos][3] ;
		}

		// change position
		timer[i] = setInterval ( "gallery.scrollerPrevious (" + i + "," + this.increment + "," + this.imageBorder + "," + this.imageWidth + "," + itemPointer[i] + ")" , this.delay ) ;
		itemPointer[i]-- ;
	}

	// control add next item
	function itemNext ( obj , i ) {
		// check movement
		if ( movementStatus[i] ) {
			return ;
		}
		movementStatus[i] = true ;

		// append new element
		var newPos = itemPointer[i] + this.imageAmountVisible + 1 ;
		if ( ( newPos < imageSet[i].length ) && ( imageSet[i][newPos][3] != listAuxiliary[i][newPos] ) ) {
			var elementNew = document.createElement ( "li" ) ;
			elementNew.innerHTML = "<a href=\"" + imageSet[i][newPos][0] + "\"><img src=\"" + imageSet[i][newPos][1] + "\" width=\"" + this.imageWidth + "\" height=\"" + this.imageWidth + "\" border=\"0\" alt=\"\" class=\"show\" id=\"" + imageSet[i][newPos][3] + "\"><\/a>" ;
			list[i].appendChild ( elementNew ) ;
			listAuxiliary[i][newPos] = imageSet[i][newPos][3] ;
		}

		// change position
		timer[i] = setInterval ( "gallery.scrollerNext (" + i + "," + this.increment + "," + this.imageBorder + "," + this.imageWidth + "," + itemPointer[i] + ")" , this.delay ) ;
		itemPointer[i]++ ;
	}

	// change position / next
	function scrollerNext ( i , increment , imageBorder , imageWidth ) {
		var positionLeft = list[i].offsetLeft ;
		if ( ( flagSize[i] + increment ) >= imageWidth ) {
			list[i].style.left = ( positionLeft - ( ( imageBorder ) + ( imageWidth - flagSize[i] ) ) ) + "px" ;
			flagSize[i] = 0 ;
			movementStatus[i] = false ;
			clearInterval ( timer[i] ) ;
			this.addNextPrevious ( tables[i] , itemPointer[i] , i ) ;
			return ;
		}
		list[i].style.left = ( positionLeft - increment ) + "px" ;
		flagSize[i] += increment ;
	}

	// change position / previous
	function scrollerPrevious ( i , increment , imageBorder , imageWidth ) {
		var positionLeft = list[i].offsetLeft ;
		if ( ( flagSize[i] + increment ) >= imageWidth ) {
			list[i].style.left = ( positionLeft + ( ( imageBorder ) + ( imageWidth - flagSize[i] ) ) ) + "px" ;
			flagSize[i] = 0 ;
			movementStatus[i] = false ;
			clearInterval ( timer[i] ) ;
			this.addNextPrevious ( tables[i] , itemPointer[i] , i ) ;
			return ;
		}
		list[i].style.left = ( positionLeft + increment ) + "px" ;
		flagSize[i] += increment ;
	}
}
/* / gallery image */

function issue_control () {
	if ( ! document.getElementById || ! document.getElementsByTagName ) return ;

	var obj = document.getElementById ( "issueworld" ) ;
	if ( ! obj ) return ;

	var list = obj.getElementsByTagName ( "a" ) ;
	if ( ! list ) return ;

	var count = 0 ;
	var flag = false ;
	var num = parseInt ( Math.random () * 7 ) ;
	var numbers = new Array ( 3 ) ;
	numbers[count] = num ;

	while ( count < 2 ) {
		flag = false ;
		num = Math.round ( Math.random () * 7 ) ;

		for ( var i = 0 , limit = numbers.length ; i < limit ; i++ ) {
			if ( num == numbers[i] ) {
				flag = true ;
				break ;
			}
		}

		if ( ! flag ) {
			numbers[++count] = num ;
		}
	}

	for ( var i = 0 , limit = numbers.length ; i < limit ; i++ ) {
		list[numbers[i]].style.display = "inline" ;
	}
}
onload_manager ( issue_control ) ;


/* player */
var ap_instances = new Array () ;
function ap_stopAll ( player_id ) {
	for ( var i = 0 ; i < ap_instances.length ; i++ ) {
		try {
			if ( ap_instances[i] != player_id ) {
				document.getElementById ( "audioplayer" + ap_instances[i].toString () ).SetVariable ( "closePlayer" , 1 ) ;
			}
			else {
				document.getElementById ( "audioplayer" + ap_instances[i].toString () ).SetVariable ( "closePlayer" , 0 ) ;
			}
		}
		catch ( errorObject ) {}
	}
}

function ap_load () {
	var content_label = "content" ;
	var obj = get_obj ( content_label ) ;
	if ( obj ) {
		var list = get_tag_obj ( "a" , obj ) ;
		if ( list ) {
			var index = 0 ;
			for ( var i = list.length - 1 ; i >= 0 ; i-- ) {
				var url = list.item ( i ).href ;
				if ( ( url.search ( /[a-z0-9_/:.-]+\.mp3/i ) != -1 ) && ( list.item ( i ).className == "audio" ) ) {
					var parent_node = get_tag_parent ( list.item ( i ) , "p" ) ;
					if ( parent_node ) {
						var html = "" ;
						ap_instances[index] = index ;
						html += "<object type=\"application/x-shockwave-flash\" data=\"/media/cms/player.swf\" id=\"audioplayer" + index + "\" height=\"24\" width=\"290\">" ;
						html += "<param name=\"movie\" value=\"/media/cms/player.swf\">" ;
						html += "<param name=\"FlashVars\" value=\"playerID=" + index + "&amp;loop=no&amp;autostart=no&amp;slider=0x666666&amp;track=0xffffff&amp;border=0x666666&amp;loader=0x9fffb8&amp;soundFile=" + url + "\">" ;
						html += "<param name=\"quality\" value=\"high\">" ;
						html += "<param name=\"menu\" value=\"false\">" ;
						html += "<param name=\"bgcolor\" value=\"EAEAE2\">" ;
						html += "<param name=\"wmode\" value=\"transparent\">" ;
						html += "<\/object>" ;
						parent_node.innerHTML = html ;
						index++ ;
					}
				}
			}
		}
	}
}
onload_manager ( ap_load ) ;
/* / player */


/* comments */
var Comments = {
	_objRequestPost : null ,
	_objRequestGet : null ,
	_objComments : null ,
	uri : "" ,
	data : "" ,
	elementId : 0 ,

	_isValid : function ( form ) {
		var error = Array () ;
		var count = 0 ;
		var count_character = Comments.data.count_character || 4096 ;

		form.elements.author_name.value = form.elements.author_name.value.replace ( /^\s*(.*)\s*$/ , "$1" ) ;
		form.elements.body.value = form.elements.body.value.replace ( /^\s*(.*)\s*$/ , "$1" ) ;

		if ( form.elements.author_name.value == "" ) {
			error[count++] = "O campo Nome é de preenchimento obrigatório." ;
		}
		if ( form.elements.body.value == "" ) {
			error[count++] = "O campo Comentário é de preenchimento obrigatório." ;
		}
		if ( form.elements.body.value.length > parseInt ( count_character ) ) {
			error[count++] = "O campo Comentário ultrapassou o limite de " + count_character + " caracteres." ;
		}
		if ( ( form.elements.author_email.value.toString () != "" ) && ! form.elements.author_email.value.toString ().match ( /^[a-zA-Z0-9]+([_.-]?[a-zA-Z0-9]+)+@[a-zA-Z0-9]+([_-]?[a-zA-Z0-9]+)*([.]{1})[a-zA-Z0-9]+([.]?[a-zA-Z0-9]+)*$/i ) ) {
			error[count++] = "Valor inválido para o campo E-mail." ;
		}

		if ( error.length > 0 ) {
			Comments._showMessage ( error ) ;
			return false ;
		}

		return true ;
	} ,

	_showMessage : function ( list ) {
		var id = document.getElementById ( "comments-message" ) ;
		var message = "<p>" ;
		for ( var i in list ) {
			message += list[i] + "<br>" ;
		}
		message += "<\/p>" ;
		id.innerHTML = message ;
	} ,

	display : function ( tmp_data ) {
		Comments.data = eval ( tmp_data )[0] ;
		var data = Comments.data.items ;
		var html = "<ul>" ;

		for ( var i in data ) {
			html += "<li>";
			html += "<a href=\"" + data[i].url + "\">" + data[i].date + "<\/a>";
			html += " &agrave;s <b>" + data[i].time + "<\/b> - " + data[i].author_name + "<br>";
			html += data[i].body.replace(/\n/g, "<br>");
			html += "<\/li>";
		}

		html += "<\/ul>" ;

		if (Comments.data.total_found > 5){
		html += "<p class=\"mais\"><a href=\"" + Comments.data.submit + "\">Veja mais comentários<\/a></p>" ;
		}

		Comments._objComments.innerHTML = html ;
	} ,

	displayTotal : function ( tmp_data ) {
		Comments.data = eval ( "(" + tmp_data + ")" ) ;
		var data = Comments.data.items ;
		var id = null ;
		for ( var i in data ) {
			id = document.getElementById ( "comments-" + data[i].item_id ) ;
			if ( id ) {
				id.innerHTML += " (" + data[i].total + ")" ;
			}
		}
	} ,

	form : function ( id ) {
		if ( ! Comments.data.submit ) {
			var obj = document.getElementById ( id ) ;
			var html = "<hr><div id=\"comments-message\"><\/div><form name=\"comment\" onsubmit=\"Comments.send () ; return false ;\">" ;
			html += "<input type=\"hidden\" name=\"item_url\" value=\"" + document.location.toString () + "\">" ;
			html += "<p style=\"display: none ;\"><input type=\"text\" name=\"name\" value=\"\" class=\"text\"></p>" ;
			// html += "<p><label for=\"comments-title\">Título<\/label><br><input type=\"text\" name=\"title\" id=\"comments-title\" value=\"\" maxlength=\"255\" class=\"text\"><\/p>" ;
			html += "<p><label for=\"comments-author_name\">Nome<\/label><input type=\"text\" name=\"author_name\" id=\"comments-author_name\" value=\"\" maxlength=\"255\" class=\"text\"><\/p>" ;
			html += "<p><label for=\"comments-author_email\">E-mail<\/label><input type=\"text\" name=\"author_email\" id=\"comments-author_email\" value=\"\" maxlength=\"255\" class=\"text\"><\/p>" ;
			// html += "<p><label for=\"comments-author_url\">Link<\/label><br><input type=\"text\" name=\"author_url\" id=\"comments-author_url\" value=\"\" maxlength=\"255\" class=\"text\"><\/p>" ;
			html += "<p><label for=\"comments-body\">Comentário<\/label><textarea name=\"body\" id=\"comments-body\" class=\"textarea\"><\/textarea><\/p>" ;
			html += "<p><input type=\"submit\" name=\"send\" value=\"Enviar\" class=\"submit\"><\/p>" ;
			html += "<\/form>" ;
			obj.innerHTML = html ;
		}
	} ,

	empty : function () {
		var form = document.forms.comment ;
		for ( var i = 0 , limit = form.elements.length ; i < limit ; i++ ) {
			if ( form.elements[i].type == "text" || form.elements[i].type == "textarea" ) {
				form.elements[i].value = "" ;
			}
		}
	} ,

	send : function () {
		var form = document.forms.comment ;

		if ( Comments._isValid ( form ) ) {
			Comments._showMessage ( new Array () ) ;
			Comments._objRequestPost = new Request () ;
			var data = "" ;
			for ( var i = 0 , limit = form.elements.length ; i < limit ; i++ ) {
				data += form.elements[i].name + "=" + escape ( form.elements[i].value.toString () ) ;
				if ( i < ( limit - 1 ) ) {
					data += "&" ;
				}
			}
			Comments._objRequestPost.send ( Comments.data.submit , data , Comments.getResponsePost ) ;
		}
	} ,

	getResponsePost : function () {
		var required_moderation = Comments.data.required_moderation || 1 ;
		if ( Comments._objRequestPost.obj.readyState == 4 ) {
			if ( Comments._objRequestPost.obj.status == 201 ) {
				Comments._showMessage ( new Array ( Comments._objRequestPost.obj.responseText.toString () ) ) ;
				Comments._setCookie ( Comments.data.id ) ;
				Comments.empty () ;
				if ( required_moderation == "0" ) {
					Comments.get ( Comments.uri , Comments._objComments.id , Comments.elementId , true ) ;
				}
			}
			if ( Comments._objRequestPost.obj.status == 400 ) {
				Comments._showMessage ( new Array ( Comments._objRequestPost.obj.responseText.toString () ) ) ;
			}
			if ( Comments._objRequestPost.obj.status == 404 ) {
				Comments._showMessage ( new Array ( "Problemas no envio dos dados." ) ) ;
			}
		}
	} ,

	get : function ( uri , id , element_id , no_cache ) {
		Comments.uri = uri ;
		Comments.elementId = element_id ;
		Comments._objComments = document.getElementById ( id ) ;
		Comments._objRequestGet = new Request () ;
		if ( no_cache || Comments._haveCookie ( element_id ) ) {
			Comments._objRequestGet.get ( uri + "?cache=no" , Comments.getResponseGet ) ;
		}
		else {
			Comments._objRequestGet.get ( uri , Comments.getResponseGet ) ;
		}
	} ,

	getResponseGet : function () {
		if ( Comments._objRequestGet.obj.readyState == 4 && Comments._objRequestGet.obj.status == 200 ) {
			Comments.display ( Comments._objRequestGet.obj.responseText.toString () ) ;
		}
	} ,

	getResponseTotal : function () {
		if ( Comments._objRequestGet.obj.readyState == 4 && Comments._objRequestGet.obj.status == 200 ) {
			Comments.displayTotal ( Comments._objRequestGet.obj.responseText.toString () ) ;
		}
	} ,

	getTotal : function ( uri , type , ids ) {
		var tmp_ids = ids.split ( "," ) ;
		tmp_ids.sort ( function ( a , b ) { return a - b ; } ) ;
		tmp_ids = tmp_ids.join ( "," ) ;
		var tmp_uri = uri + "item_type=" + type + "&item_id=" + tmp_ids ;
		Comments._objRequestGet = new Request () ;
		Comments._objRequestGet.get ( tmp_uri , Comments.getResponseTotal ) ;
	} ,

	_setCookie : function ( id ) {
		var expires = new Date () ;
		expires.setMinutes ( expires.getMinutes () + 5 ) ;
		var uri = document.location.pathname ;
		document.cookie = "comments=" + id + "; expires=" + expires.toGMTString () + "; path=" + uri  ;
	} ,

	_haveCookie : function ( id ) {
		return document.cookie.indexOf ( "comments=" + id ) != -1 ;
	}
} ;

function Request () {
	this.obj = null ;

	this.getRequest = getRequest ;
	this.send = send ;
	this.get = get ;

	function getRequest () {
		if ( this.obj ) {
			return this.obj ;
		}

		if ( window.XMLHttpRequest ) {
			this.obj = new XMLHttpRequest () ;
		}
		else {
			if ( window.ActiveXObject ) {
				try {
					this.obj = new ActiveXObject ( "Msxml2.XMLHTTP" ) ;
				}
				catch ( error ) {
					this.obj = new ActiveXObject ( "Microsoft.XMLHTTP" ) ;
				}
			}
		}
		return this.obj ;
	}

	function send ( uri , data , response ) {
		this.getRequest () ;
		this.obj.open ( "POST" , uri , true ) ;
		this.obj.setRequestHeader ( "Content-Type" , "application/x-www-form-urlencoded; charset=ISO-8859-1" ) ;
		this.obj.setRequestHeader ( "Cache-Control" , "no-cache" ) ;
		this.obj.setRequestHeader ( "Pragma" , "no-cache" ) ;
		if ( response ) {
			this.obj.onreadystatechange = response ;
		}
		this.obj.send ( data ) ;
	}

	function get ( uri , response ) {
		this.getRequest () ;
		this.obj.open ( "GET" , uri , true ) ;
		this.obj.setRequestHeader ( "Content-Type" , "application/x-javascript; charset=ISO-8859-1" ) ;
		this.obj.setRequestHeader ( "Cache-Control" , "no-cache" ) ;
		this.obj.setRequestHeader ( "Pragma" , "no-cache" ) ;
		this.obj.onreadystatechange = response ;
		this.obj.send ( null ) ;
	}
}
/* /comments */


function AlteraCorpoTexto(tamanho, el){
		a=document.getElementById("artigoTexto");
		a.className = "texto"+tamanho;
		var muda = document.getElementById ( "muda" ) ;
	  var mudaL = muda.getElementsByTagName ( "a" ) ;
	  for (var i=0; i < mudaL.length; i++ ){
	  		var str = mudaL[i].className;
	  		if ( str.indexOf ( "actived" ) > -1 ) {
	  			str = str.substr ( 0 , mudaL[i].className.indexOf ( "actived" ) );
	  			mudaL[i].className = str ;
	  		}
	  }
	  el.className += " actived" ;
}


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,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"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(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={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.push(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");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_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");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_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{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(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[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(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;
