/* ======================================================================

JScript Source File -- Created with SAPIEN Technologies PrimalScript 3.0

NAME: global.js

AUTHOR: Boren , Teletrader
DATE  : 09.01.2004

COMMENT: 

========================================================================= */
var NS=false;
var MSIE=false;
browser=navigator.appName;
version=parseInt(navigator.appVersion);
if(browser=="Netscape" && version>= 3) NS=true
else
	if(browser=="Microsoft Internet Explorer" && version>= 4) MSIE=true;

function openWindow(url) 
{
	var win=window.open(url,'','toolbar=yes,status=yes,scrollbars=yes,location=yes,menubar=yes,directories=yes,width=800,height=600,resizable=yes,left=10,top=10');
	win.focus();
} 
 
function popUp(url, width, height) 
{	
	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();
} 

function  popUpFundChart(chartFile, templateName, chartName, output, symbolName, searchNames, searchSymbols, index, indexName, dateRange, DateFrom, DateTo, scaleType, FundName,  ISIN, PAGetLegenda, chartWidth, chartHeight, pageWidth, pageHeight)
{
//if we have legend for comparison data, we must change height of window
	chartFile += '?templateName=' + templateName + '&output=' + output + '&chartName=' + chartName + '&symbolName=' + symbolName + '&searchNames='+ searchNames + '&searchSymbols=' +searchSymbols+ '&index=' +index+	'&indexName=' +indexName+ '&dateRange=' +dateRange+ '&DateFrom='+ DateFrom +'&DateTo=' +DateTo+ '&scaleType='+ scaleType +'&FundName='+  FundName +'&ISIN='+ ISIN +'&PAGetLegenda='+ PAGetLegenda +'&chartWidth='+ chartWidth +'&chartHeight='+ chartHeight;
	popUpScroll(chartFile, pageWidth, pageHeight);
}

function  popUpFundChartMultipleIndexs(chartFile, templateName, chartName, output, symbolName, searchNames, searchSymbols, index, indexNames, dateRange, DateFrom, DateTo, scaleType, FundName,  ISIN, PAGetLegenda, chartWidth, chartHeight, pageWidth, pageHeight)
{
//if we have legend for comparison data, we must change height of window
	chartFile += '?templateName=' + templateName + '&output=' + output + '&chartName=' + chartName + '&symbolName=' + symbolName + '&searchNames='+ searchNames + '&searchSymbols=' +searchSymbols+ '&index=' +index+	'&indexNames=' +indexNames+ '&dateRange=' +dateRange+ '&DateFrom='+ DateFrom +'&DateTo=' +DateTo+ '&scaleType='+ scaleType +'&FundName='+  FundName +'&ISIN='+ ISIN +'&PAGetLegenda='+ PAGetLegenda +'&chartWidth='+ chartWidth +'&chartHeight='+ chartHeight;
	popUpScroll(chartFile, pageWidth, pageHeight);
}

function popUpToolbar(url, width, height) 
{
	var win=window.open(url,'','toolbar=yes,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();
} 

function popUpToolbarResizable(url, width, height) 
{
	var win=window.open(url,'','toolbar=yes,status=no,scrollbars=no,location=no,menubar=no,directories=no,width='+ width +',height='+height +',resizable=yes,left=10,top10');
	if (win.opener==null) win.opener=self;
	if (window.focus) win.focus();
} 

function popUpResizable(url, width, height) 
{
	var win=window.open(url,'','toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width='+ width +',height='+height +',resizable=yes,left=10,top10');
	if (win.opener==null) win.opener=self;
	if (window.focus) win.focus();
} 

function popUpScroll(url, width, height) 
{
	var win=window.open(url,'','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width='+ width +',height='+height +',resizable=yes,left=10,top=10');
	if (win.opener==null) win.opener=self;
	if (window.focus) win.focus();
	return win;
} 

function popUpScrollWithName(url, sname, width, height) 
{
	var win=window.open(url,sname,'toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width='+ width +',height='+height +',resizable=yes,left=10,top=10');
	//if (win.opener==null) win.opener=self;
	//if (window.focus) win.focus();
} 

function popupText(text, width, height)
{
	popUp('../home/comment.asp?text=' + escape(text), width, height);
}

function popupTextScroll(text, width, height)
{
	popUpScroll('../home/comment.asp?text=' + text, width, height);
}

function cloneWindow()
{
	openWindow(document.location.href);
}

function submitForm()
{
	document.forms[0].submit();
}

function searchOnSubmit()
{
    if((document.search.searchText.value.length < 3) 
		|| (document.search.searchText.value.search('_') != -1) 
		|| (document.search.searchText.value.search('%') != -1))
	{
        alert ("Für die Wertpapier-Suche müssen mindestens 3 Zeichen eingegeben werden.\nDie Zeichen '_', '*', '[', ']' und '%' sind nicht erlaubt.\nSuchen Sie nach einem Tickersymbol, Namen oder einer Wertpapier-Kennummer");
    	return false;	
	}
    else
	{
		return true;
	}
  
}

function searchText_OnChange()
{
	document.search.searchText.value = document.search.searchText.value.replace('*', '');
	document.search.searchText.value = document.search.searchText.value.replace('[', '');
	document.search.searchText.value = document.search.searchText.value.replace(']', '');
}

function closePortfolioPopUp(portfolioID)
{
	self.opener.location.href = '../portfolio/depot.asp?PortfolioID=' + portfolioID;
	self.close();
}

function closePortfolioDoublePopUp(portfolioID)
{
	self.opener.self.opener.location.href = '../portfolio/depot.asp?PortfolioID=' + portfolioID;
	self.opener.close();
	self.close();
}

function showHideLayers() 
{ 
//v3.0
//updated for netscape 6.* by terza, Dec.2001.
  	var i,p,v,obj,args=showHideLayers.arguments;
  	for (i=0; i<(args.length-2); i+=3)
  	{ 
	  	if ((obj=MM_findObj(args[i]))==null) 
		{ 
			obj=document.getElementById(args[i]);
		}
		if (obj!=null)
		{
			v=args[i+2];
		   	if (obj.style) 
			{ 
				obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; 
			}
		    obj.visibility=v; 
		}
	}				
}

function MM_findObj(n, d) { //v3.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); return x;
}

function addTimeSignal(NotifyType, title, ID) 
{
	popUp('../factsheet/notification_time_edit.asp?action=add&NotifyType='+ NotifyType +'&SymbolName='+ title +'&ID='+ID +'&opener=admin', 520, 125)
}


  function openElba(queryString)
  {
  	var win=window.open('../ELBA/elba.asp?' + queryString,'meinraiffeisenat','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=800,height=600,resizable=yes,left=10,top=10');
	if (win.opener==null) win.opener=self;
	if (window.focus) win.focus();
  }
