// JavaScript Document


// Dokument höhe
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

function getWinHeight() {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}

function getDocWidth() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollWidth, D.documentElement.scrollWidth),
        Math.max(D.body.offsetWidth, D.documentElement.offsetWidth),
        Math.max(D.body.clientWidth, D.documentElement.clientWidth)
    );
}

function get(id) { 
     return document.getElementById(id); 
} 

function loadScript(scriptname) {  
  var snode = document.createElement('script'); 
  snode.setAttribute('language','javascript');
  snode.setAttribute('type','text/javascript');  
  snode.setAttribute('src',scriptname);  
  document.getElementsByTagName('head')[0].appendChild(snode);  
}  

function loadfile(filename, filetype){
 if (filetype=="js")
 {
  var myelement=document.createElement('script');
  myelement.type="text/javascript";
  myelement.src=filename;
  alert('aasdf')
 }
 else if (filetype=="css")
 {
  var myelement=document.createElement("link");
  myelement.rel="stylesheet";
  myelement.type="text/css";
  myelement.href=filename;
 }
 if (typeof myelement!="undefined")
  document.getElementsByTagName("head")[0].appendChild(myelement);
}

function nachladen(scriptname)
	{
		$.getScript(scriptname);
		//alert('asdfasdf')
	}

function loadGMaps() {
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.src = 'scripts/google_map.js'
  //script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
  //script.src = "http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA3fH4FWDyxjpz7IqXP6JQ6BQnJo66PDnN9TdnlqI2qpX1qUF_4xQEaRcGtOSdXIN5YKhCrrb1vyULyQ";
  document.body.appendChild(script);
}
var doc_w=0;

function set_center()
	{
		elem=get('main_stage')
		w=getDocWidth()
		if (w>screen.width)
			{
				if(doc_w>0)
					{
						w=doc_w;
					}
					else
					{
						w=screen.width
					}
			}
			else
			{
				doc_w=w
			}
		l=(w-900)/2
		if (l<=0)
			{
				l=0
			}
		elem.style.marginLeft='0px'
		elem.style.left=l+'px'
	}
window.onresize = function(event) {
    set_center()
}
function init()
	{
		set_center()
		h=location.hash;
		h=h.replace('#','');
		if(h!='')
			{
				url='content.asp?h='+h+'&r='+Math.random();
			}
			else
			{
				url='content.asp?nid=1&r='+Math.random();
			}
		get('cmd').src=url;
		NFInit();
	}

function init_go(url)
	{
		goto(url)
		NFInit();
	}
// Gehe zu seite
function goto(url)
	{
	window.scrollTo(0, 0);
	get('content').innerHTML='<img src="img/gui/loader_blau.gif" id="loader_img" />';
	get('q').value='';
	suche_aus();
	if (url.indexOf('?')>-1)
		{
			url=url+'&r='+Math.random()
		}
		else
		{
			url=url+'?r='+Math.random()
		}
		get('cmd').src=url
	}

// top navi
function top_click(id)
	{
		// alle aktiven deaktivieren
		if(aktive_ebene_1!='')
			{
				elem=get(aktive_ebene_1);
				elem.style.backgroundColor='#FFFFFF';
				var n = get('main_navi').getElementsByTagName('div');
				for (var i=0;i<n.length;i++) 
					{
						if(n[i].id.indexOf('navi_'+aktive_id_1)>-1)
							{
								elem=get(n[i].id);
								elem.style.visibility='hidden';
								elem.style.display='none';
							}
					}
				aktive_ebene_1='';
			}
		if(aktive_ebene_2!='')
			{
				elem=get(aktive_ebene_2);
				elem.style.backgroundColor='#FFFFFF';
				var n = get('main_navi').getElementsByTagName('div');
				for (var i=0;i<n.length;i++) 
					{
						if(n[i].id.indexOf('navi_'+aktive_id_2)>-1)
							{
								elem=get(n[i].id);
								elem.style.visibility='hidden';
								elem.style.display='none';
							}
					}
				aktive_ebene_2='';
			}
		if(aktive_ebene_3!='')
			{
				elem=get(aktive_ebene_3);
				elem.style.backgroundColor='#FFFFFF';
				aktive_ebene_3='';
			}
		goto('content.asp?nid='+id+'&r='+Math.random())
	}

// navigation
aktive_ebene_1=''
aktive_ebene_2=''
aktive_ebene_3=''

function ebene_1_over(id)
	{
		elem=get(id);
		elem.style.backgroundColor='#CCDAE5';
	}

function ebene_1_out(id)
	{
		if(id!=aktive_ebene_1)
			{
				elem=get(id);
				elem.style.backgroundColor='#FFFFFF';
			}
	}

function ebene_1_click(nid,pid,laden)
	{
		window.scrollTo(0, 0);
		if (laden=='Y')
			{
				get('content').innerHTML='<img src="img/gui/loader_blau.gif" id="loader_img" />';
				goto('content.asp?nid='+nid+'&r='+Math.random())
			}
		get('q').value='';
		suche_aus();
		id='navi_'+pid+'_'+nid;
		if(aktive_ebene_1!='')
			{
				elem=get(aktive_ebene_1);
				elem.style.backgroundColor='#FFFFFF';
				var n = get('main_navi').getElementsByTagName('div');
				for (var i=0;i<n.length;i++) 
					{
						if(n[i].id.indexOf('navi_'+aktive_id_1)>-1)
							{
								elem=get(n[i].id);
								elem.style.visibility='hidden';
								elem.style.display='none';
							}
					}
			}
		if(aktive_ebene_2!='')
			{
				elem=get(aktive_ebene_2);
				elem.style.backgroundColor='#FFFFFF';
				var n = get('main_navi').getElementsByTagName('div');
				for (var i=0;i<n.length;i++) 
					{
						if(n[i].id.indexOf('navi_'+aktive_id_2)>-1)
							{
								elem=get(n[i].id);
								elem.style.visibility='hidden';
								elem.style.display='none';
							}
					}
				aktive_ebene_2='';
			}
		if(aktive_ebene_3!='')
			{
				elem=get(aktive_ebene_3);
				elem.style.backgroundColor='#FFFFFF';
				aktive_ebene_3='';
			}
			
		elem=get(id);
		elem.style.backgroundColor='#CCDAE5';
		var n = get('main_navi').getElementsByTagName('div');
		for (var i=0;i<n.length;i++) 
			{
				if(n[i].id.indexOf('navi_'+nid)>-1 && n[i].className.indexOf('n_h')==-1)
					{
						elem=get(n[i].id);
						elem.style.visibility='visible';
						elem.style.display='block';
					}
			}
		aktive_ebene_1=id
		aktive_id_1=nid;
	}

function ebene_2_click(nid,pid,laden)
	{
		window.scrollTo(0, 0);
		if (laden=='Y')
			{
				get('content').innerHTML='<img src="img/gui/loader_blau.gif" id="loader_img" />';
				goto('content.asp?nid='+nid+'&r='+Math.random())
			}
		get('q').value='';
		suche_aus();
		id='navi_'+pid+'_'+nid;
		if(aktive_ebene_2!='')
			{
				elem=get(aktive_ebene_2);
				elem.style.backgroundColor='#FFFFFF';
				var n = get('main_navi').getElementsByTagName('div');
				for (var i=0;i<n.length;i++) 
					{
						if(n[i].id.indexOf('navi_'+aktive_id_2)>-1)
							{
								elem=get(n[i].id);
								elem.style.visibility='hidden';
								elem.style.display='none';
							}
					}
				
				if(aktive_ebene_3!='')
					{
						elem=get(aktive_ebene_3);
						elem.style.backgroundColor='#FFFFFF';
						aktive_ebene_3='';
					}
			}
			
		elem=get(id);
		elem.style.backgroundColor='#CCDAE5';
		var n = get('main_navi').getElementsByTagName('div');
		for (var i=0;i<n.length;i++) 
			{
				if(n[i].id.indexOf('navi_'+nid)>-1 && n[i].className.indexOf('n_h')==-1)
					{
						elem=get(n[i].id);
						elem.style.visibility='visible';
						elem.style.display='block';
					}
			}
		aktive_ebene_2=id
		aktive_id_2=nid;
	}

function ebene_2_over(id)
	{
		if(id!=aktive_ebene_2)
			{
				elem=get(id);
				elem.style.backgroundColor='#E5E5E5';
			}
	}

function ebene_2_out(id)
	{
		if(id!=aktive_ebene_2)
			{
				elem=get(id);
				elem.style.backgroundColor='#FFFFFF';
			}
	}

function ebene_3_over(id)
	{
		if(id!=aktive_ebene_3)
			{
				elem=get(id);
				elem.style.backgroundColor='#E5E5E5';
			}
	}

function ebene_3_out(id)
	{
		if(id!=aktive_ebene_3)
			{
				elem=get(id);
				elem.style.backgroundColor='#FFFFFF';
			}
	}

function ebene_3_click(nid,pid,laden)
	{
		window.scrollTo(0, 0);
		if (laden=='Y')
			{
				get('content').innerHTML='<img src="img/gui/loader_blau.gif" id="loader_img" />';
				goto('content.asp?nid='+nid+'&r='+Math.random())
			}
		get('q').value='';
		suche_aus();
		id='navi_'+pid+'_'+nid;
		//alert(id)
		if(aktive_ebene_3!='')
			{
				elem=get(aktive_ebene_3);
				elem.style.backgroundColor='#FFFFFF';
			}
		elem=get(id);
		elem.style.backgroundColor='#CCDAE5';
		aktive_ebene_3=id
		aktive_id_3=nid
	}

function remove_h(nid,pid)
	{
		id='navi_'+pid+'_'+nid;
		if(get(id))
			{
				klasse=get(id).className;
				klasse=klasse.replace('n_h','');
				elem=get(id)
				elem.className=klasse;
				elem.style.visibility='visible';
				elem.style.display='block';
			}
	}

// Windwos 7 Navi
aktiver_pfad=''
function pi_over(id)
	{
		get('pfad_'+id).style.color='#000000';
	}
function pi_out(id)
	{
		get('pfad_'+id).style.color='#999999';
		if(get('pfad_sub_'+id))
			{
				get('pfad_sub_'+id).style.visibility='hidden';
			}
	}
function pi_click(id)
	{
		get('pfad_sub_'+id).style.visibility='visible';
		aktiver_pfad=id;
	}
	
function sub_out(id)
	{
		get('pfad_sub_'+id).style.visibility='hidden';
	}
function sub_over(id)
	{
		get('pfad_sub_'+id).style.visibility='visible';
	}

function sub_i_over(id, pid)
	{
		get('pfad_sub_'+pid).style.visibility='visible';
		get('sub_item_'+id).style.backgroundColor='#E5E5E5'
	}

function sub_i_out(id, pid)
	{
		get('sub_item_'+id).style.backgroundColor='#FFFFFF'
	}

function sub_i_click(id, pid, e)
	{
		get('sub_item_'+id).style.backgroundColor='#FFFFFF';
		get('pfad_sub_'+pid).style.visibility='hidden';
		get('pfad_sub_'+pid).style.display='none';
		switch (e)
		{
			case '1':
				ebene_1_click(id,pid,'Y');
				break;
			case '2':
				ebene_2_click(id,pid,'Y');
				break;
			case '3':
				ebene_3_click(id,pid,'Y');
				break;
			case '4':
				fond_click(id,'Y')
		}

	}

// fonds und charts --------------------------------------------------------
aktiver_fond=''
function fond_over(id)
	{
		elem=get(id);
		elem.style.backgroundColor='#E5E5E5';
	}

function fond_out(id)
	{
		elem=get(id);
		elem.style.backgroundColor='#FFFFFF';
	}

function fond_click(id,laden)
	{
		window.scrollTo(0, 0);
		hide_tooltip()
		if(laden=='Y')
			{
				get('content').innerHTML='<img src="img/gui/loader_blau.gif" id="loader_img" />';
				get('cmd').src='fonds_detail.asp?fid='+id+'&r='+Math.random();
			}
		if(aktive_ebene_2!='')
			{
				elem=get(aktive_ebene_2);
				elem.style.backgroundColor='#FFFFFF';
			}
		elem=get('navi_18_fond_'+id);
		elem.style.backgroundColor='#E5E5E5';
		aktive_ebene_2='navi_18_fond_'+id;
		aktive_id_2=18;
	}


var data = [];
var alreadyFetched = {};
var colors=''

function chart_overview()
	{
		var n = get('content').getElementsByTagName('div');
		for (var i=0;i<n.length;i++) 
			{
				if(n[i].id.indexOf('chart_')>-1)
					{
						fond_id=n[i].id.replace('chart_','')
						elem=get(n[i].id);
						chart_zeichnen('scripts/get_fond_daten.asp?laden=fond&id='+fond_id+'&int=j&r='+Math.random(),n[i].id);
						//chart_zeichnen('scripts/get_fond_daten.asp?laden=index&id='+fond_id+'&r='+Math.random(),n[i].id);
					}
			}
	}

function chart_zeichnen(datei,div_id) {
    
	var data = [];
    var placeholder = $('#'+div_id);

	var alreadyFetched = {};

	var options = {
		legend: {show: false},
        lines: { 
			show: true,
			lineWidth: 1
			 },
        points: { show: false },
        xaxis: { tickDecimals: 0, tickSize: 1 },
		grid: {
			show: false,
			aboveData: false,
			//color: color
			backgroundColor: { colors: ["#ffffff", "#EEEEEE"] },
			//tickColor: color
			//labelMargin: number
			//markings: array of markings or (fn: axes -> array of markings) 
			borderWidth: 1,
			borderColor: '#00487D',
			clickable: false,
			hoverable: false,
			autoHighlight: true,
			mouseActiveRadius: 5
		  },
		colors: [ '#00487D', '#000000' ]
    };
			
	// find the URL in the link right next to us 
	var dataurl = datei;

	// then fetch the data with jQuery
	function onDataReceived(series) {
		// extract the first coordinate pair so you can see that
		// data is now an ordinary Javascript object
		var firstcoordinate = '(' + series.data[0][0] + ', ' + series.data[0][1] + ')';

	   // button.siblings('span').text('Fetched ' + series.label + ', first point: ' + firstcoordinate);

		// let's add it to our current data
		 data.push(series);
		
		// and plot all we got
		$.plot(placeholder, data, options);
	 }
			
	$.ajax({
		url: dataurl,
		method: 'GET',
		dataType: 'json',
		success: onDataReceived
	});
	
}


function format_date(datum)
	{
		var d = datum.split ('.');
		var neu=''
		for (var i = 0; i < d.length; i++)
			{
				
				if(neu=='')
					{
						neu=d[i]
					}
					else
					{
						neu=d[i]+'/'+neu
					}
			}
		return neu;
	}

var DateDiff = {
 
    inDays: function(d1, d2) {
        var t2 = d2.getTime();
        var t1 = d1.getTime();
 
        return parseInt((t2-t1)/(24*3600*1000));
    },
 
    inWeeks: function(d1, d2) {
        var t2 = d2.getTime();
        var t1 = d1.getTime();
 
        return parseInt((t2-t1)/(24*3600*1000*7));
    },
 
    inMonths: function(d1, d2) {
        var d1Y = d1.getFullYear();
        var d2Y = d2.getFullYear();
        var d1M = d1.getMonth();
        var d2M = d2.getMonth();
 
        return (d2M+12*d2Y)-(d1M+12*d1Y);
    },
 
    inYears: function(d1, d2) {
        return d2.getFullYear()-d1.getFullYear();
    }
}

function zr_blur(id)
	{
		if(get(id).value=='')
			{
				get(id).value='TT.MM.JJJJ'
			}
	}

function zr_focus(id)
	{
		if(get(id).value=='TT.MM.JJJJ')
			{
				get(id).value=''
			}
	}

function set_zr(fond_id,fond_typ)
	{
		von=get('von').value
		bis=get('bis').value
		
		if(von=='' || bis=='' || von=='TT.MM.JJJJ' || bis=='TT.MM.JJJJ')
			{
				msg_titel='Fehler';
				msg_text='Bitte geben Sie gültie von / bis Daten an.';
				open_msg(msg_titel,msg_text,'Alert48.gif');
			}
			else
			{
				plot_fond_chart(fond_id,fond_typ,'',von,bis,'p')
			}
		// farbe
		
	}

var time_format=''
function plot_fond_chart(fond_id,fond_typ,zr,von,bis,einheit)
	{
		data = [];
		alreadyFetched = {};
		
		//von='11.10.2008'
		//bis='22.5.2010'
		von_str=''
		bis_str=''
		
		// farben von zr_
		if (zr!='')
			{
				get('zr_0').style.color='#333333';
				get('zr_12').style.color='#333333';
				get('zr_36').style.color='#333333';
				get('zr_60').style.color='#333333';
				get('zr_max').style.color='#333333';
				get('zr_'+zr).style.color='#00487C';
			}
			else
			{
				if(von=='' && bis=='')
					{
						get('zr_max').style.color='#00487C';
					}
			}
		
		if(von!='' && bis!='' && zr=='')
			{
				
				von_str=von
				bis_str=bis
				
				von=format_date(von);
				bis=format_date(bis);
				
				//var v=new Date(von);
				//var b=new Date(bis);
				//var monate = b.getMonth()-v.getMonth();
				//var zr = ((b.getYear()-v.getYear())*12)+monate;
			}
		if (zr=='' && von!='' && bis!='')
			{
				s1=von
				s1=format_date(s1)
				s2=bis
				s2=format_date(s2)
				d1=new Date(s1);
				d2=new Date(s2);
				zr2=DateDiff.inMonths(d1, d2)
				if(zr2>24)
					{
						time_format='%y'
					}
					else
					{
						if(zr2<=1)
							{
								time_format='%d.%m.%y'
							}
							else
							{
								time_format='%m.%y'
							}
					}
			}
			
		if (zr!='')
			{
				if(zr>24)
					{
						time_format='%y'
					}
					else
					{
						if(zr<=1)
							{
								time_format='%d.%m.%y'
							}
							else
							{
								time_format='%m.%y'
							}
					}
			}
		
		detail_chart_optionen(zr)
		div_id='fond_chart_'+fond_id
		//get(div_id).innerHTML='';
		detail_chart_zeichnen('scripts/get_fond_daten.asp?laden=fond&id='+fond_id+'&zr='+zr+'&von='+von_str+'&bis='+bis_str+'&einheit='+einheit+'&r='+Math.random(),div_id);
		if(fond_typ=='1')
			{
				detail_chart_zeichnen('scripts/get_fond_daten.asp?laden=index&id='+fond_id+'&zr='+zr+'&von='+von_str+'&bis='+bis_str+'&einheit='+einheit+'&r='+Math.random(),div_id);
			}
	}


function detail_chart_optionen(zr)
	{
			if(time_format=='')
				{
					//time_format="%d.%m.%y" 
				}
			options = {
				legend: {show: false},
				lines: { 
					show: true,
					lineWidth: 1
					 },
				points: { show: false },
				xaxis:{ 
						mode: "time", 
						//minTickSize: [1, "day"]
						//timeformat: "%d.%m.%y" 
						minTickSize: [7, "day"],
						timeformat: time_format 
					},
				grid: {
					show: true,
					aboveData: false,
					//color: color
					backgroundColor: { colors: ["#ffffff", "#EEEEEE"] },
					borderWidth: 1,
					borderColor: '#00487D',
					clickable: false,
					hoverable: true,
					autoHighlight: true,
					mouseActiveRadius: 5
				  }
		}
	}

function detail_chart_zeichnen(datei,div_id) {


// find the URL in the link right next to us 
	var dataurl = datei;
	
	var placeholder = $('#'+div_id);

	// then fetch the data with jQuery
	function onDataReceived(series) {
		// extract the first coordinate pair so you can see that
		// data is now an ordinary Javascript object
		var firstcoordinate = '(' + series.data[0][0] + ', ' + series.data[0][1] + ')';

	   // button.siblings('span').text('Fetched ' + series.label + ', first point: ' + firstcoordinate);

		// let's add it to our current data
		 data.push(series);
		
		// and plot all we got
		$.plot(placeholder, data, options);
	 }
			
	$.ajax({
		url: dataurl,
		method: 'GET',
		dataType: 'json',
		success: onDataReceived
	});
	
	var previousPoint = null;
	$(placeholder).bind("plothover", function (event, pos, item) {
		$("#x").text(pos.x.toFixed(2));
		$("#y").text(pos.y.toFixed(2));
 
			if (item) {
				if (previousPoint != item.datapoint) {
					previousPoint = item.datapoint;
					
					$("#tooltip").remove();
					var x = item.datapoint[0].toFixed(0),
						y = item.datapoint[1].toFixed(1);
					
					zeit=new Date();
					zeit.setTime(x)
					jahr=zeit.getFullYear();
					monat=zeit.getMonth()+1;
					tag=zeit.getDate();
					datum=tag+'.'+monat+'.'+jahr
					showTooltip(item.pageX, item.pageY, item.series.label + " " + datum + " = " + y + "% ");
				}
			}
			else {
				$("#tooltip").remove();
				previousPoint = null;            
			} 
	});
}

function showTooltip(x, y, contents) {
	$('<div id="tooltip">' + contents + '</div>').css( {
		position: 'absolute',
		display: 'none',
		'z-index': 20,
		top: y - 15,
		left: x + 10,
		border: '1px solid #CDCDCD',
		padding: '1px',
		'background-color': '#EFEFEF',
		opacity: 0.80
	}).appendTo("body").fadeIn(200);
}
function laden()
	{
		chart_zeichnen('scripts/flot/examples/ajax_neu_data01.html')
		chart_zeichnen('scripts/flot/examples/ajax_neu_data02.html')
	}

// pie 
var data01 = [];
var data02 = [];
var data03 = [];
var data04 = [];
var data05 = [];
var data06 = [];
var data07 = [];
var data08 = [];
var data09 = [];

function plot_pies()
	{
		if(get('pie_01'))
			{
				plot_pie('pie_01',data01)
			}
		if(get('pie_02'))
			{
				plot_pie('pie_02',data02)
			}
		if(get('pie_03'))
			{
				plot_pie('pie_03',data03)
			}
		if(get('pie_04'))
			{
				plot_pie('pie_04',data04)
			}
		if(get('pie_05'))
			{
				plot_pie('pie_05',data05)
			}
		if(get('pie_06'))
			{
				plot_pie('pie_06',data06)
			}
		if(get('pie_06'))
			{
				plot_pie('pie_06',data06)
			}
		if(get('pie_06'))
			{
				plot_pie('pie_06',data06)
			}
		if(get('pie_06'))
			{
				plot_pie('pie_06',data06)
			}
	}

function plot_pie(pie_div,data)
	{
		$.plot($("#"+pie_div), data, 
		{
			series: {
				pie: { 
					show: true,
					radius: 85,
					//pieChartRadius: 50,
					label: {
						show: true,
                    	//radius: 1,
						formatter: function(label, series){
							return '<div style="font-size:8pt;text-align:left;padding:2px;">'+label+' '+Math.round(series.percent)+'%</div>';
						}
					}
				}
			},
			legend: {
				show: false
			},
			colors: [ '#4D7FA4', '#336D95', '#195C89', '#00497C', '#6692AF', '#80A4BE', '#9AB6CB', '#ADCDE5', '#BCDEF8' ]
			//colors: [ '#00497C', '#195C89', '#336D95', '#4D7FA4', '#6692AF', '#80A4BE', '#9AB6CB' ]
			//colors: [ '#9DBACC', '#ADC4D6', '#BFD1DD', '#CCDAE5', '#E0E9F0' ]
		});
	
	}

function hide_elem(id)
	{
		elem=get(id)
		elem.style.visibility='hidden'
		elem.style.display='none'
	}

function show_elem(id)
	{
		elem=get(id)
		elem.style.visibility='visible'
		elem.style.display='block'
	}

function detail_open()
	{
		show_elem('detail_content')
		hide_elem('detail_open')
		show_elem('detail_close')		
	}

function detail_close()
	{
		hide_elem('detail_content')
		show_elem('detail_open')
		hide_elem('detail_close')		
	}

function hide_tooltip()
	{
		if(get('tooltip'))
			{
				get('tooltip').style.display='none'
			}
	}

//Fonds detail
aktive_lasche=''
function lasche_over(id)
	{
		hide_tooltip()
		if(aktive_lasche!=id)
			{
				get(id).style.backgroundColor='#E4E4E4';
			}
	}
function lasche_out(id)
	{
		if(aktive_lasche!=id)
			{
				get(id).style.backgroundColor='#FFFFFF';
			}
	}
function lasche_click(id)
	{
		hide_tooltip()
		if(aktive_lasche!='')
			{
				get(aktive_lasche).style.backgroundColor='#FFFFFF';
				aktive_lasche=aktive_lasche.replace('lasche_','');
				get(aktive_lasche+'_content').style.visibility='hidden'
				get(aktive_lasche+'_content').style.display='none'
			}
		get(id).style.backgroundColor='#CCDAE5';
		aktive_lasche=id;
		id=id.replace('lasche_','');
		get(id+'_content').style.visibility='visible'
		get(id+'_content').style.display='block'
		if(id=='portfolio')
			{
				plot_pies()
			}
	}

function tbl_over(id)
	{
		get(id).style.backgroundColor='#E5E5E5';
	}
function tbl_out(id)
	{
		get(id).style.backgroundColor='#FFFFFF';
	}
	
// fonds info
function feld_over(id,rahmen)
	{
		elem=get('fond_info_'+id)
		//elem.style.backgroundColor='#E5E5E5';
		if(rahmen=='Y')
			{
				elem=get('fond_info_z1_'+id)
				elem.style.borderTop='1px dotted #CCCCCC'
				elem.style.borderBottom='1px dotted #CCCCCC'
				elem=get('fond_info_z2_'+id)
				elem.style.borderTop='1px dotted #CCCCCC'
				elem.style.borderBottom='1px dotted #CCCCCC'
			}
	}

function feld_out(id,rahmen)
	{
		elem=get('fond_info_'+id)
		//elem.style.backgroundColor='#FFFFFF';
		if(rahmen=='Y')
			{
				elem=get('fond_info_z1_'+id)
				elem.style.borderTop='1px dotted #FFFFFF'
				elem.style.borderBottom='1px dotted #FFFFFF'
				elem=get('fond_info_z2_'+id)
				elem.style.borderTop='1px dotted #FFFFFF'
				elem.style.borderBottom='1px dotted #FFFFFF'
			}
	}

function feld_over2(id,rahmen)
	{
		elem=get('fond_info_'+id)
		//elem.style.backgroundColor='#E5E5E5';
		if(rahmen=='Y')
			{
				elem=get('fond_info_z1_'+id)
				elem.style.borderBottom='1px dotted #CCCCCC'
				elem=get('fond_info_z2_'+id)
				elem.style.borderBottom='1px dotted #CCCCCC'
			}
	}

function feld_out2(id,rahmen)
	{
		elem=get('fond_info_'+id)
		//elem.style.backgroundColor='#FFFFFF';
		if(rahmen=='Y')
			{
				elem=get('fond_info_z1_'+id)
				elem.style.borderBottom='1px dotted #FFFFFF'
				elem=get('fond_info_z2_'+id)
				elem.style.borderBottom='1px dotted #FFFFFF'
			}
	}


// Sitemap
function s_over(id)
	{
		get(id).style.backgroundColor='#E5E5E5';
	}

function s_out(id)
	{
		get(id).style.backgroundColor='#FFFFFF';
	}

// team
function t_over(id)
	{
		get(id).style.backgroundColor='#E5E5E5';
	}

function t_out(id)
	{
		get(id).style.backgroundColor='#CDDBE6';
	}

// News
function news_over(id)
	{
		get(id).style.backgroundColor='#E5E5E5';
	}

function news_out(id)
	{
		get(id).style.backgroundColor='#FFFFFF';
	}

function show_news(id)
	{
		if(get('news_'+id+'_content').style.visibility=='hidden')
			{
				elem=get('news_'+id+'_aus');
				elem.style.visibility='hidden';
				elem.style.display='none';
				elem=get('news_'+id+'_ein');
				elem.style.visibility='visible';
				elem.style.display='block';
				elem=get('news_'+id+'_content');
				elem.style.visibility='visible';
				elem.style.display='block';
			}
			else
			{
				elem=get('news_'+id+'_ein');
				elem.style.visibility='hidden';
				elem.style.display='none';
				elem=get('news_'+id+'_aus');
				elem.style.visibility='visible';
				elem.style.display='block';
				elem=get('news_'+id+'_content');
				elem.style.visibility='hidden';
				elem.style.display='none';
			}
	}
	
// suche
function suche_an()
	{
		get('suchformular').style.visibility='visible';
		elem=get('q')
		elem.value=''
		elem.focus()
	}

function suche_aus()
	{
		elem=get('suchformular');
		elem.style.visibility='hidden';
		elem=get('q')
		elem.value=''
		elem.blur()
	}

// Kontaktformular
function nachricht_senden()
	{
		e=false;
		m='';
		get('msgoverlay').style.visibility='visible'
		if(get('anfrage_an_bank'))
			{
				if(get('anfrage_an_bank').checked==false && get('anfrage_an_found').checked==false && get('anfrage_an_treuhand').checked==false)
					{
						e=true;
						get('anfrage_an_bank').dummy.className = "NFRadio NFhRadioErr";
						get('anfrage_an_found').dummy.className = "NFRadio NFhRadioErr";
						get('anfrage_an_treuhand').dummy.className = "NFRadio NFhRadioErr";
						if(die_sprache=='de')
							{
								m=m+'<li>Empfänger angeben</li>';
							}
							else
							{
								m=m+'<li>Specify a recipient</li>';
							}
					}
			}
		if(get('anrede_f').checked==false && get('anrede_m').checked==false)
			{
				e=true;
				get('anrede_f').dummy.className = "NFRadio NFhRadioErr";
				get('anrede_m').dummy.className = "NFRadio NFhRadioErr";
				if(die_sprache=='de')
					{
						m=m+'<li>Anrede angeben</li>';
					}
					else
					{
						m=m+'<li>Specify title</li>';
					}
			}
		elem=get('vorname')
		if(elem.value=='' || elem.value.length<3)
			{
				if(die_sprache=='de')
					{
						m=m+'<li>Vorname angeben</li>';
					}
					else
					{
						m=m+'<li>Enter first name</li>';
					}					
				elem.dummy.className = "NFTextCenter NFhTextErr";
				elem.left.className = "NFTextLeft NFhTextErr";
				elem.right.className = "NFTextRight NFhTextErr";
				e=true
			}
		elem=get('nachname')
		if(elem.value=='' || elem.value.length<3)
			{
				if(die_sprache=='de')
					{
						m=m+'<li>Nachname angeben</li>';
					}
					else
					{
						m=m+'<li>Enter surname</li>';
					}
				elem.dummy.className = "NFTextCenter NFhTextErr";
				elem.left.className = "NFTextLeft NFhTextErr";
				elem.right.className = "NFTextRight NFhTextErr";
				e=true
			}
		elem=get('mail')
		if(elem.value=='' || elem.value.length<3)
			{
				if(die_sprache=='de')
					{
						m=m+'<li>E-Mail angeben</li>';
					}
					else
					{
						m=m+'<li>Enter an E-Mail address</li>';
					}					
				elem.dummy.className = "NFTextCenter NFhTextErr";
				elem.left.className = "NFTextLeft NFhTextErr";
				elem.right.className = "NFTextRight NFhTextErr";
				e=true
			}
		elem=get('betreff')
		if(elem.value=='' || elem.value.length<3)
			{
				if(die_sprache=='de')
					{
						m=m+'<li>Betreff angeben</li>';
					}
					else
					{
						m=m+'<li>Enter a subject</li>';
					}
				elem.dummy.className = "NFTextCenter NFhTextErr";
				elem.left.className = "NFTextLeft NFhTextErr";
				elem.right.className = "NFTextRight NFhTextErr";
				e=true
			}
		elem=get('nachricht')
		if(elem.value=='' || elem.value.length<3)
			{
				if(die_sprache=='de')
					{
						m=m+'<li>Nachricht eingeben</li>';
					}
					else
					{
						m=m+'<li>Enter a message</li>';
					}
				textfeld_err(elem);
				e=true
			}
		if (e==true)
			{
				if(die_sprache=='de')
					{
						msg_titel='Fehler';
						msg_text='Folgende Fehler sind aufgetreten:<ul>'+m+'</ul>';
					}
					else
					{
						msg_titel='Error';
						msg_text='The following error occurred:<ul>'+m+'</ul>';
					}
				open_msg(msg_titel,msg_text,'Alert48.gif');
				return false;
			}
			else
			{
				sendForm('msg_form','scripts/kontakt_msg.asp','msg_senden_response');
			}
		return false;
	}




function msg_senden_response() {

	if(req.readyState == 4)
		{
			antwort=req.responseText;
			if(req.status==200)
				{
					antwort=req.responseText;
					switch (antwort)
					{
						case '0':
							if(die_sprache=='de')
								{
									msg_titel='Nachricht gesendet';
									msg_text='<p>Vielen Dank. Ihre Nachricht wurde erfolgreich versendet.</p>';
								}
								else
								{
									msg_titel='Message sent';
									msg_text='<p>Thank you. Your message was successfully sent.</p>';
								}
							open_msg(msg_titel,msg_text,'haken48.gif');
							get('cmd').src=get('cmd').src;
							break;

						case '1':
							if(die_sprache=='de')
								{
									msg_titel='Fehler';
									msg_text='Bitte eine gültige E-Mail Adresse angeben.';
								}
								else
								{
									msg_titel='Error';
									msg_text='Please enter a valid e-mail address.';
								}
							open_msg(msg_titel,msg_text,'Alert48.gif');
							break;
						default:
							msg_titel='Fehler';
							msg_text=antwort;
							open_msg(msg_titel,msg_text,'Alert48.gif');
							break;
					}
				}
				else
				{
					msg_titel='Fehler';
					msg_text='Beim Senden des Formulars ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut oder wenden Sie sich an den Administrator.';
					msg_text=antwort;
					open_msg(msg_titel,msg_text,'Alert48.gif');
				}
		}
}


function textfeld_err(elem)
	{
		elem.topLeft.className = "NFTextareaTopLeft NFhErr";
		elem.topRight.className = "NFTextareaTop NFhrErr";
		elem.left.className = "NFTextareaLeftErr";
		elem.right.className = "NFTextareaRightErr";
		elem.bottomLeft.className = "NFTextareaBottomLeft NFhErr";
		elem.bottomRight.className = "NFTextareaBottom NFhrErr";
	}



//downloads
function kat_over(id)
	{
		get(id).style.color='#00487C';
	}
function kat_out(id)
	{
		get(id).style.color='#333333';
	}

function kat_click(nid,k1,k2)
	{
		get('cmd').src='downloads.asp?nid='+nid+'&k1='+k1+'&k2='+k2+'&r='+Math.random();
	}







function show_msg_loader()
	{
		h=getDocHeight();
		elem=get('msgoverlay')
		elem.style.height=h+'px';
		elem.style.visibility='visible';
		get('msg_loader').style.visibility='visible';
		window.scrollTo(0, 0);
	}

function close_msg_loader()
	{
		get('msgoverlay').style.visibility='hidden';
		get('msg_loader').style.visibility='hidden';
	}

function open_msg(titel,text,ico)
	{
		get('msgtitel').innerHTML=titel;
		get('msgtxt').innerHTML=text;
		get('msgimg').src='img/ico/'+ico;
		h=getDocHeight();
		get('msgoverlay').style.visibility='visible';
		get('msg_loader').style.visibility='hidden';
		get('msgbox').style.visibility='visible';
		window.scrollTo(0, 0);
	}

function close_msg()
	{
		get('msgoverlay').style.visibility='hidden';
		get('msg_loader').style.visibility='hidden';
		get('msgbox').style.visibility='hidden';
	}


// Formular und Button
function $focus(id)
	{
		elem=get(id)
		elem.style.background='#FFFFCC'
		elem.style.borderColor='#9E292B'
	}

function $blur(id)
	{
		elem=get(id)
		elem.style.background='#FFFFFF'	
		elem.style.borderColor='#CCCCCC'
	}

function button_over(id)
	{
		elem=get(id)
		elem.style.backgroundImage='url(img/gui/button_back_over.png)'
	}

function button_out(id)
	{
		elem=get(id)
		elem.style.backgroundImage='url(img/gui/button_back.png)'
		elem.style.lineHeight='24px';
	}

function button_down(id)
	{
		elem=get(id)
		elem.style.backgroundImage='url(img/gui/button_back_down.png)'
		elem.style.lineHeight='26px';
	}
	
// anlagekomitee
aktive_person=''
function zeig_person(id)
	{
		if (aktive_person!='')
			{
				get('komitee_fenster_'+aktive_person).style.visibility='hidden';
			}
		get('komitee_schatten').style.visibility='visible';
		get('komitee_fenster_'+id).style.visibility='visible';
		aktive_person=id;
	}

function hide_person(id)
	{
		get('komitee_schatten').style.visibility='hidden';
		get('komitee_fenster_'+id).style.visibility='hidden';
	}

// grafiken
function zeig_img(id)
	{
		get(id).style.visibility='visible';
	}

function zoom_in(id)
	{
		//prüfen ob auch alle anderen ausgezoomt
		var n=document.getElementsByTagName('img');
		for (var i=0;i<n.length;i++) 
					{
						if(n[i].id.indexOf('img_')>-1)
							{
								z_out_elem=n[i].id
								if(z_out_elem!=id && get(z_out_elem).style.width!='0px')
								//if(e!=id)
									{
										if(eval('b_'+z_out_elem))
											{
												eval('clearTimeout(zoom_in_'+z_out_elem+');')
												zoom_out(n[i].id)
											}
									}
							}
					}
					
		var akt_b=eval('b_'+id); 	// aktuelle breite
		akt_b=akt_b+30; 			// neue breite
		z_out_elem=get(id)				// neue breite setzen
		z_out_elem.style.width=akt_b+'px';
		
		var akt_h=z_out_elem.offsetHeight; // neue höhe auslesen
		var ori_b=eval('breite_'+die_grafik);
		var ori_h=eval('hoehe_'+die_grafik);
		
		var von_oben=eval('pos_top_'+id)
		var von_links=eval('pos_left_'+id)
		
		von_oben=von_oben+((ori_h-akt_h)/2)
		von_links=von_links+((ori_b-akt_b)/2)
		
		z_out_elem.style.top=von_oben+'px';
		z_out_elem.style.left=von_links+'px';
		
		z_out_elem.style.visibility='visible';
		z_out_elem.style.zIndex=4;
		eval('b_'+id+'=akt_b');
		if(eval('b_'+id+'<breite_'+id))
			{
				eval('zoom_in_'+id+'=setTimeout(function(){zoom_in(id);},0)')
			}
			else
			{
				z_out_elem=get(id);
				z_out_elem.style.width=eval('breite_'+id)+'px';
				z_out_elem.style.top=eval('pos_top_'+id)+'px';
				z_out_elem.style.left=eval('pos_left_'+id)+'px';
			}
	}

function zoom_out(id)
	{
		var akt_b=eval('b_'+id); 	// aktuelle breite
		akt_b=akt_b-20; 			// neue breite
		eval('b_'+id+'=akt_b');
		eval('clearTimeout(zoom_in_'+id+');')
		if(eval('b_'+id)>=0)
			{
				z_in_elem=get(id)				// neue breite setzen
				z_in_elem.style.width=akt_b+'px';
				
				var akt_h=z_in_elem.offsetHeight; // neue höhe auslesen
				var ori_b=eval('breite_'+die_grafik);
				var ori_h=eval('hoehe_'+die_grafik);
				
				var von_oben=eval('pos_top_'+id)
				var von_links=eval('pos_left_'+id)
				
				von_oben=von_oben+((ori_h-akt_h)/2)
				von_links=von_links+((ori_b-akt_b)/2)
				
				z_in_elem.style.top=von_oben+'px';
				z_in_elem.style.left=von_links+'px';
			}
			else
			{
				z_in_elem.style.width='0px';
				z_in_elem.style.visiblity='hidden';
			}
		z_in_elem.style.zIndex=3;
		if(eval('b_'+id+'>=0'))
			{
				setTimeout(function(){zoom_out(id);},0)
			}
			else
			{
				z_in_elem=get(id)
				z_in_elem.style.width='0px';
				z_in_elem.style.visiblity='hidden';
			}
	}

function init_zoom()
	{
		
		var n=document.getElementsByTagName('area');
		for (var i=0;i<n.length;i++) 
			{
				if(n[i].id.indexOf('area_')>-1)
					{
						// bild breite
						die_grafik=n[i].id.replace('area_','img_');
						elem=get(die_grafik);
						eval('breite_'+die_grafik+'=elem.offsetWidth;');
						eval('hoehe_'+die_grafik+'=elem.offsetHeight;');
						eval('pos_top_'+die_grafik+'=elem.offsetTop;');
						eval('pos_left_'+die_grafik+'=elem.offsetLeft;');
						elem.style.width='0px';
						n[i].onmouseover=function()
							{
								die_grafik=this.id.replace('area_','img_');
								elem=get(die_grafik)
								eval('b_'+die_grafik+'=0;');
								eval('h_'+die_grafik+'=0;');
								eval('top_'+die_grafik+'=0;');
								eval('left_'+die_grafik+'=0;');
								zoom_in(die_grafik)
							};
						n[i].onmouseout=function()
							{
								//zoom_out(elem.id)
								//alert('auszoomen')
							};
						elem.onmouseout=function()
							{
								zoom_out(this.id)
								//alert('auszoomen')
							};
					}
			}
	}

// grafik treuhand und home
function init_home()
	{
		
		var n=document.getElementsByTagName('area');
		for (var i=0;i<n.length;i++) 
			{
				if(n[i].id.indexOf('home_')>-1)
					{
						n[i].onmouseover=function()
							{
								x_bild=this.id.replace('home_','');
								get(x_bild).style.visibility='visible';
							};
						n[i].onmouseout=function()
							{
								x_bild=this.id.replace('home_','');
								get(x_bild).style.visibility='hidden';
							};
					}
			}
	}

function init_treuhand()
	{
		
		var n=document.getElementsByTagName('area');
		for (var i=0;i<n.length;i++) 
			{
				if(n[i].id.indexOf('treu_')>-1)
					{
						n[i].onmouseover=function()
							{
								x_bild=this.id.replace('treu_','');
								get(x_bild).style.visibility='visible';
							};
						n[i].onmouseout=function()
							{
								x_bild=this.id.replace('treu_','');
								get(x_bild).style.visibility='hidden';
							};
					}
			}
	}

function treu_ov(id)
	{
		get(id).style.visibility='visible';
	}

function treu_ot(id)
	{
		get(id).style.visibility='hidden';
	}

// grafik vermögensverwaltung
function prod_over(id)
	{
		get('arvest_produkte').src='img/grafiken/vermoegensverwaltung/'+id+'.jpg';
	}

function prod_out(id)
	{
		get('arvest_produkte').src='img/grafiken/vermoegensverwaltung/clear.gif';
	}

// Grafik werte
werte_def_img='';
function init_werte()
	{
		
		var n=document.getElementsByTagName('area');
		for (var i=0;i<n.length;i++) 
			{
				if(n[i].id.indexOf('werte_')>-1)
					{
						n[i].onmouseover=function()
							{
								bild=this.id;
								bild=bild.replace('werte_','');
								if(werte_def_img=='')
									{
										werte_def_img=get('werte_img').src;
									}
								get('werte_img').src='img/grafiken/werte/'+bild+'.jpg';
							};
						n[i].onmouseout=function()
							{
								get('werte_img').src=werte_def_img;
							};
					}
			}
	}

function init_konjukturzyklus()
	{
		
		var n=document.getElementsByTagName('area');
		for (var i=0;i<n.length;i++) 
			{
				if(n[i].id.indexOf('konzy_')>-1)
					{
						n[i].onmouseover=function()
							{
								the_bild=this.id;
								the_bild=the_bild.replace('konzy_','');
								get('konjunkturzyklus').src='img/grafiken/konjukturzyklus/'+the_bild+'_'+die_sprache+'.jpg';
							};
						n[i].onmouseout=function()
							{
								get('konjunkturzyklus').src='img/grafiken/konjukturzyklus/konjunkturzyklus_'+die_sprache+'.jpg';
							};
					}
			}
	}


// AJAX -------------------------------------------------------------------------
function get_elements(form){return get(form).elements}

function createXMLHttpRequest() {
	var ua;
	if(window.XMLHttpRequest){
		try {
				ua = new XMLHttpRequest();
		} catch(e) {
				ua = false;
		}
	} else if(window.ActiveXObject) {
		try {
			ua = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e) {
			ua = false;
		}
	}
	return ua;
}

var req = createXMLHttpRequest();

function sendRequest(url,resp) {
	//id = document.getElementById('dropdown').value;
	req.open('get', url);
	eval('req.onreadystatechange = '+resp);
	req.send(null);
}

var f;
function sendForm(f,url,resp) 
	{
		var str='';
		req.open('post', url);
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
		eval('req.onreadystatechange = '+resp);
		for(i=0; i<get_elements(f).length; i++)
			{
				if(get_elements(f)[i].disabled==false && get_elements(f)[i].type!='button')
					{
						t=get_elements(f)[i].type;
						if(t=='radio' || t=='checkbox')
							{
								if(get_elements(f)[i].checked==true)
									{
										n=get_elements(f)[i].name;
										v=get_elements(f)[i].value;
									}
									else
									{
										n='';
										v='';
									}
							}
							else
							{
								n=get_elements(f)[i].name;
								v=get_elements(f)[i].value;
								v=urlencode(v);
							}
							
						if(n!='')
							{
								if(str=='')
									{
										str += n + '=' + v;
									}
									else
									{
										str += '&' + n + '=' + v;
									}
							}
					}
			}
		req.send(str);
}

function handleResponse() {

	if(req.readyState == 4)
		{
			if(req.status==200)
				{
					alert(req.responseText);
				}
				else
				{
					alert('Fehler beim Senden des Formulars');
				}
		}
}

function urlencode (str) {
	var code = "";
	for (var i = 0; i < str.length; i++) {
		if (str.charAt(i) == " ") {
			code += "+";
		} else if (str.charAt(i) == "+") {
			code += "%2B";
		} else {
		code += escape(str.charAt(i));
		}
	}
	return code;
}



// seite mailen und direktlink
function emailForm(u,t){
	var daReferrer = document.referrer; 
	var email = ''; 
	var subject = t; 
	var body_message = '%0D'+u+'%0D';
	var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+body_message;

	win = window.open(mailto_link,'emailWindow'); 
	if (win && win.open &&!win.closed) win.close(); 
} 

aktive_nid=1;
function direkt_link(u){
	if(u=='')
		{
			u='content.asp?nid='+aktive_nid
		}
	var daReferrer = document.referrer; 
	win = window.open(u,'newWindow'); 
} 

// anfahrt & google maps
	// arvest privatbank pfäffikon
var map;
function map_01() {
	if(get('map1')) 
		{
			var mylat=47.2014137
			var mylng=8.7835879
			var myLatlng = new google.maps.LatLng(mylat,mylng);
			var myOptions = {
			  zoom: 15,
			  center: myLatlng,
			  mapTypeId: google.maps.MapTypeId.HYBRID  //ROADMAP, SATELLITE, HYBRID, TERRAIN 
			}
			map = new google.maps.Map(document.getElementById("map1"), myOptions);
			
			google.maps.event.addListener(map, 'zoom_changed', function() {
			  setTimeout(move_to(mylat,mylng), 10);
			});
			
			var marker = new google.maps.Marker({
				position: myLatlng, 
				map: map, 
				title:"Arvest Privatbank AG"
			});
			google.maps.event.addListener(marker, 'click', function() {
			  map.setZoom(18);
			});
		}
}

function map_02() {
	if(get('map2')) 
		{
			var mylat=47.210037
			var mylng=8.7037767
			var myLatlng = new google.maps.LatLng(mylat,mylng);
			var myOptions = {
			  zoom: 15,
			  center: myLatlng,
			  mapTypeId: google.maps.MapTypeId.HYBRID  //ROADMAP, SATELLITE, HYBRID, TERRAIN 
			}
			map = new google.maps.Map(document.getElementById("map2"), myOptions);
			
			google.maps.event.addListener(map, 'zoom_changed', function() {
			  setTimeout(move_to(mylat,mylng), 10);
			});
			
			var marker = new google.maps.Marker({
				position: myLatlng, 
				map: map, 
				title:"ARVEST AG Treuhand (Pfäffikon)"
			});
			google.maps.event.addListener(marker, 'click', function() {
			  map.setZoom(18);
			});
		}
}

function map_03() {
	if(get('map3')) 
		{
			var mylat=47.2014137
			var mylng=8.7835879
			var myLatlng = new google.maps.LatLng(mylat,mylng);
			var myOptions = {
			  zoom: 15,
			  center: myLatlng,
			  mapTypeId: google.maps.MapTypeId.HYBRID  //ROADMAP, SATELLITE, HYBRID, TERRAIN 
			}
			map = new google.maps.Map(document.getElementById("map3"), myOptions);
			
			google.maps.event.addListener(map, 'zoom_changed', function() {
			  setTimeout(move_to(mylat,mylng), 10);
			});
			
			var marker = new google.maps.Marker({
				position: myLatlng, 
				map: map, 
				title:"ARVEST Funds AG (Pfäffikon)"
			});
			google.maps.event.addListener(marker, 'click', function() {
			  map.setZoom(18);
			});
		}
}

function map_04() {
	if(get('map4')) 
		{
			var mylat=47.3688487
			var mylng=8.5383439
			var myLatlng = new google.maps.LatLng(mylat,mylng);
			var myOptions = {
			  zoom: 15,
			  center: myLatlng,
			  mapTypeId: google.maps.MapTypeId.HYBRID  //ROADMAP, SATELLITE, HYBRID, TERRAIN 
			}
			map = new google.maps.Map(document.getElementById("map4"), myOptions);
			
			google.maps.event.addListener(map, 'zoom_changed', function() {
			  setTimeout(move_to(mylat,mylng), 10);
			});
			
			var marker = new google.maps.Marker({
				position: myLatlng, 
				map: map, 
				title:"ARVEST Funds AG (Zürich)"
			});
			google.maps.event.addListener(marker, 'click', function() {
			  map.setZoom(18);
			});
		}
}

function map_05() {
	if(get('map5')) 
		{
			var mylat=47.1263465
			var mylng=8.7493173
			var myLatlng = new google.maps.LatLng(mylat,mylng);
			var myOptions = {
			  zoom: 15,
			  center: myLatlng,
			  mapTypeId: google.maps.MapTypeId.HYBRID  //ROADMAP, SATELLITE, HYBRID, TERRAIN 
			}
			map = new google.maps.Map(document.getElementById("map5"), myOptions);
			
			google.maps.event.addListener(map, 'zoom_changed', function() {
			  setTimeout(move_to(mylat,mylng), 10);
			});
			
			var marker = new google.maps.Marker({
				position: myLatlng, 
				map: map, 
				title:"ARVEST AG Treuhand (Einsiedeln)"
			});
			google.maps.event.addListener(marker, 'click', function() {
			  map.setZoom(18);
			});
		}
}

function move_to(lat,lng) {
	var movo_to_loc = new google.maps.LatLng(lat,lng);
	map.setCenter(movo_to_loc);
}

    function alt_map_01() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById('map1'));
        //map.setCenter(new GLatLng(47.2114137, 8.7835879), 13);
        map.setCenter(new GLatLng(47.2014137, 8.7835879), 13);
		var point = new GLatLng(47.2014137, 8.7835879);
		map.addOverlay(new GMarker(point));
        //map.openInfoWindowHtml(point,'<b>ARVEST Privatbank AG</b><br><b>ARVEST Founds AG</b><br>Churerstrasse 82 | 8808 Pfäffikon');
		var customUI = map.getDefaultUI();
        // Remove MapType.G_HYBRID_MAP
        customUI.maptypes.hybrid = false;
        map.setUI(customUI);
		map.setMapType( G_HYBRID_MAP );
      }
    }
	// arvest treuhand richterswil
    function alt_map_02() {
      if (GBrowserIsCompatible()) {
        var map2 = new GMap2(document.getElementById('map2'));
        //map2.setCenter(new GLatLng(47.220037, 8.7037767), 13);
        map2.setCenter(new GLatLng(47.210037, 8.7037767), 13);
		var point = new GLatLng(47.210037, 8.7037767);
		map2.addOverlay(new GMarker(point));
        //map2.openInfoWindowHtml(point,'<b>ARVEST Treuhand AG</b><br>Rosengartenstrasse 4 | 8805 Richterswil');
		var customUI = map2.getDefaultUI();
        // Remove MapType.G_HYBRID_MAP
        customUI.maptypes.hybrid = false;
        map2.setUI(customUI);
		map2.setMapType( G_HYBRID_MAP );
      }
    }
	//arvest funds pfäffikon
    function alt_map_03() {
      if (GBrowserIsCompatible()) {
        var map3 = new GMap2(document.getElementById('map3'));
        //map2.setCenter(new GLatLng(47.220037, 8.7037767), 13);
        map3.setCenter(new GLatLng(47.2014137, 8.7835879), 13);
		var point = new GLatLng(47.2014137, 8.7835879);
		map3.addOverlay(new GMarker(point));
        //map2.openInfoWindowHtml(point,'<b>ARVEST Treuhand AG</b><br>Rosengartenstrasse 4 | 8805 Richterswil');
		var customUI = map3.getDefaultUI();
        // Remove MapType.G_HYBRID_MAP
        customUI.maptypes.hybrid = false;
        map3.setUI(customUI);
		map3.setMapType( G_HYBRID_MAP );
      }
    }
	// arvest funds zürich
    function alt_map_04() {
      if (GBrowserIsCompatible()) {
        var map4 = new GMap2(document.getElementById('map4'));
        //map2.setCenter(new GLatLng(47.220037, 8.7037767), 13);
        map4.setCenter(new GLatLng(47.3688487, 8.5383439), 13);
		var point = new GLatLng(47.3688487, 8.5383439);
		map4.addOverlay(new GMarker(point));
        //map2.openInfoWindowHtml(point,'<b>ARVEST Treuhand AG</b><br>Rosengartenstrasse 4 | 8805 Richterswil');
		var customUI = map4.getDefaultUI();
        // Remove MapType.G_HYBRID_MAP
        customUI.maptypes.hybrid = false;
        map4.setUI(customUI);
		map4.setMapType( G_HYBRID_MAP );
      }
    }

	// arvest treuhand einsideln
    function alt_map_05() {
      if (GBrowserIsCompatible()) {
        var map5 = new GMap2(document.getElementById('map5'));
        //map2.setCenter(new GLatLng(47.220037, 8.7037767), 13);
        map5.setCenter(new GLatLng(47.1263465, 8.7493173), 13);
		var point = new GLatLng(47.1263465, 8.7493173);
		map5.addOverlay(new GMarker(point));
        //map2.openInfoWindowHtml(point,'<b>ARVEST Treuhand AG</b><br>Rosengartenstrasse 4 | 8805 Richterswil');
		var customUI = map5.getDefaultUI();
        // Remove MapType.G_HYBRID_MAP
        customUI.maptypes.hybrid = false;
        map5.setUI(customUI);
		map5.setMapType( G_HYBRID_MAP );
      }
    }

	
var default_route=''
var default_train=''

function route_f(id)
	{
		elem=get(id);
		elem.style.color='#333333';
		if(elem.value==default_route)
			{
				elem.value='';
			}
	}

function route_b(id)
	{
		elem=get(id);
		if(elem.value=='')
			{
				elem.value=default_route;
				elem.style.color='#CCCCCC';
			}
	}

function train_f(id)
	{
		elem=get(id);
		elem.style.color='#333333';
		elem.style.borderColor='#00487C';
		if(elem.value==default_train)
			{
				elem.value='';
			}
	}

function train_b(id)
	{
		elem=get(id);
		elem.style.borderColor='#333333';
		if(elem.value=='')
			{
				elem.value=default_train;
				elem.style.color='#CCCCCC';
			}
	}

	
// arvest video film
var der_film_en='<embed src="http://c.brightcove.com/services/viewer/federated_f9/1569844385?isVid=1&publisherID=687883056" bgcolor="#FFFFFF" flashVars="playerID=30897834001&domain=embed&autoStart=false&@videoPlayer=ref:81118144308350505_ARVESTAG_en" base="http://admin.brightcove.com" name="flashObj" width="470" height="313" seamlesstabbing="false" type="application/x-shockwave-flash" allowFullScreen="true" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"a></embed>';

var der_film_de='<embed src="http://c.brightcove.com/services/viewer/federated_f9?isVid=1" bgcolor="#FFFFFF" flashVars="videoId=61692553001&playerID=25685786001&playerKey=AQ~~,AAAAACkAQzA~,dV8u265LhjbVFHSu7DxXhIjfqjreJIXe&domain=embed&autoStart=false&dynamicStreaming=true" base="http://admin.brightcove.com" name="flashObj" width="470" height="313" seamlesstabbing="false" type="application/x-shockwave-flash" allowFullScreen="true" swLiveConnect="true" allowScriptAccess="always" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>'

function init_video()
	{
		if(get('arvest_video'))
			{
				elem=get('arvest_video');
				elem.style.border='none';
				if (die_sprache=='de')
					{
						elem.innerHTML=der_film_de;
					}
					else
					{
						elem.innerHTML=der_film_en;
					}
						
			}
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
