function openWindowScroll(dest,name,width,height,fullscreen)
{
		var x,y;
		if(fullscreen==1) {
				width=screen.availWidth; height=screen.availHeight;
				x = 0;y = 0;}
		else {   
				x = (screen.availWidth-width)/2; y = (screen.availHeight-height)/2;}
		wnd = window.open (dest,name,"resizable=1,left="+x+",top="+y+",width="+width+", height="+height+", scrollbars=1");
		wnd.focus();
}

function OpenHelp( helpitem )
{
	wnd = window.open(helpitem, 'help', 'menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=300,height=200');
	wnd.focus();
}

function OpenGraph( graphitem )
{
	wnd = window.open(graphitem, 'Analiza tehnica', 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=1010,height=760');
	wnd.focus();
}

function ShowIndexGlobal (myIndex)
{
	var i;
	var arrayIndex = new Array();
	// use a hidden field with symbol value - qs


	arrayIndex[1] = document.getElementById('gr_index_cac');
	arrayIndex[2] = document.getElementById('gr_index_dax');
	arrayIndex[3] = document.getElementById('gr_index_ftse');
	arrayIndex[4] = document.getElementById('gr_index_500');

	for (i in arrayIndex)
	{
	 if ( arrayIndex[i] == myIndex)
	 {
		arrayIndex[i].style.display = 'block';
		
	 } else {
		arrayIndex[i].style.display = 'none';
	 }
	
	}
}

function ShowIndexEmergent (myIndex)
{
	var i;
	var arrayIndex = new Array();
	// use a hidden field with symbol value - qs


	arrayIndex[1] = document.getElementById('gr_index_bux');
	arrayIndex[2] = document.getElementById('gr_index_px');
	arrayIndex[3] = document.getElementById('gr_index_rtsi');
	arrayIndex[4] = document.getElementById('gr_index_wig');

	for (i in arrayIndex)
	{
	 if ( arrayIndex[i] == myIndex)
	 {
		arrayIndex[i].style.display = 'block';
		
	 } else {
		arrayIndex[i].style.display = 'none';
	 }
	
	}
}


function ToggleFastOrder ()
{
	divFastOrder = document.getElementById('fast_order');
	divRegularOrder = document.getElementById('regular_order');
	myLink = document.getElementById('fast_link');
	if (divFastOrder.style.display == 'block' )
	{
		divFastOrder.style.display = 'none';
		divRegularOrder.style.display = 'block';
		myLink.innerHTML = 'Ordin Rapid';
	} else {
		divFastOrder.style.display = 'block';
		divRegularOrder.style.display = 'none';
		myLink.innerHTML = 'Ordin Normal';
	}
}



var scrolling = true;
var scrolli;

function HomeScroll(offset) {
	scrolli = offset;
	scrolli  = scrolli  + scrollSpeed ;
	var div = document.getElementById("scrollNews");
	div.scrollTop = scrolli; 
	if (scrolli > div.scrollHeight - 160) 
		{
			scrolli = 0;
		}
	if ( scrolling )
	{
		t1=setTimeout("HomeScroll("+scrolli+")",100);
	}	
}

function toggleHomeScroll ()
{
	scrolling = scrolling ? false : true;

	var element = document.getElementById("toggleAnchor");
	element.innerHTML = scrolling ? 'Stop scroll' : 'Start scroll';
	
	HomeScroll(scrolli);
}

function startHomeScroll()
{
	if ( !scrolling )
	{
		scrolling = true;
		HomeScroll(scrolli);
	}
	

}
function stopHomeScroll()
{
	scrolling = false;
	//HomeScroll(scrolli);
}


var isDom = document.getElementById?true:false;
var isIE  = document.all?true:false;
var isNS4 = document.layers?true:false;
var counter = 60;
var time;

function listsTimedRefresh( listID )
{
	if ( counter >= 0 )
	{
		if ( document.getElementById( 'counterID' ) )
		{
			var value = counter;

			if ( isDom )
			{
				document.getElementById('counterID').innerHTML = value;				
			} else if ( isNS4 ) 
			{
				document.layers['counterID'].firstChild.nodeValue = value;
			}
			
			counter=counter-1;
		}

		time=setTimeout( "listsTimedRefresh(" + listID + ")", 1000 );
	}
	else
	{
		//reload
		counter = 60;
		time=setTimeout( "listsTimedRefresh(" + listID + ")", 1000 );
		RefreshLists( listID );

		
	}
	
}

function checkDays(someString, someOtherString)
{
	if ( someString != '' )
	{
		var anum=/(^\-?\d+\.?\d*$)/
		if (anum.test(someString))
			testresult=true
		else
		{
			if ( someOtherString == 'from')
			{
				alert("Verificati valoarea introdusa in campul zilei pentru startul intervalului de raportare!")
			}else
			{
				alert("Verificati valoarea introdusa in campul zilei pentru sfarsitul intervalului de raportare!")
			}
			
			testresult=false
		}
		return (testresult)
	}
	return true;
	
}


var cssmenuids=["cssmenu"]; //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1; //Offset of submenus from main menu. Default is 0 pixels.
var theCSSClassName;

function createcssmenu()
{
	for (var i=0; i<cssmenuids.length; i++)
	{
		var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul");
		for (var t=0; t<ultags.length; t++)
		{
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px";
			ultags[t].parentNode.onmouseover=function() {
				this.getElementsByTagName("ul")[0].style.visibility="visible"; 
				theCSSClassName = this.getElementsByTagName("a")[0].className; 
				this.getElementsByTagName("a")[0].className = 'topLevelSel';
			}
			ultags[t].parentNode.onmouseout=function()	{
				this.getElementsByTagName("ul")[0].style.visibility="hidden"; 
				this.getElementsByTagName("a")[0].className = theCSSClassName;
			}
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", createcssmenu, false);
else if (window.attachEvent)
	window.attachEvent("onload", createcssmenu);

function openWindow(dest,name,width,height,fullscreen)
{
	var x,y;
	if(fullscreen==1) {
			width=screen.availWidth; height=screen.availHeight;
			x = 0;y = 0;}
	else {   
			x = (screen.availWidth-width)/2; y = (screen.availHeight-height)/2;}
	wnd = window.open (dest,name,"resizable=1,left="+x+",top="+y+",width="+width+", height="+height+", scrollbars=0");
	wnd.focus();
}


function toggleFooterDetails()
{
	var detailsObj = document.getElementById('details');

	if ( detailsObj.style.display == 'block' )
	{
		detailsObj.style.display = 'none';
		detailsObj.style.visibility = 'hidden';
	}else
	{
		detailsObj.style.display = 'block';
		detailsObj.style.visibility = 'visible';
	}
}


function toggleFooterDetailsContact()
{
	var detailsObj = document.getElementById('details_contact');

	if ( detailsObj.style.display == 'block' )
	{
		detailsObj.style.display = 'none';
		detailsObj.style.visibility = 'hidden';
	}else
	{
		detailsObj.style.display = 'block';
		detailsObj.style.visibility = 'visible';
	}
}