// Copyright (c) SGVsarc
// Developed by : Aadesh
// dated : 7 August 2009

var	   slide_info = new Array();
var        total_slide_images;
var        current_sel_image;
var        Flow_table;
var        slide_div;
var        slide_div_img;
var        close_btn;
var        flow_combo,revs_combo;



slide_info[0] = {'name' : 'Call Flow',     
		 'thmb_src' : 'small/CallFlow.png',
               'sld_src' :'CallFlow.png'
		};

slide_info[1] = {'name' : 'Call Tree<br>with File names',     
		 'thmb_src' : 'small/RichTree.png',
               'sld_src' :'RichTree.png'
		};

slide_info[2] = {'name' : 'Data Flow',     
		 'thmb_src' : 'small/DataFlow.png',
               'sld_src' :'DataFlow.png'
		};

slide_info[3] = {'name' : 'Call Tree<br>with Globals',     
		 'thmb_src' : 'small/RichTreeGlobals.png',
               'sld_src' :'RichTreeGlobals.png'
		};

slide_info[4] = {'name' : 'Recursive Functions',     
		 'thmb_src' : 'small/Recursive.png',
               'sld_src' :'Recursive.png'
		};

slide_info[5] = {'name' : 'Call Sequence',     
		 'thmb_src' : 'small/CallPath.png',
               'sld_src' :'CallPath.png'
		};

slide_info[6] = {'name' : 'Function Properties',     
		 'thmb_src' : 'small/FunctionProperties.png',
               'sld_src' :'FunctionProperties.png'
		};

slide_info[7] = {'name' : 'Unused Variables',     
		 'thmb_src' : 'small/Unused.png',
               'sld_src' :'Unused.png'
		};

slide_info[8] = {'name' : 'Structure Size and Object Size',     
		 'thmb_src' : 'small/StructureSize.PNG',
               'sld_src' :'StructureSize.PNG'
		};
slide_info[9] = {'name' : 'Call Stack Size',     
		 'thmb_src' : 'small/RichTreeStackSize.PNG',
               'sld_src' :'RichTreeStackSize.PNG'
		};


total_slide_images = 10;


current_sel_image = -1;


Flow_table = null;
slide_div = null;
slide_div_img = null;
close_btn = null;

flow_combo = null;
revs_combo = null;


function init_slide()
{
	if(document.all)
	{
		
		Flow_table = document.all("maintbl");
		
		close_btn = document.all("CloseBtn");
		slide_div = document.all("SlideDiv");
		slide_div_img = document.all("SlideDivImg");
		
		
		flow_combo = document.all("FlowCombo");
		revs_combo = document.all("RevsCombo");
		
		
	}
	else
	{
		if(document.getElementById)
		{
			
			Flow_table = document.getElementById("maintbl");

			close_btn = document.getElementById("CloseBtn");
			slide_div = document.getElementById("SlideDiv");
			slide_div_img = document.getElementById("SlideDivImg");
			
			flow_combo = document.getElementById("FlowCombo");
			revs_combo = document.getElementById("RevsCombo");

		}
	
	}
	
	
}




function slide_close()
{
	if(slide_div)
	{
		slide_div.style.visibility="hidden";
		slide_div.style.top = 0;
		slide_div.style.left= 0;
		slide_div.width=0
		slide_div.height=0
	}

	if(close_btn)
	{
		close_btn.style.visibility="hidden";
	}
	
	
	if(flow_combo)
	  flow_combo.style.visibility="visible";
	if(revs_combo)
	  revs_combo.style.visibility="visible";
	
	
	current_sel_image = -1;
}
function slide_setpostion()
{
	if(slide_div && current_sel_image > -1)
	{
		if(Flow_table)
		{
		   slide_div.style.top = 280 + Flow_table.offsetTop ;
		   slide_div.style.left= 10 + Flow_table.offsetLeft ;
		}
		else
		{
		  slide_div.style.top = 280;
		  slide_div.style.left= 10;
		}

		slide_div.width=660
		slide_div.height=400
	
	}

}

function slide_open(slide_num)
{
	current_sel_image = -1;
	
	if( slide_num > -1 && slide_num < total_slide_images )
	{
	
		if(slide_div )
		{
			slide_div.style.visibility="visible";
			current_sel_image = slide_num;
			
			slide_div_img.src = "/SlideImages/" + slide_info[ current_sel_image ].sld_src;
			
			
			
			if(close_btn)
			{
				  close_btn.style.visibility="visible";
				  close_btn.style.top = 1;
				  close_btn.style.left= 637;
			
			}
			

			if(flow_combo)
			  flow_combo.style.visibility="hidden";
			if(revs_combo)
			  revs_combo.style.visibility="hidden";
			
			slide_setpostion();
		}
	}
}


function slide_click(thmb_no)
{
    slide_close();
    slide_open(thmb_no);
}

