
function mx_popupImg(URL,TTL) { var inc_y = 29; var inc_x = 10; params = "top=50, left=200,width=600, height=500, Status=no, toolbar=no, menubar=no, location=no, directories=no, scrollbars=no"; popupWin = window.open("","popupWin",params); popupWin.focus(); popupWin.document.open(); popupWin.document.write("<html><"+"head><"+"title>"+TTL+"</"+"title></"+"head>"); popupWin.document.write("<sc"+"ript language = JavaScript>"); popupWin.document.write("function closeWindow(){"); popupWin.document.write("parent.window.close() };"); popupWin.document.write("</"+"script>"); popupWin.document.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' BGCOLOR='#000000'><a href='' title='"+TTL+"'><i"+"mg sr"+"c='"+URL+"' border='0' name='cha1' onClick='closeWindow();' alt='"+TTL+"'  onload='window.resizeTo(window.document.images[0].width+"+inc_x+",window.document.images[0].height+"+inc_y+")'></"+"a></"+"body></"+"html>"); popupWin.document.close(); } 


function over(id, color, menu) {
	if (id == "") {return false;}
	if (color != "") {
		document.getElementById(id).style.backgroundColor = '#'+color;
		}
	else {
		document.getElementById(id).style.backgroundColor = '';
		}
	if (menu != "no") {
		document.getElementById(id).style.cursor = 'pointer';
		}
	}
function out(id, color, menu) {
	if (id == "") {return false;}
	if (color != "") {
		document.getElementById(id).style.backgroundColor = '#'+color;
		}
	else {
		document.getElementById(id).style.backgroundColor = '';
		}
	if (menu != "no") {
		document.getElementById(id).style.cursor = '';
		}
	}


function tariffOpenClose(id) {
	if (document.getElementById(id+'_N').style.display == 'block') {
		document.getElementById(id+'_N').style.display='none'; 
		document.getElementById(id+'_Y').style.display='block'; 
		}
	else {
		document.getElementById(id+'_N').style.display='block'; 
		document.getElementById(id+'_Y').style.display='none'; 
		}
	return false;
	}


//-----------------------------------------------------------------------------------------
var FillTdMenu_Color="";
var FillTdMenu_Bg="_/bg_menu03.gif";
var FillTdSubMenu_Color="#999999";

var if_NN6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
var if_NN  = (document.layers) ? true : false;
var if_IE  = (document.all) ? true : false;
var ie = if_IE;
var active = 0;
var closeTimeout = 100;
var timerID;
var opened = -1;
var SubOpen=0;

function hideElement( elmID, overDiv )
{
  if( ie )
  {
	for( i = 0; i < document.getElementsByTagName( elmID ).length; i++ )
	{
	  obj = document.getElementsByTagName( elmID )[i];
	  if( !obj || !obj.offsetParent )
	  {
		continue;
	  }
  
	  // Find the element's offsetTop and offsetLeft relative to the BODY tag.
	  objLeft   = obj.offsetLeft;
	  objTop    = obj.offsetTop;
	  objParent = obj.offsetParent;
	  
	  while( objParent.tagName.toUpperCase() != "BODY" )
	  {
		objLeft  += objParent.offsetLeft;
		objTop   += objParent.offsetTop;
		objParent = objParent.offsetParent;
	  }
  
	  objHeight = obj.offsetHeight;
	  objWidth = obj.offsetWidth;
  
	  if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft );
	  else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop );
	  else if( overDiv.offsetTop >= ( objTop + objHeight ));
	  else if( overDiv.offsetLeft >= ( objLeft + objWidth ));
	  else
	  {
		obj.style.visibility = "hidden";
	  }
	}
  }
}
 
/*
* unhides <select> and <applet> objects (for IE only)
*/
function showElement( elmID )
{
  if( ie )
  {
//	aler.a;
	for( i = 0; i < document.getElementsByTagName( elmID ).length; i++ )
	{
	  obj = document.getElementsByTagName( elmID )[i];
	  
	  if( !obj || !obj.offsetParent )
	  {
		continue;
	  }
	
	  obj.style.visibility = "";
	}
  }
}


//-----------------------------------------------------------------------------------------
function nameIt(id)
	{
	if (if_IE)	{return eval('document.all["'+id+'"].style');}
	else		{var temp = document.getElementById(id); return temp.style;}
/*
if (if_IE)	{return eval('document.all["'+id+'"].style');}
	else		{if  (if_NN6) {var temp = document.getElementById(id); return temp.style;}
			 else return eval('document.layers["'+id+'"]');}
*/
}
//function nameImg(id,id2)
//	{
//	if (if_IE)  	{return eval('document.images["'+id2+'"]');}
//	else		{if (if_NN6) {var temp = document.getElementsByName(id2); return temp[0];}
//			 if (id) return eval('document["'+id+'"].document.images["'+id2+'"]');
//			 else return eval('document.images["'+id2+'"]');}
//	}
function nameCell(id)
	{
	if (if_IE)	{return eval('document.all["'+id+'"]');}
	else		{if  (if_NN6)  {return document.getElementById(id);}
			 else return eval('document["'+id+'"]' );}
	}
//-----------------------------------------------------------------------------------------
function closebox(num)
	{
	var did = num;
	temp = nameIt(did);
	temp.visibility = 'hidden';
	opened = -1;
	UNCOLOR(num);
	}
//-----------------------------------------------------------------------------------------
function openbox(num)
	{
	if  (num != 999)
		{
		var did = num;
		temp = nameIt(did);
		temp.visibility = 'visible';
		hideElement('SELECT', temp);
		if  (opened != -1) closebox( opened );
		opened = num;
		COLOR(num);
		}
	else	{
		closebox(opened);
		showElement('SELECT', window);
	}
	}
//-----------------------------------------------------------------------------------------
function openboxPause()
	{
	if  (!active) clearTimeout(timerID);
	active=1;
	}
function closeboxPause()
	{
	active = 0;
	timerID = setTimeout('openbox(999)', closeTimeout);
	}
//-----------------------------------------------------------------------------------------
function OPEN(n)
	{
  	if (SubOpen==n && opened != -1) {
    	openboxPause();
    }
    else {
  	  openbox(n);
  	  openboxPause();
  	  SubOpen=n;
    }
	}
function CLOSE(n)
	{
	if (!active) return;
	SubOpen=0;
	closebox(n);
	closeboxPause();
	}
//-----------------------------------------------------------------------------------------
function COLOR(n)
	{
	var temp=nameCell("COLOR"+n);
	if (temp && FillTdMenu_Color) 	{temp.bgColor=FillTdMenu_Color; temp.style.cursor = "default";}
	if (temp && FillTdMenu_Bg) 	{temp.style.backgroundImage="url("+FillTdMenu_Bg+")"; temp.style.cursor = "default";}
	}
function UNCOLOR(n)
	{
	var temp=nameCell("COLOR"+n);
	if (temp && FillTdMenu_Color) 	temp.bgColor="";
	if (temp && FillTdMenu_Bg) 	temp.style.backgroundImage="";
	}
//-----------------------------------------------------------------------------------------
function FILL(id)	{var temp = nameCell(id); temp.bgColor=FillTdSubMenu_Color; temp.style.cursor = "pointer";}
function UNFILL(id)	{var temp = nameCell(id); temp.bgColor = "";}
function GOTO(url) {document.location.href = url;}
//-----------------------------------------------------------------------------------------

