function setWindowVisible(wndName,wndStatus) {
	tmp = document.getElementById(wndName);
	tmp.style.display = wndStatus;
	return(true);
}

// Get's value from a ajax K.I.S.S. response
// Response is like variable^value|variable1^value1 ... etc
function getResponseValue(valueName,response) {
	tmp = response.split("|");
	var ret = new Array();
	for(var f=0; f<tmp.length; f++) {
		tmp1 = tmp[f].split("^");
		if (tmp1[0] == valueName) {
			return(tmp1[1]);
		}
	}
	return(false);
}


function checkEmail(x)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return(true);
	else return(false);
}

function setVisited(id) {	
  //new Effect.Opacity('fpArticle'+id, {duration:0.5, from:1.0, to:0.3});
  var divName = 'fpArticle'+id;
  $(divName).style.filters.alpha.opacity=30;
  $(divName).style.MozOpacity=30
  $(divName).style.opacity = 30;
}


function loadResetPassword() {
	var location = 'autentificareWND';
	var url = '/ajax,recuperare-parola.html';
	$(location).innerHTML = '<img src="/templates/default/images/loading1.gif" width="16" height="16" alt="" />';
	var myAJAX = new Ajax.Updater(location, url, {	method: 'get',	onFailure : function(resp) {alert("Oops, there's been an error.");}});
}
function tryResetPass() {
	var pars = Form.serialize('resetPassForm');
	$('itemsToEnter').innerHTML = '<img src="/templates/default/images/loading1.gif" width="16" height="16" alt="" />';
	var myAJAX = new Ajax.Updater('itemsToEnter', '/index.php?action=sendResetPasswordLink', {	method: 'get',	parameters: pars, onFailure : function(resp) {alert("Oops, there's been an error.");}});
	
	return(false);
}