function JavaTrader(symbol)
{
	var url = '../jtrader/default.asp?symbolName=' + symbol;
	popUpToolbarResizable(url,643,460);
}

function JavaTraderExtern(url, symbol)
{
	var url =url +  'jtrader/default.asp?symbolName=' + symbol;
	popUpToolbarResizable(url,643,460);
}

function JavaTraderExternDefaultLine(url, symbol, defaultLine)
{
	var url =url +  'jtrader/default.asp?symbolName=' + symbol + '&defaultLine=' + defaultLine;
	popUpToolbarResizable(url,643,460);
}

function JavaTraderExternDefaultLineBackSite(url, symbol, defaultLine, BackSite)
{
	var url =url +  'jtrader/default.asp?symbolName=' + symbol + '&defaultLine=' + defaultLine + '&BackSite=' + BackSite;
	popUpToolbarResizable(url,643,460);
}

function resizeFrame(frame)
{
if(frame.contentWindow.document.body.scrollHeight)//frame.contentWindow gets refernce to content of frame. scroolHeight get all content of body of frame
//this work in IE and Firefox. But you must set border and frameborder to 0, in your html markup
	{
	frame.style.height = frame.contentWindow.document.body.scrollHeight + 'px';
	if(frame.style.visibility == 'hidden')
		frame.style.visibility = 'visible';
	}
}

function checkTime(strTimeFromhidden, strTimeFromSelectHidden, strTimeToSelectHidden, strMinTo, strHourTo, strMinFrom, strHourFrom)
{
	var message = "Anfangszeit muss kleiner als Endzeit sein!";
	//-Time To- must be less from -Time From- options. JTimeSeries logic
	var timeFromHidden = document.getElementsByName(strTimeFromhidden);
	var timeFromSelectHidden = document.getElementsByName(strTimeFromSelectHidden);
	var timeToHidden = document.getElementsByName(strTimeToSelectHidden);
	
	var minTo = document.getElementsByName(strMinTo);
	var minToValue = minTo[0].options[minTo[0].selectedIndex].value;
	
	var hourTo = document.getElementsByName(strHourTo);
	var hourToValue = hourTo[0].options[hourTo[0].selectedIndex].value;
	
	var minFrom = document.getElementsByName(strMinFrom);
	var minFromValue = minFrom[0].options[minFrom[0].selectedIndex].value;
	
	var hourFrom = document.getElementsByName(strHourFrom);
	var hourFromValue = hourFrom[0].options[hourFrom[0].selectedIndex].value;
	
	//case when From and To date is equal except time
		
	if( ( parseInt(hourFromValue) > parseInt(hourToValue) ) || ( ( parseInt(hourFromValue) == parseInt(hourToValue) ) && ( parseInt(minFromValue) > parseInt(minToValue) )))
		{
			timeFromHidden[0].value = "T" + hourFromValue + ":" + minFromValue + ":00"//timeFromSelect[0].options[timeFromSelect[0].selectedIndex].value;
			timeFromSelectHidden[0].value = timeFromHidden[0].value;
			timeToHidden[0].value = "T" +  hourToValue + ":" + minToValue + ":00"//timeTo[0].options[timeTo[0].selectedIndex].value;
			submitForm();
		}
	else
	{
		alert(message);
		hourTo[0].selectedIndex = 0;
		minTo[0].selectedIndex = 0;
		hourFrom[0].selectedIndex = hourFrom[0].options.length - 1;
		minFrom[0].selectedIndex = 0;
	}	
}
function newPopUp(page, commandString, width, height){
//add this insted global.js 'popUp' function, because when we proceed from asp to this js function 'url' we got it without UrlEncode.
    // And then when we have in commandString character "&", we got wrong QueryString on home/_printChart.asp
    //Also if we whant to escape(url) in popUp we got error (to long string for URI)	
    var url = page + escape(commandString);
	var win=window.open(url,'','toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width='+ width +',height='+height +',resizable=no,left=10,top10');
	if (win.opener==null) win.opener=self;
	if (window.focus) win.focus();
} 
