// JavaScript Document

function correctPNG(){ // correctly handle PNG transparency in Win IE 5.5 or higher.
	if(window.showHelp){
		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
				}
			}
		}
	}

//window.attachEvent("onload", correctPNG);

/*if (window.addEventListener)
    window.addEventListener('load', function(){initAlbum()}, false);
else
    window.attachEvent('onload', function(){initAlbum()});*/

//----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 = '';
		}
	}
}

//----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=8,0,0,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-----

var urlref = '/moldova.sports/';

function imenus_data0(){
this.enable_visual_design_mode = false
this.main_is_horizontal = true
this.menu_showhide_delay = 150
this.sub_expand_image = urlref+"img/design/arrow_sub.gif"
this.sub_expand_image_hover = urlref+"img/design/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:#073885; text-align:center; font-size:12px; font-weight:bold; text-decoration:none; padding:5px 0px; background-image:url("+urlref+"img/design/mainbar_ugolok.gif); background-position:0px 0px; background-repeat:no-repeat;"
this.main_item_hover_styles = "color:#FFFFFF; background-color:#3E4F6B; background-image:url("+urlref+"img/design/mainbar_ugolok.gif); background-position:0px 0px; background-repeat:no-repeat;"
*/this.main_item_styles = "color:#073885; text-align:center; font-size:12px; font-weight:bold; text-decoration:none; padding:5px 0px;"
this.main_item_hover_styles = "color:#FFFFFF; background-color:#3E4F6B;"
this.main_item_active_styles = "background-color2:#324158;"
//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; background:none;"
this.subs_item_hover_styles = "background:none; 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 = urlref+"img/design/arrow_sub.gif"
this.sub_expand_image_hover = urlref+"img/design/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:#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((navigator.userAgent.indexOf('Opera') >=0 )||(navigator.userAgent.indexOf('Gecko') >=0 )){this.subs_item_styles = "color:#333333; text-align:left; margin:0px 2px; 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:#333333; 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 = urlref+"img/design/arrow_sub.gif"
this.sub_expand_image_hover = urlref+"img/design/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 = "";
}

	function imenus_data6(){
		this.enable_visual_design_mode = false
		this.main_is_horizontal = true
		this.menu_showhide_delay = 150
		this.sub_expand_image = urlref+"img/design/arrow_sub.gif"
		this.sub_expand_image_hover = urlref+"img/design/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:12px; font-weight:bold; text-decoration:none; padding:5px 0px; background-image:url("+urlref+"img/design/mainbar_ugolok.gif); background-position:0px 0px; background-repeat:no-repeat;"
		this.main_item_hover_styles = "color:#FFFFFF; background-color:#3E4F6B; background-image:url("+urlref+"img/design/mainbar_ugolok.gif); background-position:0px 0px; background-repeat:no-repeat;"
		this.main_item_active_styles = "background-color2:#324158;"
		//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; background:none;"
		this.subs_item_hover_styles = "background:none; background-color:#50688C; color:#FFFFFF;"
		this.subs_item_active_styles = "";
	}


//----COVER MAIN CONTENT WITH TRANSPARENT BLOCK-----
	function coverall(id, act){
		var obj = document.getElementById(id);
		if(obj.style.position != 'absolute'){
			obj.style.position = 'absolute';
			obj.style.width = '100%';
			obj.style.height = '100%';
			obj.style.left = '0px';
			obj.style.top = '0px';
			obj.style.zIndex = '10';
			var objdiv = obj.getElementsByTagName('DIV')[0];
			objdiv.style.backgroundImage = urlref+'url(img/design/spacer.gif)';
			objdiv.style.position = 'absolute';
			objdiv.style.width = '100%';
			objdiv.style.height = '100%';
			objdiv.style.left = '0px';
			objdiv.style.top = '0px';
		}
		if(act == 'show'){
			var coverarr = document.getElementsByTagName('SELECT');
			for(i=0; i<coverarr.length; i++){
				coverarr[i].style.visibility = 'hidden';
			}
			document.getElementById('imenus0').style.display = 'none';
			document.getElementById(id).style.display = '';
			document.getElementById(id).style.height = document.getElementById('pageheight').offsetTop +'px';
			correctPNG();
		}else{
			document.getElementById(id).style.display = 'none';
			document.getElementById('imenus0').style.display = '';
			var coverarr = document.getElementsByTagName('SELECT');
			for(i=0; i<coverarr.length; i++){
				coverarr[i].style.visibility = 'visible';
			}
		}
	}
	function coverallbg(){
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="coverallbg" align="top">'
			+'<param name="allowScriptAccess" value="sameDomain" />'
			+'<param name="movie" value="flash/reg_bg.swf" />'
			+'<param name="quality" value="high" />'
			+'<param name="wmode" value="transparent" />'
			+'<param name="bgcolor" value="#ffffff" />'
			+'<embed src="flash/reg_bg.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="100%" height="100%" name="coverallbg" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
			+'</object>');
	}
//----END COVER MAIN CONTENT WITH TRANSPARENT BLOCK-----

//----START AUTO RESIZE-----------------------------------
var resizeTimeout;
var mainElement;
var footElement;
function aaresizeAllmain(){
	if(!mainElement){mainElement = document.getElementById('maincontainer');}
	if(mainElement > 1270){
		mainElement.style.width = '1270px';
	}else{
		mainElement.style.width = '';
	}
}
function aaresizeAllfoot(){
	if(!footElement){footElement = document.getElementById('footer');}
	if(mainElement > 1270){
		footElement.style.width = '1270px';
	}else{
		footElement.style.width = '';
	}
}
function aaresizeAll(){
	if(!resizeTimeout){
		resizeTimeout = setTimeout(function(){
			aaresizeAllmain();
			aaresizeAllfoot();
			clearInterval(resizeTimeout);
			resizeTimeout = null;
		}, 100);
	}
}
//----END AUTO RESIZE-----------------------------------

//----VARIABLES STORAGE-----------------------------------

var storage = new Object();

//----END VARIABLES STORAGE-----------------------------------shall


function sh(id,flag){
	obj = document.getElementById(id);
	if(!eval('storage.'+flag)){
		eval('storage.'+flag+'=id');
		if(obj.style.display == 'none'){
			obj.style.display = '';
		}else{
			obj.style.display = 'none';
		}
	}else{
		if(id!=eval('storage.'+flag)){//alert(eval('storage.'+flag));
			eval('document.getElementById(storage.'+flag+').style.display = "none"');
			obj.style.display = '';
		}else{
			if(obj.style.display == 'none'){
				obj.style.display = '';
			}else{
				obj.style.display = 'none';
			}
		}
	}
}

function shs(id1,id2){
	if(document.getElementById(id1)){
		obj1 = document.getElementById(id1);
		obj1.style.display = 'none';
	}
	if(document.getElementById(id2)){
		obj2 = document.getElementById(id2);
		obj2.style.display = '';
	}
}

//----ADD FAVORITES, PRINT, MAILTO----
//bookmark
function addfav(fav){//alert(location.href);
	var url = location.href;
  var title = window.document.title;
	if (navigator.appName=='Microsoft Internet Explorer'){
		window.external.addFavorite(url, title);
	}
	else if (navigator.appName=='Netscape'){
    window.sidebar.addPanel(title,url,"");
		//alert("Hit CTRL+D to add a bookmark to this site.");
	}
}
function printp (){
	window.print();
}
//----ADD FAVORITES, PRINT, MAILTO----

//----FONT SIZE CHANGER----
function newFS(obj, id, fs){ // return newFS(this, 'newFontSize', '12');
	if(document.getElementById(id))
	var cont = document.getElementById(id);
	var arr = obj.parentNode.getElementsByTagName('IMG');
	
	//alert(arr[0].src.substring(arr[0].src.length-5,arr[0].src.length-4))
	for(var i=0; i<arr.length; i++){
		if(arr[i].src.substring(arr[i].src.length-5,arr[i].src.length-4) == 1){
			arr[i].src = arr[i].src.substring(0, arr[i].src.length-5) + '0' + arr[i].src.substring(arr[i].src.length-4, arr[i].src.length);
		}
	}
	if(obj.nodeName != 'IMG')
		obj = obj.getElementsByTagName('IMG')[0];
	obj.src = obj.src.substring(0, obj.src.length-5) + '1' + obj.src.substring(obj.src.length-4, obj.src.length);
	if(cont)cont.style.fontSize = fs+'px';
	return false;
}
//----AND FONT SIZE CHANGER----

//----non Index sports menu----
var hint;
function spmenu(obj, act){
	clearTimeout(hint);
	if(act){
		obj.getElementsByTagName('DIV')[0].style.display = 'block';
	}else{
		hint = setTimeout(function(){
			obj.getElementsByTagName('DIV')[0].style.display = 'none';
		}, 200);
		
	}
}
//----AND non Index sports menu----


