 
var win=null;
function DrawGraf(GrafType){ 
     var ErechRef=eval("document.GlobalForm.Erech"+GrafType+";"); 
     var TkufaRef=eval("document.GlobalForm.Tkufa"+GrafType+";"),Erech=0; 
     if(ErechRef.selectedIndex) 
         Erech=ErechRef[ErechRef.selectedIndex].value; 
     else          Erech=ErechRef.value; 
     Tkufa=TkufaRef[TkufaRef.selectedIndex].value; 
     if(GrafType==1||GrafType==3){ 
         strMessage1="יש לבחור מדד עבורו יוצג הגרף"; 
     } 
     else{ strMessage1="יש לבחור מטבע עבורו יוצג הגרף"; 
     } 
     if(Erech==0){ 
         alert(strMessage1); 
         return; 
     } 
     if(Tkufa==0){ 
         alert("יש לבחור תקופה עבורה יוצג הגרף"); 
         return;
     }
     var src= "BdiMivDsp.asp?Erech=" + Erech+"&Tkufa="+Tkufa+"&GraphType="+GrafType+"&WCI=Miv_MakeGrf";
     OpnMivWin(src,6,"Grf"+GrafType+"Win");
 }
 
 function OpnMivWin(src,LinkType,winname)
{
    var BdiGrfWinHrz=400;	
    if(document.GlobalForm.Erech3){//for madad bdi only
		SlctRef=document.GlobalForm.Erech3;
		if(SlctRef.options[SlctRef.selectedIndex].text=="כלל הענפים"&&winname=="Grf3Win")
			BdiGrfWinHrz=430;		
	}		
	switch(LinkType){                                                           
		case 2: win=open(src,"MivItnWin","width=700,height=470,top=50,left=50,toolbar=no,fullscreen=no,resizable=yes,scrollbars=yes,location=no,titlebar=no,menubar=no");
				break;
		case 3: win=open(src,"MivWin","width=700,height=470,top=50,left=50,toolbar=no,fullscreen=no,resizable=yes,scrollbars=yes,location=no,titlebar=no,menubar=no");
				break;
		case 6: if(win&&typeof(win.name)!="unknown"&&winname=="Grf3Win"){
				   win.close();
				   win=null;	
				}
				win=open(src,winname,"width="+BdiGrfWinHrz+",height=390,top=100,left=100,toolbar=no,fullscreen=no,resizable=no,scrollbars=no,menubar=no");
				break;
    }
    if(win&&!win.closed){
		win.focus();
		win.opener=window;
    }
}

function OpnWin(src)
{
	win=open(src,"MivWin","width=700,height=470,top=50,left=50,toolbar=no,fullscreen=no,resizable=yes,scrollbars=yes,menubar=no");
	if(win&&!win.closed)
	{
		win.focus();
		win.opener=window;
	}
}
/*********************************************************************/
/*   Routine for showing combo */

function FocusCombo(oCombo) 
{
	oCombo.style.width="250%";
	oCombo.style.position="relative";
}
function BlurCombo(oCombo) 
{
	 if(oCombo.visibleAllTitle!='1')
	 {
		oCombo.style.width="";
		oCombo.style.position="static";		
	 }
}

function OnClickHandler()
{ 
  var el=null;
  var flag=true;
  
  el = event.srcElement;
  while (flag && el)   
  {
    if (el.tagName == "A")
    { 
		flag=false;
        if (el.protocol == "javascript:")
        {
			execScript(el.href, "javascript");
			window.event.returnValue = false; 
		}
    } 
    else 
      el = el.parentElement; 
  } 
}

function InitScrollDecorator()
{
	var i;
	var aSources = null;
	
	// init sections
	aSources = document.all("tblSection");
	
	InitControlsScrollDecorator(aSources);	
	
	// add scroll decorator to table of general BDI.
	aSources = document.all("oContentFrameGeneralBdi");
	InitControlsScrollDecorator(aSources);		
	
	// create scroll decorator for all need objects.
	ScrollDecorStart();
}

function InitControlsScrollDecorator(aSources)
{
	if(!aSources)
		return;
		
	if(aSources.length)
	{ // more objects
		for(i=0; i < aSources.length; i++)
		{
			// add the source object to scroll decorator
			ScrollDecorAdd(aSources[i]);
		}
	}
	else
	{ // one object
		// add the source object to scroll decorator
		ScrollDecorAdd(aSources);
	}
}

function PageLoad()
{
	oTblMain.style.display = "block";
	InitScrollDecorator();
	//SetGraphMadadBdi();
}

function SetGraphMadadBdi()
{
	var oContGraph = document.getElementById("oContGraph");
	if( oContGraph )
		oContGraph.innerHTML = '<img style="margin:0px;" src="BdiMivDsp.asp?Erech=all&amp;Tkufa=13&amp;GraphType=3&amp;WCI=Miv_MakeGrf&amp;new=1" ></img>';		
}

//window.attachEvent("onload", PageLoad);
window.onload = PageLoad;
//window.attachEvent("onload", InitScrollDecorator);
document.onclick = OnClickHandler;





