// JavaScript Document

userAg=navigator.userAgent;

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
	{
	for(var i=0; i<document.images.length; i++)
		{
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
			if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
				{
				var imgID = (img.id) ? "id='" + img.id + "' " : ""
				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				var imgStyle = "display:inline-block;" + img.style.cssText
				if (img.align == "left") imgStyle = "float:left;" + imgStyle
				if (img.align == "right") imgStyle = "float:right;" + imgStyle
				if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
				img.outerHTML = strNewHTML
				i = i-1
			}
		}
	}
if(window.showHelp)
	window.attachEvent("onload", correctPNG);

//----BROWSER DETECTION----
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
function getRef(id) {
 if (isDOM){ return document.getElementById(id);}
 if (isIE4){ return document.all[id];}
 if (isNS4){ return document.layers[id];}
}
var nav=navigator.appName;
//----BROWSER DETECTION----

function ShowTree(id){
	var menu = 'nlist' + id;
	var mmenu = 'mlist' + id;

	if(getRef(menu)&&getRef(mmenu)){
		if(getRef(menu).style.display == 'none'){
			for(i=1;i<20;i++){
			if(getRef('nlist'+i) != null){
				getRef('nlist'+i).style.display = 'none';
				getRef('mlist'+i).style.display = '';
				}
			}
			getRef(menu).style.display = '';
			getRef(mmenu).style.display = 'none';
		}
		else{
			getRef(menu).style.display = 'none';
			getRef(mmenu).style.display = '';
		}
	}
}

/*function ShowTree(id){
	var menu = 'list' + id;
	var mmenu = 'mlist' + id;

	if(document.all(menu)&&document.all(mmenu)){
		if(document.all(menu).style.display == 'none'){
			for(i=1;i<20;i++){
			if(document.all('list'+i) != null){
				document.all('list'+i).style.display = 'none';
				document.all('mlist'+i).style.display = '';
				}
			}
			document.all(menu).style.display = '';
			document.all(mmenu).style.display = 'none';
		}
		else{
			document.all(menu).style.display = 'none';
			document.all(mmenu).style.display = '';
		}
	}
}*/

//----ACTIVATING FLASH-----
function flash(flash_content){
	document.write(flash_content);
	}

function flash2(w,h,url){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">'
              +'<param name="movie" value="'+url+'">'
              +'<param name=quality value=high>'
              +'<param name="wmode" value="transparent">'
              +'<embed src="'+url+'" wmode="transparent" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed>'
              +'</object>'
	          );
	}
//----ACTIVATING FLASH-----

//----FUNCTIONS----
var out = 0;
var dropstat = 0;
var set = 0;

function startdrop(id) {
if(parent.out==0){
parent.out=1;
getRef(id).style.display = 'block';}
else{
parent.out=0;
getRef(id).style.display = 'none';}
}

function showdrop(id) {
if(parent.out==1){
parent.dropstat=1;
clearTimeout(set);
getRef(id).style.display = 'block';}
}

function hidedrop(id) {
parent.dropstat = 0;
var set = setTimeout (function(){if(parent.dropstat==0){getRef(id).style.display = 'none';parent.out=0;}}, 200);
}

function cBg(obj,id) {
if(id==1){
obj.style.backgroundColor = "#dddddd";obj.style.textColor = "#FFFFFF";}
else{
obj.style.backgroundColor = "#ffffff";obj.style.Color = "#333333";}
}
//----FUNCTIONS----

//----TOTAL SPORT OVER OUT----
function tsover (obj){
	obj.style.color = "#FF7F00";
	}
function tsout (obj){
	obj.style.color = "#333333";
	}
//----TOTAL SPORT OVER OUT----

//----MENUS-----
function imenus_data0(){
this.enable_visual_design_mode = false
this.main_is_horizontal = true
this.menu_showhide_delay = 150
this.sub_expand_image = "images/arrow_sub.gif"
this.sub_expand_image_hover = "images/arrow_sub.gif"
this.sub_expand_image_width = "10"
this.sub_expand_image_height = "13"
this.sub_expand_image_offx = "0"
this.sub_expand_image_offy = "0"
//Main Menu
this.main_container_styles = "background-image:url(../images/menubar_bg.gif);"
this.main_item_styles = "color:#FFFFFF; text-align:center; font-size:12px; font-weight:bold; text-decoration:none; padding:4px 0px;"
this.main_item_hover_styles = "color:#FFFFFF;"
this.main_item_active_styles = ""
//Sub Menu
this.subs_container_styles = "background-color:#3E4F6B; border:1px solid #324158; padding:5px;"
this.subs_item_styles = "color:#FFFFFF; text-align:left; font-size:13px; font-weight:normal; text-decoration:none; padding:2px 5px; border:1px none;"
this.subs_item_hover_styles = "background-color:#50688C; color:#FFFFFF;"
this.subs_item_active_styles = ""
}
function imenus_data1(){
this.enable_visual_design_mode = false
this.main_is_horizontal = true
this.menu_showhide_delay = 150
this.sub_expand_image = "images/arrow_sub.gif"
this.sub_expand_image_hover = "images/arrow_sub.gif"
this.sub_expand_image_width = "10"
this.sub_expand_image_height = "13"
this.sub_expand_image_offx = "0"
this.sub_expand_image_offy = "0"
//Main Menu
this.main_container_styles = "background-image:url(../images/menubar_bg.gif);"
this.main_item_styles = "color:#333333; text-align:center; font-size:10px; font-weight:bold; text-decoration:none; padding:4px 0px;"
this.main_item_hover_styles = ""
this.main_item_active_styles = ""
//Sub Menu
this.subs_container_styles = "padding:0px; "
if(nav=='Opera'){this.subs_item_styles = "color:#333333; text-align:left; margin:0px; font-size:11px; font-weight:bold; text-decoration:none; padding:3px 4px; font-family:Arial,Verdana,Helvetica,sans-serif;"
}else{this.subs_item_styles = "color:#333333; text-align:left; height:19px; margin:2px; font-size:11px; font-weight:bold; text-decoration:none; padding:1px 4px; font-family:Arial,Verdana,Helvetica,sans-serif;"}
this.subs_item_hover_styles = "color:#FF7F00; background-color:#E7EBF7;"
this.subs_item_active_styles = ""
}
var a,b;
function menu_color (col1,col2) {parent.a=col1;parent.b=col2;}
function imenus_data2(){
this.enable_visual_design_mode = false
this.main_is_horizontal = true
this.menu_showhide_delay = 150
this.sub_expand_image = "images/arrow_sub.gif"
this.sub_expand_image_hover = "images/arrow_sub.gif"
this.sub_expand_image_width = "10"
this.sub_expand_image_height = "13"
this.sub_expand_image_offx = "0"
this.sub_expand_image_offy = "0"
//Main Menu
this.main_container_styles = ""
this.main_item_styles = "color:#FFFFFF; text-align:center; font-size:13px; font-weight:bold; text-decoration:none; padding:3px 0px;"
this.main_item_hover_styles = ""
this.main_item_active_styles = ""
//Sub Menu
this.subs_container_styles = "background-color:"+a+"; border:1px solid "+a+"; padding:5px; font-weight:normal;"
this.subs_item_styles = "color:#FFFFFF; text-align:left; font-size:13px; font-weight2:bold; text-decoration:none; padding:2px 5px; border:1px none; font-weight:normal;"
this.subs_item_hover_styles = "background-color:"+b+";"
this.subs_item_active_styles = ""
}


//----MENUS-----
//---Задание стиля для SELECT------------------------------------
//**** init( класс/id, размер шрифта-12-14-16, фон, толщ.бордера, цвет.бордера ) ****//
function initSelect(id ,fsize, bg, bord, bordcolor){
	if ((userAg.indexOf('IE 6') >=0 || userAg.indexOf('MSIE 7.0') >=0)){
		if(!id)id = 'select1';
		if(!bord)bord = '1';
		if(!bordcolor)bordcolor = '#CCCCCC';
		if(!bg)bg = '#FFFFFF';
		if(!fsize)fsize = '13';
		arr = document.getElementsByTagName('div');
		i=0;
		while(arr[i]){
			if((arr[i].className == id)||(arr[i].id == id)){
				divout = arr[i];
				selin = arr[i].getElementsByTagName('select')[0];
			if(selin.style.margin != "-3px 0px 0px -3px"){
				selin.style.position = "absolute";
				selin.style.margin = "-3px 0px 0px -3px";
				divout.style.border = bord+"px solid "+bordcolor;
				selin.style.backgroundColor = bg;
				selin.style.fontSize = fsize;
				if((fsize>=9)&&(fsize<=12)){
					fs = 13;
				}else{
					if((fsize>=13)&&(fsize<=15)){
						fs = 16;
					}else{
						if((fsize>=16)&&(fsize<=17)) fs = 20;
					}
				}
				hsel = Math.floor(selin.style.height.substr(0, selin.style.height.length-2)/fs)*fs;
				//buf = selin.style.height.substr(0, selin.style.height.length-2) - hsel;
				selin.style.height = hsel - (-6) + "px";
				divout.style.height = (selin.style.height.substr(0, selin.style.height.length-2) - 4) - (-2*(bord - 1));
				divout.style.width = selin.style.width.substr(0, selin.style.width.length-2) - (-2*(bord - 1));
				selin.style.width = selin.style.width.substr(0, selin.style.width.length-2) - (-4);
				selin.style.clip = "rect(3px "+(selin.style.width.substr(0, selin.style.width.length-2) - 3)+"px "+(selin.style.height.substr(0, selin.style.height.length-2) - 3)+"px 3px)";
			}
			}
		i++;
		}
	}
}
//---END Задание стиля для SELECT------------------------------------

//--- D&D скрыть/показать DIV------------------------------------
function shdd(id,act){
	if(id){
		if(document.getElementById(id+'_content').style.display == 'none'){
			//document.getElementById(id+'_ifr').style.display = '';
			document.getElementById(id+'_content').style.display = '';
			var src = document.getElementById(id+'_bsh').src;
			src = src.substring(0,src.length-5);
			document.getElementById(id+'_bsh').src = src+'0.gif';
		}else{
			//document.getElementById(id+'_ifr').style.display = 'none';
			document.getElementById(id+'_content').style.display = 'none'
			var src = document.getElementById(id+'_bsh').src;
			src = src.substring(0,src.length-5);
			document.getElementById(id+'_bsh').src = src+'1.gif';
		}
		if(act){
			document.getElementById(id+'_content').style.display = '';
			var src = document.getElementById(id+'_bsh').src;
			src = src.substring(0,src.length-5);
			document.getElementById(id+'_bsh').src = src+'0.gif';
		}
	}
}

//---END Задание стиля для SELECT------------------------------------

