var TextToChange=''

function Start_Change()
{
	if (document.layers)
		document.ChangeOtherMain.visibility="show"
	else if 
		(document.all||document.getElementById)
	
	TextToChange = document.getElementById&&!document.all ? document.getElementById("ChangeIE") : ChangeIE
}

if (document.all||document.getElementById)
	document.write('<span id="ChangeIE" style="width:300"></span>')

window.onload = Start_Change

function Change(Text)
{
	Text = '<font class="ChangedText">&#160;&#160;' + Text + '</font>'
	if (document.layers)
	{
		document.ChangeOtherMain.document.ChangeOtherSub.document.write(Text);
		document.ChangeOtherMain.document.ChangeOtherSub.document.close()
	}
	else if (document.all||document.getElementById)	TextToChange.innerHTML=Text;
}

function DownloadFile(filename, fileurl) {
	var ifr_src = '/hiperpub30/download.asp?filename=' + escape(filename) + '&fileurl=' + escape(fileurl)
	var ifr = document.getElementById('ifrDownload')
	if (!ifr) {
	} else {
		ifr.src = ifr_src; //window.location
	}
	
	//ifrDownload.document.src = ifr_src;
	//window.ifrDownload.src = ifr_src;
	//document.ifrDownload.src = src
	
	//var ifr = window.frames('ifrDownload')
	//ifr.window.location = src
}

function Vote(frm, Id, op) {
	if (!frm) return
	
	var v, i, vote
	
	v = 0;
		
	if (op == 1) {		
		for (i = 0; i <= frm.Vote.length - 1; i++) {
			if (frm.Vote[i].checked) 
			{
				v = 1; 
				vote = frm.Vote[i].value
				
			}
		}
	}
	if (op == 1 && v == 1) 
	{
		var cookie = readCookie('Poll' + Id)
		if (cookie!=null) {
			alert('Só é permitida uma votação por dia!')
		} else {
			writeCookie('Poll' + Id, 1, 24)
			var url = 'default.asp?SqlPage=poll&CpPollId=' + Id + '&CpPollResultId=' + vote
			openWindow(url, 415, 230, 'scrollbars=yes')
		}
	}
	else if (op == 0)
	{
		var url = 'default.asp?SqlPage=poll&CpPollId=' + Id
		openWindow(url, 415, 230, 'scrollbars=yes')		
	}
}		