function ShowHide(elem_id){
		if(document.getElementById(elem_id)){
			if(document.getElementById(elem_id).style.visibility == 'hidden'){
				document.getElementById(elem_id).style.visibility = 'visible';
				document.getElementById(elem_id).style.display = 'block';
			}
			else{
				document.getElementById(elem_id).style.visibility = 'hidden';
				document.getElementById(elem_id).style.display = 'none';
			}
		}
	}
	

// Functions for the Comments Form
var responseSuccess = function(o){
	var response = o.responseText;
	document.getElementById('raspuns').innerHTML = response;

};

var responseFailure= function(o){
	//alert(o.status + " " + o.statusText + " " + o.tld + " " + o.argument);
}

var callback =
{
	success:responseSuccess,
	failure:responseFailure
};
function submit_form(formObject)
{
	YAHOO.util.Connect.setForm(formObject);
	var cObj = YAHOO.util.Connect.asyncRequest('POST', 'ajax_files/insert_comment.php', callback);
}

//Functions for the Vote Form

var vote_responseSuccess = function(o){
	var response = o.responseText;
	document.getElementById('nr_voturi').innerHTML = "Voturi: " + response;
	document.getElementById('link').innerHTML = "";
};

var vote_responseFailure= function(o){
	alert(o.status + " " + o.statusText + " " + o.tld + " " + o.argument);
}

var vote_callback =
{
	success: vote_responseSuccess,
	failure: vote_responseFailure
};
function vote_submit_form(formObject)
{
	YAHOO.util.Connect.setForm(formObject);
	var cObj = YAHOO.util.Connect.asyncRequest('POST', 'ajax_files/insert_vote.php',vote_callback);
}




function GetPCID() 
{
	alpha = "0123456789BCDEFGHJKLMNPQRSTVWXYZAIOUabcdefghjiklmnopqrstuvwxyz .,;:()/\\\\-";
	attr  = "";
	r     = "\\n";
	doc   = document;
	nav   = navigator;
	ua    = nav.userAgent.toLowerCase();
	isIE  = (ua.indexOf("msie") > -1);
	isNOTie30= !( (ua.indexOf("msie 3.0") > -1) );
	isNOTopera = !( (ua.indexOf("opera") > -1) );
	isNOTieONmac = !( (ua.indexOf("msie") > -1) && (ua.indexOf("mac") > -1) );

	// Collect browser attributes, into variable attr.
	attr += nav.appCodeName      	+ r
	     +  nav.appMinorVersion  	+ r
	     +  nav.appName				+ r
	     +  nav.appVersion   		+ r
	     +  nav.BrowserLanguage		+ r
	     +  nav.cookieEnabled		+ r
	     +  nav.cpuClass		    + r
	     +  nav.language			+ r
	     +  nav.onLine       		+ r
	     +  nav.opsProfile			+ r
	     +  nav.platform			+ r
	     +  nav.systemLanguage		+ r
	     +  nav.userAgent	 		+ r
	     +  nav.userLanguage 		+ r
	     +  nav.userProfile			+ r;
	if (isNOTie30) {
	attr += nav.javaEnabled()  		+ r;
	}

	if (self.screen) {
	    attr += screen.width      + r
	         +  screen.height     + r
	         +  screen.colorDepth + r;
	}

	if (isNOTie30 && isNOTieONmac) {
	    for(s = 0; s < nav.plugins.length; s++) {
	        attr += nav.plugins[s].filename    + r
	             +  nav.plugins[s].description + r;
	   }
	}

	if (isIE && isNOTie30 && isNOTopera) {
		// Establish an array of all the detectable components in IE.
		// (All detectable components as of Jun 2002.)
		clsID = new Array (
		"{7790769C-0471-11D2-AF11-00C04FA35D02}", // Address Book
		"{89820200-ECBD-11CF-8B85-00AA005B4340}", // Windows Desktop Update NT
		"{283807B5-2C60-11D0-A31D-00AA00B92C03}", // DirectAnimation
		"{4F216970-C90C-11D1-B5C7-0000F8051515}", // DirectAnimation Java Classes
		"{44BBA848-CC51-11CF-AAFA-00AA00B6015C}", // DirectShow
		"{9381D8F2-0288-11D0-9501-00AA00B911A5}", // Dynamic HTML Data Binding
		"{4F216970-C90C-11D1-B5C7-0000F8051515}", // Dynamic HTML Data Binding for Java
		"{5A8D6EE0-3E18-11D0-821E-444553540000}", // Internet Connection Wizard
		"{89820200-ECBD-11CF-8B85-00AA005B4383}", // Internet Explorer 5 Web Browser
		"{08B0E5C0-4FCB-11CF-AAA5-00401C608555}", // Internet Explorer Classes for Java
		"{45EA75A0-A269-11D1-B5BF-0000F8051515}", // Internet Explorer Help
		"{DE5AED00-A4BF-11D1-9948-00C04F98BBC9}", // Internet Explorer Help Engine
		"{22D6F312-B0F6-11D0-94AB-0080C74C7E95}", // Windows Media Player
		"{44BBA842-CC51-11CF-AAFA-00AA00B6015B}", // NetMeeting NT
		"{3AF36230-A269-11D1-B5BF-0000F8051515}", // Offline Browsing Pack
		"{44BBA840-CC51-11CF-AAFA-00AA00B6015C}", // Outlook Express
		"{CC2A9BA0-3BDD-11D0-821E-444553540000}", // Task Scheduler
		"{08B0E5C0-4FCB-11CF-AAA5-00401C608500}"  // Microsoft virtual machine
		);

		doc.write('<comment style="behavior:url(#default#clientCaps)" ID="lvrt" ></comment>');

		for(i=0; i<clsID.length; i++) {
			if (lvrt.isComponentInstalled(clsID[i], "ComponentID")) {
				attr += lvrt.getComponentVersion(clsID[i], "ComponentID");
			}
		}
		if ( lvrt.isComponentInstalled("{22D6F312-B0F6-11D0-94AB-0080C74C7E95}", "ComponentID") ) {
			doc.write("<object id=mpiBill width=1 height=1 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>");
			doc.write("</object>");
			if (typeof(doc.mpiBill.ClientID) != "unknown")
				attr += mpSerNbr = doc.mpiBill.ClientID;
		}
		attr += ScriptEngineBuildVersion();

	}

	// Compute 64 bit hash of attr.
	w1 = w2 = x1 = x2 = y1 = y2 = z = 1;
	for(s = 0; s < attr.length; s++) {
	    w2  = x2 + y2 + s + 1 + alpha.indexOf( attr.charAt(s) );
	    w1  = x1 + y1 + (w2 >> 16);
	    w2 += (w1 >> 16);
	    w1 &= 65535;
	    w2 &= 65535;
	    zz  = (1 << z) - 1;
	    s1  = (w1 & zz) << (16 - z);
	    s2  = (w2 & zz) << (16 - z);
	    w1  = s2 | (w1 >> z);
	    w2  = s1 | (w2 >> z);

		z  = y2 & 15;
		y1 = x1;
		y2 = x2;
		x1 = w1;
		x2 = w2;
	}


	// Convert 64 bit hash to 12 char alphanumeric string.
	key = "";
	for(y = 0; y < 3; y++) {
	    key += alpha.charAt(x1 & 31); x1 >>= 5;
	    key += alpha.charAt(x2 & 31); x2 >>= 5;
	    key += alpha.charAt(y1 & 31); y1 >>= 5;
	    key += alpha.charAt(y2 & 31); y2 >>= 5;
	}

	return(key);
}

