var topSubMenu = new Array();
var counterTopSubMenu = 0;
var reg_form_name = "";
var data_el_name = "";
var data_cur_year = "";
var curDivCommentOpen = 0;
var open_file_id = 0;

function setOpenFileID(inVal){ open_file_id = inVal;}

var triger_once = 0;

	function delPhoto(id)
	{
		if(!confirm('Delete this Photo?')) 
			return false; 
		else document.getElementById('pht_'+id).submit();
	}

function hideAjaxContanerPrivlad()
{
	document.getElementById('ajaxContaner').innerHTML = "";
}

function showHideBottom()
{
	return "<div style=\"padding-top:12px;\" align=\"center\"><input type=\"button\" id=\"btn-hide\" onclick=\"hideAjaxContanerPrivlad();\" value=\"HIDE\" class=\"btn5\"/></div>";
}

function enconeDoubleQuote(inText)
{
	var re = new RegExp('"',"g");
	return inText.replace(re,"&quot;");
}

function editHeadlineComments(el_id,fname)
{
	if(curDivCommentOpen>0)
	{
		alert('Please SAVE or CANCEL your last changes for comment.');
		return;
	}
	curDivCommentOpen = el_id;
	var txtObj;
	var divObj = document.getElementById('com_div_'+el_id);
	if(fname == "filecomm"){ eval("txtObj = document.headline.com_msg_"+el_id);}
	else{ eval("txtObj = document."+fname+".com_msg_"+el_id);}
	var form_addinfo = ' <input type="button" value="CANCEL" name="cancelcomment" class="btn5" onclick="cancelHeadlineComment('+el_id+',\''+fname+'\')"/>';
	//if(fname == "comments"){ form_addinfo = '';}
	var form = '<textarea name="edit_comment_body" style="width:280px;height:50px" class="b">'+txtObj.value+'</textarea><br/>' + 
			   ' <input type="button" value="SAVE COMMENT" name="editcomment" class="btn5" onclick="saveHeadlineComment('+el_id+',\''+fname+'\')"/>'+
			   form_addinfo;

	divObj.innerHTML = form;

}
function saveHeadlineComment(el_id,fname)
{
	if(fname == "filecomm")
	{
		var combody = document.forms['headline'].edit_comment_body.value;
		var post = "addcomment=2&amp;comm_id="+el_id+"&amp;comment_body="+escape(combody);
		onAjaxImport(open_file_id,post);
	}
	else
	{
		eval("cform = document."+fname);
		cform.comm_id.value = el_id;
		cform.comm_action.value = 1;
		cform.submit();
	}
}


function deleteHeadlineComment(el_id,fname)
{
	eval("cform = document."+fname);
	cform.comm_id.value = el_id;
	cform.comm_action.value = 2;
	cform.onsubmit = "";
	cform.submit();
}
function cancelHeadlineComment(el_id,fname)
{
	if(curDivCommentOpen == el_id)
	{
		var txtObj;
		eval("txtObj = document."+fname+".com_msg_"+el_id);
		var divObj = document.getElementById('com_div_'+el_id);
		var form_addinfo = '	<td style="padding-left:10px;"><a href="#" class="hu txt9">Delete</a></td>';
		if(fname == "comments"){ form_addinfo = '';}
		var form = txtObj.value+ '<br/>' +
					'<div><table cellpadding="0" cellspacing="0" class="txt5"><tr>' +
					'	<td><a href="javascript:editHeadlineComments(\''+el_id+'\',\''+fname+'\');" class="hu txt10">Edit</a></td>' +
					form_addinfo + '</tr></table></div>';
		curDivCommentOpen = 0;
		divObj.innerHTML = form;

	}
}


function contestDateCh(el, form, dlistName, inpName, btnName, hhName, mmName)
{
	//alert(el.checked);
	//return;
	//alert(form.elements.length);
	
		
	for(i=0;i<form.elements.length;i++)
	{
		if(form.elements[i].name == dlistName){ form.elements[i].disabled = el.checked;}
		else if(form.elements[i].name == inpName){ form.elements[i].disabled = !(el.checked);}
		else if(form.elements[i].name == btnName){ form.elements[i].disabled = !(el.checked);}
		else if(form.elements[i].name == hhName){ form.elements[i].disabled = !(el.checked);}
		else if(form.elements[i].name == mmName){ form.elements[i].disabled = !(el.checked);}
	}
	
	if(dlistName == 'headline_18_day' && triger_once == 0)
	{
		triger_once = 1;
		var el2 = document.forms['headline']['adm_headline_19_day_chk'];
		el2.checked = true;
		contestDateCh(el2, form, 'headline_19_day', 'adm_headline_19', 'adm_adm_headline_19_btn', 'adm_headline_19_sub1', 'adm_headline_19_sub2');
	}
}

function savePageURL()
{
	d = document;
	iTime = new Date();
	a = '<img src="/index/?savepageurl=1&f=';
	a += escape(d.location.href);
	a += "&time=";
	a += iTime.getMilliseconds();
	a += '" width="1" height="1" border="0" />';
	document.write(a);
}

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_showHideLayers()
{	//v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for(i=0; i<counterTopSubMenu; i++)
	{
		if ((obj=MM_findObj(topSubMenu[i]))!=null)
		{
			if(obj.style){ obj=obj.style;}
			obj.visibility = 'hidden';
		}
	}
	if ((obj=MM_findObj(args[0]))!=null)
	{
		if(obj.style){ obj=obj.style;}
		obj.visibility = 'visible';
	}
}


function Get_Cookie(name)
{ 
   var start = document.cookie.indexOf(name+"="); 
   var len = start+name.length+1; 
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null; 
   if (start == -1) return null; 
   var end = document.cookie.indexOf(";",len); 
   if (end == -1) end = document.cookie.length; 
   return unescape(document.cookie.substring(len,end)); 
} 

function Set_Cookie(name,value,expires,path,domain,secure) { 
    var cookieString = name + "=" +escape(value) + 
       ( (expires) ? ";expires=" + expires.toGMTString() : "") + 
       ( (path) ? ";path=" + path : "") + 
       ( (domain) ? ";domain=" + domain : "") + 
       ( (secure) ? ";secure" : ""); 
    document.cookie = cookieString; 
} 

function Delete_Cookie(name,path,domain) { 
   if (Get_Cookie(name)) document.cookie = name + "=" + 
      ( (path) ? ";path=" + path : "") + 
      ( (domain) ? ";domain=" + domain : "") + 
      ";expires=Thu, 01-Jan-70 00:00:01 GMT"; 
} 

function openNewWindow(URLtoOpen, windowName, windowFeatures)
{
	newWindow = window.open(URLtoOpen, windowName, windowFeatures);
}

function opennewwin2(win_href,win_w,win_h,is_scroll)
{
	left_pos = (screen.width - (1*win_w))/2;
	top_pos = (screen.height - (1*win_h))/2;
	set_scrollbars = "no";
	win_add_w = 0;
	if(left_pos<40)
	{
		left_pos = 40;
		win_w = screen.width-80;
		set_scrollbars = "yes";
	}
	tt_win_w = 1*win_w;
	if(top_pos<40)
	{
		top_pos = 20;
		win_h = screen.height-80;
		if(set_scrollbars == "no") tt_win_w += 18;
		set_scrollbars = "yes";
	}
	if(is_scroll==1){ set_scrollbars = "yes";}
	result = open(win_href, "displayWindow","width="+tt_win_w+",height="+win_h+",left="+left_pos+",top="+top_pos+",resizable=no,status=no,toolbar=no,menubar=no,scrollbars="+set_scrollbars);
	result.focus();
}

function useForm(obj,name)
{
	if(obj.checked == 1) document.getElementById(name).className = "on";
	else document.getElementById(name).className = "off";
}

function showForm(name, obj, linked)
{
	if(obj)
	{
		obj.style.visibility = 'hidden';
		obj.style.display = 'none';
	}
	
	if(linked)
	{
		var tmp = document.getElementById(linked);
		tmp.style.visibility = 'hidden';
		tmp.style.display = 'none';
	}
	
	var div = document.getElementById(name);
	
	if(div.filters && div.filters.length > 0) // filters exist
	{
		if (div.filters(0).status != 2)
		{
			//div.className = "abs";
  			div.filters(0).apply();
  			div.style.display = "block";
			div.style.visibility = "visible";	
			div.filters(0).play(2.0);
			//document.getElementById(name+"_").style.display = "block";
		}
		
	}
	else
	{
		div.style.display = "block";
		div.style.visibility = "visible";	
	}
}

var activForm = "";
var oldobjValue = "";
var oldobj = "";
var hidForm2 = '';

function showForm2(divID, obj)
{
	var name = "fileForm"+divID;
	var div = document.getElementById(name);
	var tmp3 = document.getElementById('mainContentDiv');
	if(isontentDivFill==0)
	{
		for(var i=1;i<=mainContentDivCounter;i++)
		{
			var tmp5 = document.getElementById("fileForm"+i);
			aMainContentDivData[i] = tmp5.innerHTML;
			tmp5.innerHTML = "";
		}
		isontentDivFill = 1;
	}

	if(activForm != "")
	{
		oldobj.value = oldobjValue;

		var div3 = document.getElementById("fileForm"+activForm);
		aMainContentDivData[activForm] = div3.innerHTML;
		div3.innerHTML = "";
		div3.style.visibility = "hidden";
		div3.style.display = "none";
		tmp3.style.height = '0px';
		if(activForm == divID)
		{
			activForm = "";
			return;
		}
	}

	oldobj = obj;
	oldobjValue = obj.value;
	obj.value = "HIDE";
	activForm = divID;

	div.innerHTML = aMainContentDivData[divID];
	div.style.display = "block";
	div.style.visibility = "visible";	
	
	tmp3.style.overflow = 'hidden';
	if(name == "fileForm2")
	{
		tmp3.style.height = '260px';
		slowAppearanceDiv('mainContentDiv',265,div.offsetHeight+10,name);
	}
	else
	{
		tmp3.style.height = '3px';
		slowAppearanceDiv('mainContentDiv',5,div.offsetHeight+10,name);
	}
	
}

function slowAppearanceDiv(objName, curHeight, maxHeight, curFormName)
{
	var tmp3 = document.getElementById(objName);
	
	if(activForm=="" || curFormName!=("fileForm"+activForm)){ return;}
	else if(curHeight+10<maxHeight)
	{
		tmp3.style.height = (curHeight+2)+'px';
		setTimeout("slowAppearanceDiv('"+objName+"',"+(curHeight+10)+","+maxHeight+",'"+curFormName+"')",50);
	}
	else
	{
		tmp3.style.height = maxHeight+'px';
	}	
}


function fback()
{
	if(history.length>0)
	{
		history.back();
		//return true;
	}
	return false;
}

	// used in "Create Group"
	function AddGroupPassword(a)
	{
		var obj = document.getElementById('pass');
		if (a == 1)	objOn(obj);
		else if (a == 2) objOff(obj);
	}
	// use for joining private group
	
	function AddGroupPasswordJoin(id,user_id)
	{
		var obj2 = document.getElementById('join_password');
		
		// if user not logged, use validation rullez of standart joinig groups (piblic) for error logging
		if (user_id == 0) {
			sendAjaxGroups(id);
		}
		// insert input tag password
		else if (!obj2) 
		{
			name = 'passGroup' + id; // element <div id="passGroup.."> 
			var obj = document.getElementById(name);
			obj.innerHTML = "Group Password:<br/><input type=\"password\" size=\"25\" name=\"join_password\" />";
		}
		else if (!obj2.value){
			alert("Enter password for joining to private group");
		}
		else {
			sendAjaxGroupPrivate(id, obj2.value);
		}
	}

	// use for joining private group
	function loadFrameMsgResult2(inDivName, id)
	{
		if(is_nav == true) 
			doc = document.getElementById('fcontaner').contentDocument;
		else 
			doc = document.frames.fcontaner.document;		
		
		if (doc.fmsg.msg.value == 'OK') go('/'+inDivName+'/'+id+'/');
		else alert(doc.fmsg.msg.value);
	}
	
	function addPrivate(groupID)
	{
		if(document.forms['passform'+groupID]['password_body'].value != "")
			sendAjaxGroupPrivate(groupID, document.forms['passform'+groupID]['password_body'].value ); 
		else 
			alert("Пустой пароль");
	}
	
	// use for joining private group
function sendAjaxGroupPrivate(id, pass)
{
	var obj = document.getElementById('syscontaner');
	//alert("src=\"/groups/"+id+"/?addtogroups=1&pass="+pass+"&private=1\"");
	//return;

	obj.innerHTML = "<iframe src=\"/groups/"+id+"/?addtogroups=1&pass="+pass+"&private=1\" "+
	"name=\"fcontaner\" id=\"fcontaner\" style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult2('groups/info',"+id+")\"></iframe>";
}

function sendAjaxGroups(id)
{
	var obj = document.getElementById('syscontaner');
	
	//obj.innerHTML = "<iframe src=\"/groups/"+id+"/?addtogroups=1\" name=\"fcontaner\" id=\"fcontaner\" style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult('')\"></iframe>";
	obj.innerHTML = "<iframe src=\"/groups/"+id+"/?addtogroups=1\" name=\"fcontaner\" id=\"fcontaner\" "+
	"style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult2('groups/info',"+id+") \"></iframe>";
}

function sendAjaxEvent(id)
{
	var obj = document.getElementById('syscontaner');
	
	//obj.innerHTML = "<iframe src=\"/groups/"+id+"/?addtogroups=1\" name=\"fcontaner\" id=\"fcontaner\" style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult('')\"></iframe>";
	obj.innerHTML = "<iframe src=\"/events/"+id+"/?addtoevents=1\" name=\"fcontaner\" id=\"fcontaner\" "+
	"style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult2('events',"+id+") \"></iframe>";
}

function sendAjaxFavorites(id)
{
	var obj = document.getElementById('syscontaner');
	obj.innerHTML = "<iframe src=\"/fview/"+id+"/?addtofavorite=1\" name=\"fcontaner\" id=\"fcontaner\" style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult('')\"></iframe>";
}

function sendAjaxFavoritesHeadlines(id)
{
	var obj = document.getElementById('syscontaner');
	obj.innerHTML = "<iframe src=\"/headline/"+id+"/?addtofavorite=1\" name=\"fcontaner\" id=\"fcontaner\" style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult('')\"></iframe>";
}

function sendAjaxFriends(id)
{
	var obj = document.getElementById('syscontaner');
	obj.innerHTML = "<iframe src=\"/people/?addtofriends=1&user_id="+id+"\" name=\"fcontaner\" id=\"fcontaner\" style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult('')\"></iframe>";
}




function sendAjaxInappropriate(id)
{
	var obj = document.getElementById('syscontaner');
	obj.innerHTML = "<iframe src=\"/fview/"+id+"/?addtoinappropriate=1\" name=\"fcontaner\" id=\"fcontaner\" style=\"width:0px;height:0px\" onload=\"loadFrameMsgResult('clipInnapropriate')\"></iframe>";
	
}

function loadFrameMsgResult(inDivName)
{
	if(is_nav == true) doc = document.getElementById('fcontaner').contentDocument;
	else doc = document.frames.fcontaner.document;		
	
	alert(doc.fmsg.msg.value);

}

function objOn(obj)
{
	try
	{
		obj.style.display = "block";
		obj.style.visibility = "visible";
	}
	catch(Exception){}
}	

function objOff(obj)
{
	try
	{
		obj.style.visibility = "hidden";
		obj.style.display = "none";
	}
	catch(Exception){}
}


    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(1*navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);


    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);

    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

    var is_webtv = (agt.indexOf("webtv") != -1); 

    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

    var is_safari = (agt.indexOf("safari") != -1);
    var is_msn = (agt.indexOf("msn") != -1);

    // *** JAVASCRIPT VERSION CHECK ***
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if (is_opera5up) is_js = 1.3;
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_hotjava3up) is_js = 1.4;
    else if (is_nav6 || is_gecko) is_js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (is_nav6up) is_js = 1.5;
    // NOTE: ie5up on mac is 1.4
    else if (is_ie5up) is_js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else is_js = 0.0;

    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    var is_win16 = ((agt.indexOf("win16")!=-1) || 
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
               (agt.indexOf("windows 16-bit")!=-1) );  

    var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));

    var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
    var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1));

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    var is_win32 = (is_win95 || is_winnt || is_win98 || 
                    ((is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

    var is_os2   = ((agt.indexOf("os/2")!=-1) || 
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||   
                    (agt.indexOf("ibm-webexplorer")!=-1));

    var is_mac    = (agt.indexOf("mac")!=-1);
    // hack ie5 js version for mac
    if (is_mac && is_ie5up) is_js = 1.4;
    var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) || 
                               (agt.indexOf("68000")!=-1)));
    var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) || 
                                (agt.indexOf("powerpc")!=-1)));

    var is_sun   = (agt.indexOf("sunos")!=-1);
    var is_sun4  = (agt.indexOf("sunos 4")!=-1);
    var is_sun5  = (agt.indexOf("sunos 5")!=-1);
    var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
    var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
    var is_irix5 = (agt.indexOf("irix 5") !=-1);
    var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    var is_hpux  = (agt.indexOf("hp-ux")!=-1);
    var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
    var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
    var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
    var is_aix1  = (agt.indexOf("aix 1") !=-1);    
    var is_aix2  = (agt.indexOf("aix 2") !=-1);    
    var is_aix3  = (agt.indexOf("aix 3") !=-1);    
    var is_aix4  = (agt.indexOf("aix 4") !=-1);    
    var is_linux = (agt.indexOf("inux")!=-1);
    var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
    var is_mpras    = (agt.indexOf("ncr")!=-1); 
    var is_reliant  = (agt.indexOf("reliantunix")!=-1);
    var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    var is_sinix = (agt.indexOf("sinix")!=-1);
    var is_freebsd = (agt.indexOf("freebsd")!=-1);
    var is_bsd = (agt.indexOf("bsd")!=-1);
    var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || 
                 is_sco ||is_unixware || is_mpras || is_reliant || 
                 is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);

    var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
    var is_macintosh = (agt.indexOf("macintosh")!=-1);

//--> end hide JavaScript



		function MM_jumpMenu(targ,selObj,restore)
		{ //v3.0
				eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
				if (restore) selObj.selectedIndex=0;
		}

var msubOpened = false;
var lastName = '';

function on_msub(name)
{
	if(lastName!='') do_out_msub(lastName);
	lastName = name;
	msubOpened = true;
	objOn(document.getElementById(name));
}

function out_msub(name)
{
	msubOpened = false;
	setTimeout('do_out_msub("'+name+'")',700);
}

function do_out_msub(name)
{
	if(msubOpened == false) objOff(document.getElementById(name));
}

function on_msub2(obj)
{
	obj.style.backgroundColor = "#999999";
	obj.style.color = "#ffffff";
}

function out_msub2(obj)
{
	obj.style.backgroundColor = "#dfe0e1";
	obj.style.color = "#11557B";
}

function objOn(obj)
{
	obj.style.display = "block";
	obj.style.visibility = "visible";
}	

function objOff(obj)
{
	obj.style.visibility = "hidden";
	obj.style.display = "none";
}

function show_bmap(name)
{
	objOn(document.getElementById(name));
}
function hide_bmap(name)
{
	objOff(document.getElementById(name));
}
function changeDivSatus(name)
{
	obj = document.getElementById(name);
	if(obj.style.visibility == 'visible')
	{
		objOff(obj);
		objImg = document.getElementById(name+'Img');
		objImg.src = '/img/site2/strelka_r.gif'
	}
	else
	{
		objOn(obj);
		objImg = document.getElementById(name+'Img');
		objImg.src = '/img/site2/strelka_d.gif'
	}
}

function shw_pop(obj,pos) {
	try
	{
		for (i=1; i<=31; i++ ) {
			
			document.getElementById('d'+i).style.visibility = 'visible';
			if ( (i != obj) && (elm=document.getElementById('pop'+i)) ) {
				elm.style.display = 'none';
			}
		}
	}
	catch(Exception){}
	
	tt = obj-1;
	ttt = obj-2;
	if (document.getElementById('pop'+obj).style.display == 'none') {
		if (pos > 5) {
			if ( tt > 0) document.getElementById('d'+tt).style.visibility = 'hidden';
			if ( ttt > 0) document.getElementById('d'+ttt).style.visibility = 'hidden';
		}
		document.getElementById('pop'+obj).style.display = 'block';
	} else {
		document.getElementById('pop'+obj).style.display = 'none';
	}
}
