var Location = top.location.href;
var HistoryIndex = 0;
var DocumentHistory = new Array();
var ShowTags = true;
var wholePage;
/*
function GetTime(diff,ora,minutul) {
				var dt = new Date();
				var def = dt.getTimezoneOffset()/60;
				//var gmt = (dt.getHours() + def);
				var gmt=ora;
				//var ending = ":" + IfZero(dt.getMinutes()) + ":" +  IfZero(dt.getSeconds());
				var ending = ":" + IfZero(minutul);
				var min=minutul;
				//alert(gmt+""+ending);
				//var ending=ora;
				//alert(ora_server);
				var buc =check24(((gmt + 3) > 24) ? ((gmt + 3) - 24) : (gmt + 3));
				//alert(gmt + 3);
				if (document.layers) {
					document.layers.pendule.document.write((IfZero(buc) + ending));
					document.layers.pendule.document.close();
				}
				else if ( document.getElementById( 'pendule' ) )
				{
					document.getElementById( 'pendule' ).innerHTML = IfZero(buc) + ending;
				}
				else
					if (document.all)
						pendule.innerHTML = (IfZero(buc) + ending);

				var paris =check24(((gmt + 3+diff) > 24) ? ((gmt + 3+diff) - 24) : (gmt +3+ diff));
				if (document.layers) {
					document.layers.pendule1.document.write((IfZero(paris) + ending));
					document.layers.pendule1.document.close();
				} else if ( document.getElementById( 'pendule1' ) )
				{
					document.getElementById( 'pendule1' ).innerHTML = (IfZero(paris) + ending);
				}
				else
					if (document.all)
						pendule1.innerHTML = (IfZero(paris) + ending);
				//alert(diff);
				//alert(diff+","+gmt+","+min);
				//setTimeout("GetTime("+diff+","+gmt+","+min+")", 1000);
			}
			function IfZero(num) {
				return ((num <= 9) ? ("0" + num) : num);
			}
			function check24(hour) {
				return (hour >= 24) ? hour - 24 : hour;
			}
*/

function GetTime(diff,ora,minutul) {
	var dt = new Date();
	dt.setHours(check24(ora+3));
	dt.setMinutes(minutul);
	document.getElementById('pendule').innerHTML = IfZero(dt.getHours()) + ':' + IfZero(dt.getMinutes());
	
	var utm = dt.getTime();
	utm += diff * 3600000;
	dt.setTime(utm);
	document.getElementById('pendule1').innerHTML = IfZero(dt.getHours()) + ':' + IfZero(dt.getMinutes());
}
function IfZero(num) {
	return ((num <= 9) ? ("0" + num) : num);
}
function check24(hour) {
	return (hour >= 24) ? hour - 24 : hour;
}
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.0
  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 && document.getElementById) x=document.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];}
}

function getValue(url, key)
	{
		goodvalue = 1;
		good = new String(url.split('?')[1]);
		for (i=0; i<good.split("&").length; i++)
			{
				if (good.split("&")[i]==undefined) return 0;
				else
					if (good.split("&")[i].split("=")[0] == key)
					{
						value = unescape(good.split("&")[i].split("=")[1]); 
						goodvalue = value.indexOf('#')>-1 ? value.split('#')[0] : value;
					}
			}
		return goodvalue;
	}
	
function getURL(url)
{
return url.split("?")[0];
}	

function isQuery(url,key)
	{
		return (url.indexOf(key) >= 0? true : false);
	}

function query(url)
{
return url.indexOf("?") >= 0;
}


var last_url='';
function getDocument( id )
{
	return true;

	if ( parent.window._PAGE || top.window._PAGE )
	{
		return true;
	}
	

	ifr = frames[0];
	
	if ( ifr )
	{
		if ( document.all )
		{
			document.all.loading.style.display = 'block';
			document.all.page_content.style.display = 'none';		
			DocumentHistory[HistoryIndex] = document.all.page_content.innerHTML;
		}
		else
		{
			document.getElementById( 'loading' ).style.display = 'block';
			document.getElementById( 'page_content' ).style.display = 'none';
			DocumentHistory[HistoryIndex] = document.getElementById( 'page_content' ).innerHTML;

		}
			HistoryIndex++;
			//alert(getURL( Location ) + "?lang=" + getValue( Location, 'lang' ) + "&id=" + getValue( Location, 'id' ) + '&show=' + id);
			frames[0].window.location.href = getURL( Location ) + "?lang=" + getValue( Location, 'lang' ) + "&id=" + getValue( Location, 'id' ) + '&show=' + id ;
	}
	else
	{
		//alert(getURL( Location ) + "?lang=" +getValue( Location, 'lang' ) + "&id=" + id);
		top.document.location.href = getURL( Location ) + "?lang=" +getValue( Location, 'lang' ) + "&id=" + id ;
	}
	
	//showBack();
	return false;
}
/*
function showBack()
{
			if ( document.all )
			{}
			else
			{
				commands = document.getElementById( 'commands' );
				back_link_js = document.getElementById( 'back_link_js' );
			}
    if ( HistoryIndex || historyPrevious.indexOf( domainURL ) )
    {
    	if ( HistoryIndex )
    	{
	    	back_link_js.onclick = 'swapContent();return false;';
	    	if ( document.all ) back_link_js.onfocus = 'swapContent();return false;';
    	}
    	else
    	{
    		back_link_js.onclick = 'history.go(-1);return false;';
    		if ( document.all ) back_link_js.onfocus = 'document.location.href=historyPrevious;return false;';
    	}
    	commands.style.display = 'block';	
    }
    else
    {
    	
    }
}
*/
function swapContent()
{
	if ( document.all ) //ie
	{
		p = document.all;
		divList = p.page_content;
		divContent = p.alt_content;
		spanCommands = p.commands;
	}
	else//W3C DOM compliant
	{
		divList = document.getElementById( 'page_content' );
		divContent = document.getElementById( 'alt_content' );	
		spanCommands = document.getElementById( 'commands' );
	}
	
	divList.innerHTML = DocumentHistory[HistoryIndex-1];
	HistoryIndex--;
	divList.style.display = 'block';
	divContent.style.display = 'none';
	//showBack();
	return false;
}

function showPage ( pageNumber )
{
	if ( document.all )
	{
	
	}
	else
	{
		i =0;
		while ( altPage = document.getElementById( 'Page_' + i ) )
		{
			if ( i != pageNumber )
				altpage.style.display = 'none';
			else
				altPage.style.display = 'block';
		}
	}
}

function hide_graph()
{
	if ( !ShowTags )
	{
		document.location.reload();
		wholePage = '';
		return;
	}

	if ( document.all ) doc = document.body;
	else doc = document;

	if ( ShowTags )
	{
		ShowTags = false;
		show = 'none';
		if ( document.all ) {}
		else page_content = document.getElementById( 'page_content' );
		wholePage = document.body.innerHTML;
		document.body.innerHTML = page_content.innerHTML;
	}

	res = doc.getElementsByTagName( 'img' );
	for( i=0; i<res.length; i++ )
		res[i].style.display = show;

document.body.innerHTML = '<BR/>&nbsp;<a href="#" onclick="hide_graph();"><b><font color="#C77A4B">Inapoi</font></b></a><img src="images/dot.gif" width="502" height="8"><a href="#" onclick="print();"><b><font color="#C77A4B">Print&nbsp;&nbsp;<img src="images/impri.gif" border="0"></font></b></a>' + document.body.innerHTML;
}