function display(divId)
{
	var toDisplay=$(divId);
	//alert(toDisplay.style.display);
	Effect.toggle(toDisplay, 'blind', {duration:1});
	//alert(toDisplay.style.display);
}

function demoPopupOpen(fileName)
{
	window.open('demoPopups/demoPopup.php?file='+fileName, 'EditPopup', 'scrollbars=yes, menubar=0, resizable=1, width=500, height=350');
}

function sendAnswer(id)
{
	new Ajax.Request('jax/saveAnswer.jax.php', {onComplete:tempShowResponse, method:'post', postBody:'id='+id});
}

function tempShowResponse(originalRequest)
{
	if(originalRequest.responseText=='true')
		alert("Va multumim");
	else
		alert("A avut loc o eroare!");
}

function showPoolResults(id)
{
	new Ajax.Updater('resultsContainer','jax/showAnswer.jax.php', {evalScripts:true, method:'post', postBody:'id='+id});
	var win=$('poolResults');
	var scrolls=getScrollXY();
	var scrSizes=getSizes();
	var winWidth=win.getDimensions();
	win.style.display="block";
	win.style.top=200+scrolls[1]*1+"px";
	win.style.left=(scrSizes[0]-winWidth.width)/2+"px";
	new Draggable('poolResults',{handle:'title'});
}









function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


function getSizes() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [ myWidth, myHeight ]
}