	brws = new detectBrowser();

	// Visibility crossbrowser values
	if(brws.ns4){ visib_val="show";  hidd_val="hide";}
	if(brws.dom || brws.ie4){ visib_val="visible";  hidd_val="hidden";}

	
	picLoaded = false;

	function detectBrowser(){
		this.dom = document.getElementById ? 1 : 0;	
		this.ns4 = (document.layers && !this.dom) ? 1 : 0;	
		this.ie4 = (document.all && !this.dom) ? 1 : 0;	
		}	
	
	
	// layer constructor (div with big chart)
	function layer(layerID,picName) {
		
		//  properties
		this.layerID = 	layerID;
		this.picName = picName;
		this.childImage = childImage;
		
		// methods
		this.chgVisibility = chgVisibility;
	}	


	function chgVisibility() {
	
		
		var divStyle = objDivStyle(this.layerID);
	
	
		if(divStyle.visibility  == hidd_val)
						{
							var img = this.childImage()
							setImgSrc(img);
							divStyle.visibility = visib_val;
						}
		 
		 else divStyle.visibility =  hidd_val;
		
	
	}	
		
	
	function childImage() {
	 
	 var pic;
		
		
		if(brws.ns4) pic = document.layers[this.layerID].document.images[this.picName];
		
		else pic = document.images[this.picName];
			 		 
			 		
	return pic;
			
	} 
	
	function objDivStyle(id) {
	 
	 var mydiv;
		
		if(brws.ns4) mydiv = document.layers[id];
			 		 
		if(brws.ie4)  mydiv = document.all[id].style;
	
		if(brws.dom)  mydiv = document.getElementById(id).style;
			
	
	return mydiv;
			
	} 
	
	
	function hideDiv() {
				
	window.setTimeout("objDivStyle(bigChartDiv.layerID).visibility = hidd_val;",100);			 
	
	}
	
	
	function setImgSrc(img) {
	
	
		 if(picLoaded == false)
		 { 
			
			img.src = load_big.src;
			window.setTimeout("delayImgSrc(null,'"+chart_url+"0')",100);			 
			
		 }
		
		picLoaded = true;	
	
	}
	
	
	
	
	function delayImgSrc(imgName,url) {
		
		if(imgName==null) 	bigChartDiv.childImage().src = url;
		
		else if(imgName=="chart1") document.images["chart1"].src = url;
	
	}	
		
	
	
	
	
	function loadGraph(id) {
		
		picLoaded = false;
		
		var path = "/my/bank/common/chart.jsp?id=" + id +"&language=" + lang_kind + "&size=";
		
		document.images["chart1"].src = load_small.src;
		window.setTimeout("delayImgSrc('chart1','"+path+"0')",100);
		
		chart_url = path + "1";
	}
	
