
function chkmeonce(chkname,imgname)
{
	var source,cPosition;
	source=document.images[imgname].src;
	cPosition = source.search(/plus.gif/)

	if (cPosition != -1)
	{
		document.images[imgname].src="/NewImages/Misc/minus.gif";
		showhide(1,chkname);
	}
	else
	{
		document.images[imgname].src="/NewImages/Misc/plus.gif";
		showhide(0,chkname);
	}
}

function showhide(f,laye)
{
	if (f)
	 {
	 visi=""
	 }
	else
	 {
	 visi="none"
	 }
	 
	if(document.layers)
	{
		a=eval("document."+laye+".style.display")
		a=visi;
	}
	if(document.all)
	{
		a=eval("document.all."+laye+".style.display")
		a=visi;
	}
	if(document.getElementById)
	{
		document.getElementById(""+laye+"").style.display=visi;
	}
}

function OpenTalktousPopup()
{
	var sIndex = document.getElementById("cmbTalktous").selectedIndex;
	var sValue = document.getElementById("cmbTalktous").options[sIndex].value;
	//var sTitle = document.getElementById("cmbTalktous").options[sIndex].text;
	if(sValue == "0")
	{
		alert("Please select one option");
	} 
	else
	{
		window.open(sValue,"","toolbar=no,scrollbars=yes,width=560,height=650,left=200,top=20");
	}
}

function OpenLPGCenterPopup()
{
	var sIndex = document.getElementById("cmbLPGCenter").selectedIndex;
	var sValue = document.getElementById("cmbLPGCenter").options[sIndex].value;
	if(sValue == "0")
	{
		alert("Please select one option");
	}                                                                                                     
	
	else if(sValue == "LPGIncharges.aspx" )
	{
		window.open(sValue,"","toolbar=no,scrollbars=yes,width=800,height=450,left=200,top=150");
	}
	else
	{
		window.open(sValue,"","toolbar=no,scrollbars=yes,width=560,left=100,top=100");
	}
	
}

function OpenFuelCenterPopup()
{
	var sIndex = document.getElementById("cmbFuelCnter").selectedIndex;
	var sValue = document.getElementById("cmbFuelCnter").options[sIndex].value;
	//var sTitle = document.getElementById("cmbTalktous").options[sIndex].text;
	if(sValue == "0")
	{
		alert("Please select one option");
	} 
	else
	{
		window.open(sValue,"","toolbar=no,scrollbars=yes,width=700,left=100,top=100");
	}
}

function OpenStateOfficePopup()
{
	var sIndex = document.getElementById("cmbState").selectedIndex;
	var sValue = document.getElementById("cmbState").options[sIndex].value;
	//var sTitle = document.getElementById("cmbTalktous").options[sIndex].text;
	if(sValue == "0")
	{
		alert("Please select one option");
	} 
	else
	{
		window.open(sValue,"","toolbar=no,scrollbars=yes,width=700,left=100,top=100");
	}
}



function OpenFAQPopup()
{
	var sIndex = document.getElementById("cmbFAQ").selectedIndex;
	var sValue = document.getElementById("cmbFAQ").options[sIndex].value;
	//var sTitle = document.getElementById("cmbTalktous").options[sIndex].text;
	if(sValue == "0")
	{
		alert("Please select one option");
	} 
	else
	{
		window.open(sValue,"","toolbar=no,scrollbars=yes,width=700,left=100,top=100");
	}
}

function RedirectToProducts()
{
	var sIndex = document.getElementById("cmbProducts").selectedIndex;
	var sValue = document.getElementById("cmbProducts").options[sIndex].value;
	if(sValue == "0")
	{
		alert("Please select one option");
	} 
	else
	{
		self.location = sValue
	}
}
function RedirectToServices()
{
	var sIndex = document.getElementById("cmbServices").selectedIndex;
	var sValue = document.getElementById("cmbServices").options[sIndex].value;
	if(sValue == "0")
	{
		alert("Please select one option");
	} 
	else
	{
	self.location = sValue
	}
}
function OpenTermsofuse()
{
	window.open("/html/Termsofuse.htm","","toolbar=no,scrollbars=yes,width=560,height=600,left=100,top=100");
}
function PopupPrintNews()
{
	var oWin = window.open('PrintNews.aspx?NewsID=' + '322' + '&NewsTypeID=' + '-1','Print','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=660,left=50,top=50');
	oWin.opener = self;
}
function print(url)
{
	window.open(url,'Earthing','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=660,left=50,top=50');
}
function email(url)
{
	window.open('../email.aspx?UrlOfFile='+url,'Earthing','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=400,left=50,top=50,height=330');
}


/*Followings function for Maintain font size*/
global_var = 0;
function GetElementsByPrefix(inPrefix,inRoot)
{ 
	var elem_array = new Array; 
	if(typeof inRoot.firstChild!= 'undefined')
	{ 
		var elem = inRoot.firstChild; 
		while (elem!= null)
		{ 
			if(typeof elem.firstChild!= 'undefined')
			{ 
				elem_array = elem_array.concat(GetElementsByPrefix(inPrefix,elem)); 
			} 
			if(typeof elem.id!= 'undefined')
			{ 
				var reg = new RegExp ( '^'+inPrefix+'.*' ); 				
				if(elem.id.match(reg))
				{ 
					elem_array.push(elem); 
				} 
			} 
			elem = elem.nextSibling; 
		} 
	} 
	return elem_array; 
} 

function DisplayPlusElements(in_elem_array)
{
	if(in_elem_array.length)
	{ 
		var fs;
		for(var c=0; c<in_elem_array.length; c++)
		{ 
			if(document.getElementById(in_elem_array[c].id).className)
			{
				fs = document.getElementById(in_elem_array[c].id).className;
				var sp = fs.split("_");
				document.getElementById(in_elem_array[c].id).style.fontSize = parseInt(sp[1])+2 + "px";
			}
		} 
	} 
} 

function DisplayPlus2Elements(in_elem_array)
{
	if(in_elem_array.length)
	{ 
		var fs;
		for(var c=0; c<in_elem_array.length; c++)
		{ 
			if(document.getElementById(in_elem_array[c].id).className)
			{
			fs = document.getElementById(in_elem_array[c].id).className;
			var sp = fs.split("_");
			document.getElementById(in_elem_array[c].id).style.fontSize = parseInt(sp[1])+4 + "px";
			}
		} 
	}
} 

function DisplayResetElements(in_elem_array)
{ 
	if(in_elem_array.length)
	{ 
		var fs;
		global_var = 0;
		for(var c=0; c<in_elem_array.length; c++)
		{ 
			if(document.getElementById(in_elem_array[c].id).className)
			{
				fs = document.getElementById(in_elem_array[c].id).className;
				var sp = fs.split("_");
				var f_size = parseInt(sp[1]) + "px";
				document.getElementById(in_elem_array[c].id).style.fontSize = f_size;		
			}
		} 		
	} 
} 

var tp=0; 
function makeMove()
{ 
	var tm=setTimeout("makeMove()",10); 
	divNewsText.style.left=tp; 
	tp--; 
	if(tp==-2000)
	{ 
		tp=0; 
	}
}
function popupGoldenYears()
	{
		window.open('http://www.iocl.com/html/Golden_Years.htm','default1','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=660,left=200,top=150');
    }
