function checkParameters()
{
}

function showLnks(whichLnks)
{
//	hide the previous links and bring up the new.
//  the choice is: for the homePage "HomePgLinks" 
//	and for the inner pages: "KlaliPgLinks"

	if ( currentLnks != '' )
	{
		document.getElementById(currentLnks).style.display = 'none';
	}
	document.getElementById(whichLnks).style.display = '';
	currentLnks = whichLnks;
}

function setPage(whichPg)
{
//	hide the previous words from the maslool glisha and show the new.

	if ( currentPage != '' )
	{
		document.getElementById(currentPage + 'Maslool').style.display = 'none';
		try
		{
			document.getElementById(currentPage + "Lnk").className = "progRegular";
			document.getElementById(currentPage + "Lnk").onmouseout = setProgRollover;
		}
		catch(exception){}
	}

//	show or hide אגף הגביה from the maslool?	
	if ( whichPg == 'home' )
	{
		document.getElementById('homeMasloolLnk').style.display = 'none';
		document.getElementById('homeMasloolLnkArrw').style.display = 'none';
	}
	else
	{
		document.getElementById('homeMasloolLnk').style.display = '';
		document.getElementById('homeMasloolLnkArrw').style.display = '';
	}
	
	try
	{
		document.getElementById(whichPg+ 'Maslool').style.display = '';
		document.getElementById(whichPg + "Lnk").className = "progRollover";
		document.getElementById(whichPg + "Lnk").onmouseout = '';
	}
	catch(exception){}

	currentPage = whichPg;
}

function setProgRollover()
{
	this.className = "progRegular";
}

function makeHomePg()
{
	top.document.getElementById('makeHomePageLnk').style.behavior='url(#default#homepage)';
    top.document.getElementById('makeHomePageLnk').setHomePage('http://gvia.iba.org.il/');
}

function setMenuLang(whichLang)
{
	if ( whichLang == currentMenuLang )
	{
		return;
	}
	
	var newlangObj = document.getElementsByName(whichLang);
	var lastLangObj = document.getElementsByName(currentMenuLang);
	var indxLang;
	var boolDoLink = false;
	
	document.getElementById(whichLang + "Lnk").className = "langRollover";
	document.getElementById(whichLang + "Lnk").onmouseout = '';

	if ( currentMenuLang != "" )
	{
		document.getElementById(currentMenuLang + "Lnk").className = "langRegular";
		document.getElementById(currentMenuLang + "Lnk").onmouseout = setLangRollover;
		boolDoLink = true;
	}

	currentMenuLang = whichLang;

//	only do this if it's not the first time.
//  if the surfer changed the language then try to recall the 
//	current page in the new language.

	if (boolDoLink)
	{
		try
		{
			document.getElementById(currentPage + "Lnk").click();
		}
		catch (exception) {}
	}
	
	for (indxLang = 0; indxLang < newlangObj.length; indxLang++)
	{
		// show the new language in the menu.
		newlangObj[indxLang].style.display = '';
		
		// if this language was showing already then hide it.
		if ( lastLangObj.length > 0 )
		{
			lastLangObj[indxLang].style.display = 'none';
		}
	}
}
		
function setLangRollover()
{
	this.className = "langRegular";
}

function setDirection(firstWord,whichYedia)
{
	var boolChangeDir = checkForRtl(firstWord);

	if (!boolChangeDir)
	{
		return;
	}

	// a description under a picture
	try
	{
		document.getElementById("TDdesc" + whichYedia).align = "right";
		document.getElementById("TDdesc" + whichYedia).dir = "rtl";
	}
	catch(exception){}

	// the ראשי main_title td
	try
	{
		document.getElementById("main" + whichYedia).align = "right";
		document.getElementById("main" + whichYedia).dir = "rtl";

		if (wordLang == "arabic")
		{
			document.getElementById("main" + whichYedia).style.fontSize = "17px";
			document.getElementById("main" + whichYedia).style.fontWeight = "bold";
		}
	}
	catch(exception){}
	
	// the whole yedia in general
	try
	{
		document.getElementById("yedia" + whichYedia).align = "right";
		document.getElementById("yedia" + whichYedia).dir = "rtl";
		if (wordLang == "arabic")
		{
			document.getElementById("yedia" + whichYedia).style.fontSize = "15px";
			document.getElementById("yedia" + whichYedia).style.fontWeight = "bold";
		}
	}
	catch(exception){}

	// an inner main_title td - the actual title itself
	try
	{
		document.getElementById("mainContent" + whichYedia).align = "right";
		document.getElementById("mainContent" + whichYedia).dir = "rtl";
		if (wordLang == "arabic")
		{
			document.getElementById("mainContent" + whichYedia).style.fontSize = "17px";
		}
	}
	catch(exception){}

	// the table for the picture
	try
	{
		document.getElementById("picTbl" + whichYedia).align = "left";
	}
	catch(exception){}

	// a printer icon
	try
	{
		document.getElementById("printBtn").align = "right";
	}
	catch(exception){}

	// any external links
	try
	{
	//	align the main links table
		document.getElementById("links" + whichYedia).align = "right";
		document.getElementById("links" + whichYedia).dir = "rtl";

		var mainLinkObj = document.getElementById("links" + whichYedia);
		var linksObj = mainLinkObj.getElementsByTagName("TD");
		var linkIndx;
		
	//	align the individual links as well
		for (linkIndx=0; linkIndx < linksObj.length; linkIndx++)
		{
			linksObj[linkIndx].align = "right";
		}
	}
	catch(exception){}
}

function showTfasimPage()
{
	top.document.getElementById("mainIframe").src = "gvia/html/GviaTofes-" + top.currentMenuLang + ".htm";
}

function chooseQuestion(whichOne)
{
	if ( currentQuestion != '' )
	{
		document.getElementById("Tbl" + currentQuestion).style.display='none';
		document.getElementById("lnk" + currentQuestion).className = "RolloverQue";
	}

	document.getElementById("Tbl" + whichOne).style.display='';
	document.getElementById("lnk" + whichOne).className = "currentQuestion";
	document.getElementById('divInfo').scrollTop = 0;
	top.scrollTo(0,0);
	currentQuestion = whichOne;
}

function printDiv(whichEntity,iconNm)
{
	// hide the printer icon.
	document.getElementById(iconNm).style.visibility = 'hidden';
	
	var printPath = top.frames['GviaPrintout'].document;

    // copy div to printout document
    printPath.getElementById("printContent").innerHTML = document.getElementById("divInfo").innerHTML;
    
//	print out the frame.
	top.frames['GviaPrintout'].focus();
	top.frames['GviaPrintout'].print();

	// reshow the printer icon.
	document.getElementById(iconNm).style.visibility = 'visible';
}

