function toggle(id){
	if (document.getElementById){
		el = document.getElementById(id);
		if (el.style.display == "none"){
			el.style.display = "";
		} 
		else {
		el.style.display = "none";
		}
	}
}

function xmlhttpPost(strURL, param, where) {
    var xmlHttpReq = false;
    // Mozilla/Safari

    if (window.XMLHttpRequest) {
        xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) { 
       xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlHttpReq.open('POST', strURL, true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    xmlHttpReq.onreadystatechange = function() {

        if (xmlHttpReq.readyState == 4) {

            updatepage(xmlHttpReq.responseText, where);
        }
    }
    xmlHttpReq.send(param);
}

function updatepage(str, where){ if (where=="alert")  alert(str);}

function add_suggestion(idfilm,idlink)
{ 	
	xmlhttpPost("../classes/suggestion.php", "idfilm="+idfilm+"&idlink="+idlink, "alert");
	
 return true;	
}

function add_url()
{ 	
	xmlhttpPost("../classes/add_url.php", "idfilm="+document.getElementById('idfilm').value+"&address="+document.getElementById('url').value, "alert");
	
 return true;	
}
