function  getSport()
{			
	var your_url=window.location.toString()					
	var sport = your_url.substring(your_url.lastIndexOf('sport'),your_url.length)			
	sport=sport.substring(sport.indexOf('sport='),9)
	sport=sport.substring(6,sport.length)
	return sport
}
function chkDateFormat(vyear,vmonth,vday)						
{
   
   var intYear =document.getElementById(vyear).value//Integer variable. Stores year of date.
  		//String variable. Stores remaining string of day field.
   var intMonth = document.getElementById(vmonth).value //Integer variable. Stores month of date field.
   var intDay =document.getElementById(vday).value				//Integer variable. Stores day of date.    
   intYear = parseInt(intYear,10);
   intMonth=parseInt(intMonth,10)
   intDay=parseInt(intDay,10)
  
  
   var intDate =new Date()  //Current system date
   var curmonth=intDate.getMonth()+1 //current month
   var curyear=intDate.getFullYear() //current year
   var curdate=intDate.getDate()     //current day
   //Condition to check month range  
   //Condition to check job expiry date greater than current date
   		
	if (intYear==curyear )
	{		
		if (curmonth == intMonth )
		{			
			if(intDay > curdate)
			{			
				alert("Select a valid date..");
				return false
			}	
		}
		else
		{
			if( intMonth>curmonth )
			{
				alert("Select a valid date..");
				return false;
			}
		}	  
	 }
   //Switch cases to check days range
    
   switch (intMonth)							  
	{ 
	  //Case to check range of days in february month
	  case 2:	
	 								 
		//variable to check range of days in february month 
		var validDay = ((intYear % 4 == 0) && ( (!(intYear % 100 == 0)) || (intYear % 400 == 0) ) ) ? 29 : 28;
		if (intDay > validDay){				   
		  alert ("February should have " + validDay + " days for the given year");
		  return false;
	    }
		break;
	  //Cases to check range of days in Jan, Mar, May, Jul, Aug, Oct, Dec months
	  case 1:	
	  case 3:
	  case 5:
	  case 7:
	  case 8:
	  case 10:
	  case 12:
	  	if (intDay > 31){
	      alert ("Invalid day for this month");
		  return false;
		}
	  break;
      //Default case to check range of days for rest of the months
      default:	
		if (intDay > 30){
		  alert ("Invalid day for this month");
		  return false;
		}
	}
   return true;
 } 
 function validate()
 {
	if(document.getElementById("ddlYear").value!="")
	{
		if(document.getElementById("ddlMonth").value!="")
		{
			if(document.getElementById("ddlDay").value!="")
			{
				chkDateFormat()
			}
		}
	}
	
 }

function emailCheck (emailStr) {
	/* The following variable tells the rest of the function whether or not
	to verify that the address ends in a two-letter country or well-known
	TLD.  1 means check it, 0 means don't. */

	var checkTLD=1;
	/* The following is the list of known TLDs that an e-mail address must end with. */
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
	
	/* The following pattern is used to check if the entered e-mail address
	fits the user@domain format.  It also is used to separate the username
	from the domain. */
	var emailPat=/^(.+)@(.+)$/;

	/* The following string represents the pattern for matching all special
	characters.  We don't want to allow special characters in the address. 
	These characters include ( ) < > @ , ; : \ " . [ ] */

	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

	/* The following string represents the range of characters allowed in a 
	username or domainname.  It really states which chars aren't allowed.*/
	var validChars="\[^\\s" + specialChars + "\]";

	/* The following pattern applies if the "user" is a quoted string (in
	which case, there are no rules about which characters are allowed
	and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
	is a legal e-mail address. */
	var quotedUser="(\"[^\"]*\")";

	/* The following pattern applies for domains that are IP addresses,
	rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
	e-mail address. NOTE: The square brackets are required. */
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

	/* The following string represents an atom (basically a series of non-special characters.) */
	var atom=validChars + '+';

	/* The following string represents one word in the typical username.
	For example, in john.doe@somewhere.com, john and doe are words.
	Basically, a word is either an atom or quoted string. */
	var word="(" + atom + "|" + quotedUser + ")";

	// The following pattern describes the structure of the user
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

	/* The following pattern describes the structure of a normal symbolic
	domain, as opposed to ipDomainPat, shown above. */
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

	/* Finally, let's start trying to figure out if the supplied address is valid. */
	/* Begin with the coarse pattern to simply break up user@domain into
	different pieces that are easy to analyze. */
	var matchArray=emailStr.match(emailPat);

	if (matchArray==null) {
	/* Too many/few @'s or something; basically, this address doesn't
	even fit the general mould of a valid e-mail address. */
	//alert("Email address seems incorrect (check @ and .'s)");
	emailStr="";
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	// Start by checking that only basic ASCII characters are in the strings (0-127).
	for (i=0; i< user.length; i++) {
		if (user.charCodeAt(i)>127) {
		//alert("Ths username contains invalid characters.");
		return false;
	   }
	}
	for (i=0; i< domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			//alert("Ths domain name contains invalid characters.");
			return false;
		}
	}
	// See if "user" is valid 
	if (user.match(userPat)==null) {
	// user is not valid
		//alert("The username doesn't seem to be valid.");
		return false;
	}
	/* if the e-mail address is at an IP address (as opposed to a symbolic
	host name) make sure the IP address is valid. */
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		// this is an IP address
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				//alert("Destination IP address is invalid!");
				return false;
		   }
		}
		return true;
	}

	// Domain is symbolic name.  Check if it's valid.
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i< len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			//alert("The domain name does not seem to be valid.");
			return false;
		}
	}
	
	/* domain name seems valid, but now make sure that it ends in a
	known top-level domain (like com, edu, gov) or a two-letter word,
	representing country (uk, nl), and that there's a hostname preceding 
	the domain or country. */
	
	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1){
		//alert("The address must end in a well-known domain or two letter " + "country.");
		return false;
	}

	// Make sure there's a host name preceding the domain.
	if (len<2){
		//alert("This address is missing a hostname!");
		return false;
	}
	// If we've gotten this far, everything's valid!
	return true;
}


//Chrome Drop Down Menu- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: Jan 1st, 06'

var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout

//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

showhide:function(obj, e, visible, hidden){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
	if (this.dropmenuobj!=null) //hide previous menu
	this.dropmenuobj.style.visibility="hidden"
	this.clearhidemenu()
	if (this.ie||this.firefox){
		obj.onmouseout=function(){cssdropdown.delayhidemenu()}
	this.dropmenuobj=document.getElementById(dropmenuID)
	this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
	this.dropmenuobj.onmouseout=function(){cssdropdown.dynamichide(e)}
	this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
	this.showhide(this.dropmenuobj.style, e, "visible", "hidden")
	this.dropmenuobj.x=this.getposOffset(obj, "left")
	this.dropmenuobj.y=this.getposOffset(obj, "top")
	this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
	this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	//alert(this.dropmenuobj.style.left);
	//alert(this.dropmenuobj.style.top);
	//alert(obj.offsetHeight);

}
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'",this.disappeardelay)
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
}
}

