// JavaScript Document
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
<!-- hide
function MM_openBrWindow(theURL,winName,features) { 
	// if object changes size, change these numbers below
	var winl = (screen.width - 779) / 2;
	var wint = (screen.height - 559) / 2;
	// if object changes size, change these numbers avove	
	// setting window props below
	features = 'height=559,width=779,top='+wint+',left='+winl+',scrollbars=0,resizable=0,location=1,statusbar=1,toolbar=1,menubar=1,'
	// setting window props above
	window.open(theURL,winName,features);
}

function winOpen(link, features)
{
	var wnd = window.open(link,null,features);
	wnd.focus();
}









/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
var hintBox

function closeAll(subobjstr)
{
	var index = subobjstr.substr(10,subobjstr.length);

	for (  var i = 1; i <= 13; i++ )
	{
		var tmpobj=document.getElementById("subcontent" + i);
		 
		if ( index != i && tmpobj)
		{	
			
			tmpobj.style.display = "none";
			
		}
	}
}

function overlay(curobj, subobjstr, opt_position)
{
	if (document.getElementById)
	{
		closeAll(subobjstr);
		
		var subobj=document.getElementById(subobjstr)
		subobj.style.display=(subobj.style.display!="block"? "block" : "none")
		
		var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("left")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) + 0 
		var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("top")!=-1)? curobj.offsetHeight : 0)-subobj.offsetHeight

		subobj.style.left=(xpos+0)+"px"
		subobj.style.top=(ypos - 10)+"px"
	//	alert(subobj.clientHeight);
		hintBox = subobj
		

		return false
	}
	else
	{
		return true
	}
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

/***********************************************
* Switch Content script II- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated April 2nd, 2005.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var memoryduration="7" //persistence in # of days

var contractsymbol='images/minus_marker.gif' //Path to image to represent contract state.
var expandsymbol='images/plus_marker.gif' //Path to image to represent expand state.

/////No need to edit beyond here //////////////////////////

function getElementbyClass(rootobj, classname){
var temparray=new Array()
var inc=0
var rootlength=rootobj.length
for (i=0; i<rootlength; i++){
if (rootobj[i].className==classname)
temparray[inc++]=rootobj[i]
}
return temparray
}

function sweeptoggle(ec){
var inc=0
while (ccollect[inc]){
ccollect[inc].style.display=(ec=="contract")? "none" : ""
inc++
}
revivestatus()
}


function expandcontent(curobj, cid){
if (ccollect.length>0){
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="none")? "none" : ""
curobj.src=(document.getElementById(cid).style.display=="none")? expandsymbol : contractsymbol
}
}

function revivecontent(){
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="none"
}

function revivestatus(){
var inc=0
while (statecollect[inc]){
if (ccollect[inc].style.display=="none")
statecollect[inc].src=expandsymbol
else
statecollect[inc].src=contractsymbol
inc++
}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="none")
selectedItem+=ccollect[inc].id+"|"
inc++
}
if (get_cookie(window.location.pathname)!=selectedItem){ //only update cookie if current states differ from cookie's
var expireDate = new Date()
expireDate.setDate(expireDate.getDate()+parseInt(memoryduration))
document.cookie = window.location.pathname+"="+selectedItem+";path=/;expires=" + expireDate.toGMTString()
}
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
var alltags=document.all? document.all : document.getElementsByTagName("*")
ccollect=getElementbyClass(alltags, "switchcontent")
statecollect=getElementbyClass(alltags, "showstate")
if (enablepersist=="on" && get_cookie(window.location.pathname)!="" && ccollect.length>0)
revivecontent()
if (ccollect.length>0 && statecollect.length>0)
revivestatus()
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate


//// added by Oleg

var menu = new Array("who_menu", "what_menu", "connect_menu", "learn_menu", "ask_menu");
var cmenu = null;
var timeon;


function menuOver(name,also)
{
//	alert(name);
	clearTimeout(timeon);
	//if(cmenu!=name && cmanu!=also)		showHideLayer(cmenu, 'hide');
	cmenu=null;
	hideAllMenus(name,also);
//	alert(name);
	showHideLayer(name, 'show');
	showHideLayer(also, 'show');
}

function menuOut(toHide,except) {
	if(toHide!=except)	cmenu=toHide;
	timeon = setTimeout("oriStatus()", 500);
}


function showHideLayer(name, status)
{
	ele = document.getElementById(name);
	if (ele !=null)
	if (ele.style)
	{
    	ele = ele.style;
    	status = (status =='show') ? 'visible' : (status=='hide') ? 'hidden' : status;
   	}
	
	if ( status == 'visible' )
	{
		d_status = 'block';
	}
	else
	{
		d_status = 'none';
	}
	
	if (ele !=null)
	ele.visibility = status;
//	ele.display = d_status;
}

function oriStatus() {
	//hideAllMenus();
	//alert(cmenu);
	if (cmenu) showHideLayer(cmenu, 'hide');
}



function hideAllMenus(except,also) {
	for (i = 0; i < menu.length; i++) {
		if (menu[i] != except && menu[i] != also) {
			showHideLayer(menu[i], 'hide');
		}
	}
	;
}


	

function showPopUp(on, name, popup) {
	clearTimeout(timeon);
	hideAllMenus(name);
	o = document.getElementById(on);
	n = document.getElementById(name);
	pp = document.getElementById(popup);
	pp.style.left = parseInt(o.style.left) + n.offsetLeft;
	pp.style.top = parseInt(o.style.top) + n.offsetTop - parseInt(pp.style.height);
	al = parseInt(pp.style.width) + parseInt(pp.style.left) - parseInt(o.style.left) - parseInt(o.offsetWidth);
	if ( parseInt(al) > 0 ) {
		pp.style.left = parseInt(pp.style.left) - parseInt(al);
	}
	pp.style.visibility = 'visible';
//	pp.style.display = 'block';
}

function restore(name, filename) {
	obj = document.getElementById(name);
	if (obj != null)
		obj.src = filename;
}

function swap(name, filename) {
	obj = document.getElementById(name);
	if (obj != null)
		obj.src = filename;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


preloadImages(
/*
	"images/btn_big_picture_on.gif",
	"images/btn_big_picture_over.gif",
	"images/btn_projects_on.gif",
	"images/btn_projects_over.gif",
	"images/btn_people_on.gif",
	"images/btn_people_over.gif",
	"images/btn_our_place_on.gif",
	"images/btn_our_place_over.gif",
	"images/btn_participate_on.gif",
	"images/btn_participate_over.gif"
*/
	); 

function topLink()
{
	var ell=document.getElementById('body');
	if(ell.scrollHeight>1000)
	{
		document.getElementById('toplink').style.display='block';
		document.getElementById('toplink2').href=document.location.protocol+"//"+document.location.hostname+document.location.pathname+"#";
		
	}
}
// -->


