/*
function close_propunere()
{
	document.getElementById('propunere').style.display="none";
	document.getElementById('propunere').style.visibility="hidden";
}

function minimize_propunere()
{
	document.getElementById('propunere').style.height="12px";
}

function show_propunere()
{
	document.getElementById('propunere').style.height="150px";
}

*/


function repopulate()
{
	var continut="";
	continut+='Nickname: &nbsp;<input type="text" id="nick" name="nick" class="inputgreen" /><br />';
	continut+='Suggestion: <input type="text" id="prop" name="prop" class="inputgreen" value="vs" />';
	continut+='<div align="center"><a href="javascript:void(0);" onClick="javascript:propose();">Send</a></div>';
	document.getElementById('prop_content_live').innerHTML=continut;
}

var xmlhttp = false;
try {
//If the javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using IE.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
//A variable used to distinguish whether to open or close the calendar.

function propose() {
//The location we are loading the page into.
var objID = "prop_content_live";
var post_vars= "nickname="+document.getElementById('nick').value+"&propunere="+document.getElementById('prop').value;
var serverPage = "action/propose.php";
var obj = document.getElementById(objID);
//obj.innerHTML = '<br /><div class="loading"></div>';
xmlhttp.open("POST", serverPage);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", post_vars.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML=xmlhttp.responseText;

}
}
xmlhttp.send(post_vars);
}

function rate(id) {
//The location we are loading the page into.
var objID = id;
var post_vars= "id="+id+"&value="+document.getElementsByName('sel'+id)[0].value;
var serverPage = "action/dorate.php";
var obj = document.getElementById(objID);
//obj.innerHTML = '<br /><div class="loading"></div>';
xmlhttp.open("POST", serverPage);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", post_vars.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(post_vars);
}

