// JavaScript Document

function IPL2tabs(panel) {
  if(panel == "more") {
    document.getElementById('ipltab_1').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_active.gif)";
	document.getElementById('ipltab_2').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_inactive.gif)";
	document.getElementById('ipltab_3').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_inactive.gif)"; 
	document.getElementById('moretxt').style.color = "#ffffff";
    document.getElementById('newstxt').style.color = "#000000";
	document.getElementById('featurestxt').style.color = "#000000";
	document.getElementById('featurestxt').style.width = "102px";
  }
  if(panel == "news") {
    document.getElementById('ipltab_2').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_active.gif)";
    document.getElementById('ipltab_1').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_inactive.gif)";
	document.getElementById('ipltab_3').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_inactive.gif)";
	document.getElementById('moretxt').style.color = "#000000";
	document.getElementById('newstxt').style.color = "#ffffff";
	document.getElementById('featurestxt').style.color = "#000000";
	document.getElementById('featurestxt').style.width = "102px";
}
  if(panel == "features") {
    document.getElementById('ipltab_3').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_active.gif)";
	document.getElementById('ipltab_1').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_inactive.gif)";
	document.getElementById('ipltab_2').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/IPLPAGE2/tab_inactive.gif)";
	document.getElementById('moretxt').style.color = "#000000";
	document.getElementById('newstxt').style.color = "#000000";
	document.getElementById('featurestxt').style.color = "#ffffff";
	document.getElementById('featurestxt').style.width = "102px";    
  }
}


function IPL3tabs(panel1) {
  if(panel1 == "more1") {
    document.getElementById('ipltabmodule2_1').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/ICCWT20/PAGE2/rhstabsactive_157x35.jpg)";
	document.getElementById('ipltabmodule2_2').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/ICCWT20/PAGE2/rhstabsnormal_157x35.jpg)";
	document.getElementById('more1txt').style.color = "#ffffff";
    	document.getElementById('authortxt').style.color = "#000000";
  }
  if(panel1 == "author") {
    	document.getElementById('ipltabmodule2_2').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/ICCWT20/PAGE2/rhstabsactive_157x35.jpg)";
    	document.getElementById('ipltabmodule2_1').style.backgroundImage = "url(http://i.imgci.com/SERIES/2009/ICCWT20/PAGE2/rhstabsnormal_157x35.jpg)";
	document.getElementById('more1txt').style.color = "#000000";
	document.getElementById('authortxt').style.color = "#ffffff";
}
}



/*   Top Nav Dropdown menu script   */
var timeout         = 100;
var closetimer		= 0;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id){
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
}

// close showed layer
function mclose(){
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime(){
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime(){
	if(closetimer)	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
document.onclick = mclose;
/*   end of Top Nav Dropdown menu  */
function validate(){
	if (document.getElementById("caption").value == ""){
		alert("Please enter the caption");
		document.getElementById("caption").focus();
		return false;
	}
	if (document.getElementById("name").value == ""){
		alert("Please enter the Name");
		document.getElementById("name").focus();
		return false;
	}
	if(document.getElementById("email").value=="")
	{
		alert("Please enter your email id");
		document.getElementById("email").focus();
		return false;
	}
	if (document.getElementById("country").selectedIndex==0) {
		alert("Please select your country of Residence");
		document.getElementById("country").focus();
		return false;
	}
	
	else
	{
			var strS=document.getElementById("email").value;
			var blnB=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/.test(strS);
			if(blnB)
			{

			}
			else
			{
				alert("Please enter valid email id");
				document.getElementById("email").focus()
				return false;
			}
	}

}
function reset(){
	document.getElementById("caption").value = "";
	document.getElementById("name").value = "";
	document.getElementById("email").value = "";
	return false;
}