//Javascript

//Function for rollover in index pg
var toShow;
var current = '1';
function chng_me(toShow)
{
			var status = "event_des" + toShow;
			var cur_st = "event_des" + current;
			var imgId = "ev_img" + toShow;
			var cur_img = "ev_img" + current;
			//alert(toShow);
			if(toShow != current)
			{
			 toShow
			 document.getElementById(cur_st).style.display = 'none';
			 document.getElementById(status).style.display = 'block';
			 document.getElementById(cur_img).style.borderColor = '#b4b4b4';
			 document.getElementById(imgId).style.borderColor = '#4b4b4b';
			 current = toShow;
			}
}

/***** Map Function ******/
var state=0;
function large_map()
{
 if(state ==0)
 {document.getElementById("map").style.display="block";state=1;}
 else if(state ==1)
 {document.getElementById("map").style.display="none";state=0;}
}

/****** Subscribe function ******/
function sub_chk()
 {
		if(document.getElementById("s_name").value == "Your Name")
		{
		 	alert("Please enter your name");
			document.getElementById("s_name").focus();
			return false;
		}
		name = document.getElementById("s_name").value;
		email = document.getElementById("s_email").value;
		if(email == "Email" || email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.indexOf(" ") >= 0)
        {
		    alert("Please enter your valid email id");
			document.getElementById("s_email").focus();
			return false;	
		}
		if(document.getElementById("product").value == "0")
		{
		 	alert("Please select category to which your  belongs");
			document.getElementById("").focus();
			return false;
		}
		product = document.getElementById("product").value;
		var dataString = 'name='+ name + '&email=' + email + '&pro=' + product;
		//alert (dataString);return false;
		
		$.ajax({
      type: "POST",
      url: "includes/subscribe_post.php",
      data: dataString,
      success: function() {
        $('#subscribe').html("<h2>Thank You!</h2>")
        .append("<p>Subscribe Expogroup Newsletter Form Submitted.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#subscribe').append("<img id='checkmark' src='images/tick_green.png' style='float:left;' />");
        });
      }
     });
}
