/*
	CET Virtual Library™

	Centre for Educational Technology,
	Ramat-Aviv, Israel.
	http://lib.cet.ac.il/

	MAIN.JS
*/

var winq = null
function onQuestionnaire(url)
{
	var nWidth = 578;
	var nHeight = 480;
	var nLeft = (window.screen.availWidth - nWidth) / 2
	var nTop  = (window.screen.availHeight - nHeight) / 2
	
	try
	{
		winq.focus();
	}catch(e)
	{
		winq = window.showModelessDialog(url, window, "dialogHeight: " + nHeight + "px; dialogWidth: " + 578 + "px; dialogTop: " + nTop + "px; dialogLeft: " + nLeft + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No");
	}	
}

var last_section = null
var last_arrow = null
function on_expand(el,oImg)
{
	try{
		var r = document.all(el.name)
		if ( r.style.display == 'none' )
			{
			r.style.display = "block";
			oImg.src = "/images/new/arrow_down.gif";
			}
		else
			{
				r.style.display = "none";
				oImg.src = "/images/new/arrow_rite.gif";
			}
		if ( last_section != null )
		{
			if ( last_section != r ) last_section.style.display = "none";
			if (last_arrow != oImg) last_arrow.src = "/images/new/arrow_rite.gif";
		}
		last_section = r
		last_arrow = oImg
	}catch(e){}
}

var help_win = null
function load_help (){
	
	try{
		help_win.focus()
	}catch(e){
	
		var w = 592;
		var h = 500;
		var l = (window.screen.availWidth - w) / 2
		var t  = (window.screen.availHeight - h) / 2
	
		help_win = window.open('../Help/','','height=' + h + ' ,width='+ w + ' ,left=' + l + ' ,top=' + t + ' ,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes', true)
		help_win.focus()
	}	
}

var win = null
function on_image(id)
{
	var w = 664;
	var h = 528;
	
	
	try
	{
		win.focus();
	}catch(e)
	{
		win = window.showModalDialog("imgviewl.asp?item=" + id,null,"center:yes;scroll:no;status:no;help:no;resizable:no;dialogWidth:" + w + "px;dialogHeight:" + h + "px ");
	}	
}

function opArchive(file,width,height)
 {
	def = open(file, "noname",  "scrollbars=1,width=" + width + ",height=" + height + ",status=0");
	
 }
 
 function ChangeState (obj)
//       ~~~~~~~~~~~
{
  var ObjTable = (eval("document.all." + obj));
  
  if ((ObjTable.style.display) == "none")
    (ObjTable.style.display) = "block";
      
  else if ((ObjTable.style.display) == "block")
	 (ObjTable.style.display) = "none";
}

// WHO IS THAT DARED TO HIDE THE window.location OBJECT ?????????
// ??????????????????????????????????????????????????????????????

//function location(new_loc)
//{
//window.open(new_loc);
//window.close();
////window.opener.top.location=new_loc;
//}



