//---------------------------- iG Functions
function $(id){return document.getElementById(id)}

/* FUNCTION SHARE */
function share(id){
	var aba_share = document.getElementById('aba-share-'+id);
	var share = 	document.getElementById('share-'+id);
	
	if(share.style.display=='block'){
		share.style.display='none'
		aba_share.className='share nobg-c'
	}else{
		share.style.display='block'
		aba_share.className='share'
	}
}

/*iG Bar*/
function gob(o){return document.getElementById(o)};		
function fib(o){f=gob("fib");if(f.q.value=="Fa&ccedil;a sua busca" || f.q.value=="Faça sua busca" || f.q.value==""){alert("Digite uma consulta antes de acionar a busca");}else{window.open("http://busca.igbusca.com.br/app/search?q="+escape(f.q.value)+"&o=BARRAIG");}};
function tbc(){if(gob('fib').q.value=="Fa&ccedil;a sua busca" || gob('fib').q.value=="Faça sua busca"){gob('fib').q.value="";}return false};
function tbb(){if(gob('fib').q.value==""){gob('fib').q.value="Faça sua busca";}return false};

/* OAS */
OAS_url='http://adserver.ig.com.br/RealMedia/ads/'
OAS_listpos='Top2,x09,x15'
OAS_query=''
OAS_version=10
OAS_rn='001234567890'
OAS_rns='1234567890'
OAS_rn=new String(Math.random())
OAS_rns=OAS_rn.substring(2,11)
function OAS_NORMAL(pos){
	document.write('<a href="'+OAS_url+'click_nx.ads/'+OAS_sitepage+'/1'+OAS_rns+'@'+OAS_listpos+'!'+pos+'?'+OAS_query+'" target="'+OAS_target+'"><img src="'+OAS_url+'adstream_nx.ads/'+OAS_sitepage+'/1'+OAS_rns+'@'+OAS_listpos+'!'+pos+'?'+OAS_query+'" /></a>')
}
OAS_version=11
if(navigator.userAgent.indexOf('Mozilla/3')!=-1)
	OAS_version=10
if(OAS_version>=11)
	document.write('<script type="text/javascript" src="'+OAS_url+'adstream_mjx.ads/'+OAS_sitepage+'/1'+OAS_rns+'@'+OAS_listpos+'?'+OAS_query+'"><\/script>')
function OAS_AD(pos){
	if(OAS_version>=11)
		OAS_RICH(pos)
	else
		OAS_NORMAL(pos)
}

/* ADVERTISING */
function adPosition(ad,position){
	var arg=$(position)
	var posTop=0,posLeft=0
	if(arg.offsetParent){
		do{
			posTop+=arg.offsetTop
			posLeft+=arg.offsetLeft
		}
		while(arg=arg.offsetParent)
  	}
	$(ad).style.top=posTop+'px'
	$(ad).style.left=posLeft+'px'
	$(ad).style.display='block'
}

//MySpace
function openMySpace(TITLE,CONTENT,URL,IMG_SRC){
	if(IMG_SRC!=''){
		IMG = '<img src="'+IMG_SRC+'" width="50%" height="50%"/>';
	}else{
		IMG = '';
	}
	
	CONTENT = IMG + '<br />' + CONTENT;
	var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 
					't=' + encodeURIComponent(TITLE) + 
					'&c=' + CONTENT + 
					'&u=' + encodeURIComponent(URL) + 
					'&l=';
	window.open(targetUrl);
}

//Function commentAdmin
function replyAdmin(){
	if($('commentlist')){
		var liComments = $('commentlist').getElementsByTagName('li');
		
		for(i=0;i<liComments.length;i++){
			liClasses = liComments[i].className;
			
			if(liClasses.indexOf('comment-author-admin')!=-1 || liClasses.indexOf('bypostauthor')!=-1){
				liComments[i].getElementsByTagName('div')[0].className += " bg_admin_reply";
			}
		}
	}
}

replyAdmin();