//global variables used to store object;
var req;
var setobj;
var falgchk=0;
var file;

//Create xmlhttp object.
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;   
}     

//Request file to get output.
function sendRequest(file) { 
	var str = "";  
	req.open('GET', file); 
	req.setRequestHeader("Cache-Control", "no-cache");    
	req.onreadystatechange = handleResponse;    
	req.send(null);   
	return false;  
}   

// REQUEST FILE WITH METHOD POST
function sendRequest_POST(file,params) { 
//alert('ajax'+file);
	var str = "";    

	req.open('POST', file, true);    

	//Send the proper header information along with the request
	req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	req.setRequestHeader("Content-length", params.length);
	req.setRequestHeader("Connection", "close");

	req.onreadystatechange = handleResponse;    
	req.send(params);   
	return false;  
}

//Get response for div poppulation.
function handleResponse() {   
	if(req.readyState == 4){    
		var response = req.responseText;
		
		setobj.innerHTML = response;

		if(prev_html!="") {
	        //opacity('news_lett',100,0,5000);
			setTimeout("restore_html();",5000);
		//	opacity('news_lett',0,100,1000);
		}
			

		
		
	}  
}

function restore_html() {
	
	//opacity('news_lett',0,100,500);
	document.getElementById("news_lett").className ="footer_white";

	document.getElementById("news_lett").innerHTML=prev_html;

}

//function to show a div.
function showdiv(divobj)
{
	//if(window.parent.sel_search != "undefined")
	//	window.parent.sel_search.style.visibility = "hidden";
	divobj.style.visibility="visible";
}

//function to hide a div.
function hidediv(divobj)
{
	//if(window.parent.sel_search != "undefined")
	//	window.parent.sel_search.style.visibility = "visible";
	divobj.style.visibility="hidden";
}

function stateChanged() 
 { 

	var vals =  document.getElementById("test").value;
	
	var corvals =  document.getElementById("cortest").value;
	//var footerval =  document.getElementById("footertest").value;
	
		//alert(vals);
    	  
 		//    for random images
		/*var im_0 = "<img src='images/hydro_power_vertical_banner.jpg'>";
		var im_1 = "<img src='images/banner_mission.jpg'>";
		var im_2 = "<img src='images/banner_our_company.jpg'>";
		var im_3 = "<img src='images/banner_our_founder.jpg'>";
		var im_4 = "<img src='images/banner_milestones.jpg'>";
		var im_5 = "<img src='images/banner_awards.jpg'>";
		var im_6 = "<img src='images/banner_spiritofhcc.jpg'>";
		var im_7 = "<img src='images/banner_management.jpg'>";
		var im_8 = "<img src='images/banner_company_india.jpg'>";
		var im_9 = "<img src='images/banner_the_brand.jpg'>";*/


        var im_0 = "<img src='images/hydro_power_vertical_banner.jpg' width='982'>";
		var im_1 = "<img src='images/water_solution_banner.jpg' width='982'>";
		var im_2 = "<img src='images/nuclear_power_banner.jpg' width='982'>";
		var im_3 = "<img src='images/transportation_vertical_banner.jpg' width='982'>";
		var im_4 = "<img src='images/banner_milestones.jpg' width='982'>";
		var im_5 = "<img src='images/banner_awards.jpg' width='982'>";
		var im_6 = "<img src='images/banner_spiritofhcc.jpg' width='982'>";
		var im_7 = "<img src='images/banner_management.jpg' width='982'>";
		var im_8 = "<img src='images/banner_company_india.jpg' width='982'>";
		var im_9 = "<img src='images/banner_the_brand.jpg' width='982'>";


		
		 
		if(vals=='0')		
		 document.getElementById("banner").innerHTML = im_0 ;
		else if(vals==1)		
		 document.getElementById("banner").innerHTML = im_1 ;
		else if(vals==2)
         document.getElementById("banner").innerHTML = im_2 ;
		else if(vals==3)
         document.getElementById("banner").innerHTML = im_3 ;
		else if(vals==4)
         document.getElementById("banner").innerHTML = im_4 ; 
		else if(vals==5)
         document.getElementById("banner").innerHTML = im_5 ; 
		
		
		// Corporate stewareds images
		
		var corim_2 = "<img src='images/investor_pack.jpg' alt='Investor Pack' title='Investor Pack' width='982'>";
		var corim_3 = "<img src='images/corporate_governance_banner.jpg' alt='Corporate Governance' title='Corporate Governance' width='982'>";
		var corim_4 = "<img src='images/jv_partners_banner.jpg' alt='JV Partners' title='JV Partners' width='982'>";		
		if(corvals==2 || corvals==21 || corvals==22 || corvals==23 || corvals==24 || corvals==25 || corvals==26 || corvals==27)
         document.getElementById("banner").innerHTML = corim_2;
		else if(corvals==3 || corvals==31 || corvals==32 && corvals==33 || corvals==34 || corvals==35)
         document.getElementById("banner").innerHTML = corim_3;		
		else if(corvals==4)
         document.getElementById("banner").innerHTML = corim_4;
		/*
		var footer_content1="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='732'  border='0' cellpadding='0' cellspacing='0'><tr><td colspan='2'>&nbsp;</td></tr><tr><td colspan='2'><span class='txt_blue'>Support to burn patients at two BMC run hospitals-Sion Hospital and Kasturba Hospital in Mumbai</span></td></tr><tr><td colspan='2'>The Gulabchand Foundation undertook two short term projects for two months in 2007 for providing medicines to the burn patients, and one year support from a physiotherapist to the patient.</td></tr><tr><td width='391' align='left' valign='top'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/sion_hos_snap.jpg' width='200' height='100' /></td></tr><tr><td height='10'></td></tr><tr><td height='15' align='left' valign='top'><img src='images/sion_hos.png' width='110' height='14' /></td></tr><tr><td height='15' align='left' valign='top'>This hospital is well-equipped with an occupational therapy department, and a burn ward with a capacity of 16 Patients. The therapy for burn patients starts from...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&id=5' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></td><td width='407' align='right' valign='top'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/sion_hos_snap.jpg' width='200' height='100' /></td></tr><tr><td height='10'></td></tr><tr><td height='15' align='left' valign='top'><img src='images/kasturba_hos.png' width='151' height='13' /></td></tr><tr><td height='15' align='left' valign='top'>The burn cases in the hospital are not admitted directly, <br />but are referred from other Municipal Hospitals for patients with more than 35 percent burns and require... </td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&id=4' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></td></tr></table></div></div>";
		var footer_content4="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/sion_hos_snap.jpg' width='200' height='100' /></td></tr><tr><td height='10'></td></tr><tr><td height='15' align='left' valign='top'><img src='images/sion_hos.png' width='110' height='14' /></td></tr><tr><td height='15' align='left' valign='top'>This hospital is well-equipped with an occupational therapy department, and a burn ward with a capacity of 16 Patients. The therapy for burn patients starts from...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&amp;id=5' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></div></div>";
		var footer_content5="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/sion_hos_snap.jpg' width='200' height='100' /></td></tr><tr><td height='10'></td></tr><tr><td height='15' align='left' valign='top'><img src='images/kasturba_hos.png' width='151' height='13' /></td></tr><tr><td height='15' align='left' valign='top'>The burn cases in the hospital are not admitted directly, <br />but are referred from other Municipal Hospitals for patients with more than 35 percent burns and require... </td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&amp;id=4' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></div></div>";
	    var footer_content12="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='732'  border='0' cellpadding='0' cellspacing='0'><tr><td width='391' align='left' valign='top'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img  src='images/nicmar_img.jpg' width='200' height='100' alt='NICMAR' title='NICMAR' /></td></tr><tr><td height='15' align='left' valign='top'><img style='margin-top:10px;' src='images/nicmar_bottom_txt.png' width='58' height='14' alt='NICMAR' title='NICMAR' /></td></tr><tr><td height='15' align='left' valign='top'>National Institute of Construction Management and Research (NICMAR), founded in 1983, is a pioneering management institute...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&id=21' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></td><td width='407' align='right' valign='top'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/walchand_college_img.jpg' width='200' height='100' alt='Walchand College of Engineering' title='Walchand College of Engineering' /></td></tr><tr><td height='15' align='left' valign='top'><img style='margin-top:10px;' src='images/walchand_fotter_txt.png' width='286' height='13' alt='Walchand College of Engineering' title='Walchand College of Engineering' /></td></tr><tr><td height='15' align='left' valign='top'>Walchand College of Engineering (WCE) was set up in 1947 at Sangli. Presently, it offers 6 undergraduate, <br />  9 post-graduate and 4 diploma programmes...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&id=22' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></td></tr></table></div></div>";
		var footer_content21="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/walchand_college_img.jpg' width='200' height='100' alt='Walchand College of Engineering' title='Walchand College of Engineering' /></td></tr><tr><td height='10'></td></tr><tr><td height='15' align='left' valign='top'><img src='images/walchand_fotter_txt.png' width='285' height='13' alt='Walchand College of Engineering' title='Walchand College of Engineering' /></td></tr><tr><td height='15' align='left' valign='top'>Walchand College of Engineering (WCE) was set up in 1947 at Sangli. Presently, it offers 6 undergraduate, 9 post-graduate and 4 diploma programmes...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&amp;id=22' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></div></div>";
		var footer_content22="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/nicmar_img.jpg' width='200' height='100' alt='Nicmar' title='Nicmar' /></td></tr><tr><td height='10'></td></tr><tr><td height='15' align='left' valign='top'><img src='images/nicmar_footer_txt.png' width='58' height='13' alt='Nicmar' title='Nicmar' /></td></tr><tr><td height='15' align='left' valign='top'>National Institute of Construction Management and Research (NICMAR), founded in 1983, is a pioneering management institute...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&amp;id=21' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></div></div>";
		var footer_content14="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='732'  border='0' cellpadding='0' cellspacing='0'><tr><td width='391' align='left' valign='top'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/water_harvesting_img.jpg' width='200' height='100' /></td></tr><tr><td height='15' align='left' valign='top'><img style='margin-top:10px;' src='images/water_harvesting_footer_txt.png' width='148' height='13' alt='Water Harvesting' title='Water Harvesting' /></td></tr><tr><td height='15' align='left' valign='top'>The water harvesting project involves the construction of a masonry weir across the Kalisind river near Haripura village in Kota district of Rajasthan...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&amp;id=31' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></td><td width='407' align='right' valign='top'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/sanitation_img.jpg' width='200' height='100' /></td></tr><tr><td height='15' align='left' valign='top'><img style='margin-top:10px;' src='images/sanitation_solid_waste_management_txt.jpg' width='312' height='12' /></td></tr><tr><td height='15' align='left' valign='top'>Walchand College of Engineering (WCE) was set up in 1947 at Sangli. Presently, it offers 6 undergraduate, 9 post-graduate and 4 diploma programmes...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&id=32' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></td></tr></table></div></div>";
		var footer_content31="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='732'  border='0' cellpadding='0' cellspacing='0'><tr><td width='391' align='left' valign='top'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/sanitation_img.jpg' width='200' height='100' /></td></tr><tr><td height='15' align='left' valign='top'><img style='margin-top:10px;' src='images/sanitation_solid_waste_management_txt.jpg' width='312' height='12' /></td></tr><tr><td height='15' align='left' valign='top'>Walchand College of Engineering (WCE) was set up in 1947 at Sangli. Presently, it offers 6 undergraduate, 9 post-graduate and 4 diploma programmes...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&id=32' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></td><td width='407' align='right' valign='top'></td></tr></table></div></div>";
		var footer_content32="<div style='clear:both'></div><div id='csrbottom'><div id='csrbottom_text'><table width='732'  border='0' cellpadding='0' cellspacing='0'><tr><td width='391' align='left' valign='top'><table width='330' border='0' cellspacing='0' cellpadding='0'><tr><td height='15' align='left' valign='top'>&nbsp;</td></tr><tr><td height='15' align='left' valign='top'><img src='images/water_harvesting_img.jpg' width='200' height='100' /></td></tr><tr><td height='15' align='left' valign='top'><img style='margin-top:10px;' src='images/water_harvesting_footer_txt.png' width='148' height='13' alt='Water Harvesting' title='Water Harvesting' /></td></tr><tr><td height='15' align='left' valign='top'>The water harvesting project involves the construction of a masonry weir across the Kalisind river near Haripura village in Kota district of Rajasthan...</td></tr><tr><td height='15' align='left' valign='top'><a href='four_pillars.php?page=corporate_stewardship&amp;id=31' class='bradc_page'>Read more...</a></td></tr><tr><td width='608' height='15' align='left' valign='top'></td></tr></table></td><td width='407' align='right' valign='top'></td></tr></table></div></div>";
		*/
		/*if(corvals==0 || corvals==3)		
		 document.getElementById("contentfooter").innerHTML = "";	
		else if(corvals==1)		
		document.getElementById("contentfooter").innerHTML = "";	
		else if(corvals==2)		
		 document.getElementById("contentfooter").innerHTML = "";	
		else if(corvals==4)		
		 document.getElementById("contentfooter").innerHTML = footer_content4;	
		else if(corvals==5)		
		 document.getElementById("contentfooter").innerHTML = footer_content5;	
		else if(corvals==12)		
		 document.getElementById("contentfooter").innerHTML = footer_content12;	
		else if(corvals==21)		
		 document.getElementById("contentfooter").innerHTML = footer_content21;
		else if(corvals==22)		
		 document.getElementById("contentfooter").innerHTML = footer_content22;
		else if(corvals==14)		
		 document.getElementById("contentfooter").innerHTML = footer_content14;
		else if(corvals==31)		
		 document.getElementById("contentfooter").innerHTML = footer_content31;
		else if(corvals==32)		
		 document.getElementById("contentfooter").innerHTML = footer_content32;*/

//	 alert("showRSS")
 if (req.readyState==4 || req.readyState=="complete")
  {  
  
	if(req.responseText !='')
  		document.getElementById("page_mission_contant_left").innerHTML=req.responseText ;
	  	 
  } 
 }



function show_reports(value) {
	// GET AJAX RECORD
	if(value) {
	req1 = createXMLHttpRequest1();
	setobj1 = document.getElementById('div_report_year'); 
	sendRequest1("show_report_year.php?type="+value);
	}

}

function show_quarters(type,value) {
	// GET AJAX RECORD
	req1 = createXMLHttpRequest1();
	setobj1 = document.getElementById('div_report_quarter'); 
	sendRequest1("show_report_quarter.php?type="+type+"&year="+value);
}

function show_name_and_pdf_section(id) {
   req1 = createXMLHttpRequest1();
   setobj1 = document.getElementById('report_file_name'); 
   sendRequest1("report_quarter_name_pdf.php?id="+id);
}

function show_currencies(value) {
	// GET AJAX RECORD
	if(value) {
	req1 = createXMLHttpRequest1();
	setobj1 = document.getElementById('div_currencies'); 
	sendRequest1("show_currencies.php?year="+value);
	}

}

function show_currency_pdf_section(value) {
	if(value) {
		req1 = createXMLHttpRequest1();
	    setobj1 = document.getElementById('balance_pdf'); 
	    sendRequest1("show_balance_pdf.php?year="+value);
    }
}