var wndHlp;

function IsEmpty(sir)
{
	var arr = new Array();
	var i;
	if (sir.length > 0)
	{
		arr = sir.split(" ");
		for(i = 0;i <= arr.length-1;i++) if (arr[i].length > 0) return false;
	}
	return true;
}

/*function goto(EdId, URLN,URLC,Ind){
	var radio;
	radio=eval("document.forms[0].radio"+Ind);
	if(radio[0])
	{
		if(radio[0].checked) {
			if (URLN!='') document.location.href="/biblioteca/" + EdId + "/normala/" +URLN;
			else alert('Inexistent in editia normala!');
		}
	}
	if(radio[1]) 
	{
		if(radio[1].checked) {
			if (URLC!='') document.location.href="/biblioteca/" + EdId + "/critica/" + URLC;
			else alert('Inexistent in editia critica!');
		}
	}
}*/

function gotoUrl(URLN,URLC,Ind,URLBaseFolder, EdId, Normal, Critic, VolID, UserID){
	var radio;
	var PageToJump;
	radio=eval("document.forms[0].radio"+Ind);
	if (UserID=='') UserID = -1;
	if(radio[0])
	{
		if(radio[0].checked){
			PageToJump = URLBaseFolder+EdId+"/"+VolID+Normal+URLN;
			if (URLN.indexOf('NULL')==-1) document.location.href="goto.asp?PageToJump="+PageToJump+"&IDUser="+UserID+"&IDVol="+VolID;
			else alert('Inexistent in editia normala!');
		}
	}
	if(radio[1])
	{
		if(radio[1].checked){
			PageToJump = URLBaseFolder+EdId+"/"+VolID+Critic+URLC;
			if (URLC.indexOf('NULL')==-1) document.location.href= "goto.asp?PageToJump="+PageToJump+"&IDUser="+UserID+"&IDVol="+VolID;
			else alert('Inexistent in editia critica!');
		}
	}
}

function showNote(URL){
	window.open(URL, "Note","scrollbars=yes,toolbars=no,width=500,height=200");
}

function closeNote(){
	window.close();
}

function gotoFull(EdId, URLN,URLC,tipeditie){
	if (tipeditie=='N') document.location.href="/biblioteca/" + EdId + "/normala/" + URLN;
	else if (tipeditie=='C') document.location.href="/biblioteca/" + EdId + "/critica/" + URLC;
}

function helpWindow(sir){
	var bOpen;
	bOpen = (typeof(wndHlp) == 'undefined')	
	if (!bOpen) bOpen = wndHlp.closed;
	if (bOpen){
		wndHlp = window.open("help.htm#"+sir,"help","scrollbars=yes,toolbars=no,width=500,height=240,resizable=1");
	}
	else wndHlp.focus()
}