
function setCookie (cookieName, cookieValue) 
{
var cookieName;
var cookieValue;
var path;
path="/";
document.cookie =  escape(cookieName) + '=' + escape(cookieValue)  
    + (path ? '; PATH=' + path : '');	
}




function GetCookieVal(offset) {
   var endstr = document.cookie.indexOf (";",offset);
   if (endstr == -1) { endstr = document.cookie.length; }
   return unescape(document.cookie.substring(
              offset,endstr));
}



function GetACookie(name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while(i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i,j) == arg) {
         return GetCookieVal(j);
      }
      i = document.cookie.indexOf(" ", i) + 1;
      if(i == 0) break;
   }
   return null;
}



setCookie("Onlinelng","English")


<!--
function getmonthnum(mon)
{
if(mon=="JAN") return 1
if(mon=="FEB") return 2
if(mon=="MAR") return 3
if(mon=="APR") return 4
if(mon=="MAY") return 5
if(mon=="JUN") return 6
if(mon=="JUL") return 7
if(mon=="AUG") return 8
if(mon=="SEP") return 9
if(mon=="OCT") return 10
if(mon=="NOV") return 11
if(mon=="DEC") return 12
}

function getmonthname(mon)
{
if(mon=="0") return "January"
if(mon=="1") return "February"
if(mon=="2") return "March"
if(mon=="3") return "April"
if(mon=="4") return "May"
if(mon=="5") return "June"
if(mon=="6") return "July"
if(mon=="7") return "August"
if(mon=="8") return "September"
if(mon=="9") return "October"
if(mon=="10") return "November"
if(mon=="11") return "December"
}

function isdate(dtstr)
{
var d=dtstr.substr(0,2);
var m=getmonthnum(dtstr.substr(2,3));
var y=dtstr.substr(5,8);
if (d < 1 || d > 31) 
{
    alert("Day must be between 1 and 31"); //Days must be between 1 and 31
    return false;
}

if ((m==4 || m==6 || m==9 || m==11) && d==31) 
{
     alert("Month "+m+" doesn't have 31 days!"); // alert("Month "+m+" doesn't have 31 days!")
    return false;
}

if (m==2) 
{ // check for february 29th
    var isleap = (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));
    if (d > 29 || (d==29 && !isleap)) 
    {
         alert("February " + y + " doesn't have " + d + " days!"); // alert("February " + y + " doesn't have " + d + " days!");
        return false;
    }
}
return true; // date is valid
}

//-->

// This function is for stripping leading and trailing spaces
function trim(str) 
{
if (str != null) 
{
var i;
for (i=0; i<str.length; i++) 
{
if (str.charAt(i)!=" ") 
{
str=str.substring(i,str.length);
break;
}
}
for (i=str.length-1; i>=0; i--) 
{
if (str.charAt(i)!=" ") 
{
str=str.substring(0,i+1); break;
}
} 
if (str.charAt(0)==" ") 
{
return "";
} 
else 
{
return str; 
}
}
}


function onGoClick()
{
/*if (document.myTripDetails.txtLastName.value !="")
{
    if(trim(document.myTripDetails.txtLastName.value)=="")
    alert("last name");
    return false;

}*/
	if(document.myTripDetails.userlogin.value == "")
	{
		//if ((document.myTripDetails.txtPNRNo.value=="" || document.myTripDetails.txtLastName.value=="")&&(document.myTripDetails.tempRefNo.value=="" || document.myTripDetails.txtLastName.value==""))	
		if ((trim(document.myTripDetails.txtPNRNo.value)=="" || trim(document.myTripDetails.txtLastName.value)=="")&&(trim(document.myTripDetails.tempRefNo.value)=="" || trim(document.myTripDetails.txtLastName.value)==""))	
		{
			alert(" Please enter details in all fields.");
			//alert("Please enter details in all fields.");
			document.myTripDetails.txtPNRNo.focus();
			return false;
		}
	}
	else
	{
	
		if (document.myTripDetails.tempRefNo.value == "" )
		{
	
		    if (document.myTripDetails.txtPNRNo.value=="")
		    {
		    if ( document.myTripDetails.txtLastName.value=="")
		    {
			alert(" Please fill at least one field.");
			//alert("Please fill at least one field.");
			document.myTripDetails.tempRefNo.focus();
			return false;
			}
			}
		}	
	}	
	mytempval = document.myTripDetails.tempRefNo.value
	if (isNaN(mytempval.charAt(0)))
	{
	mytempval=mytempval.substring(2,mytempval.length);	
	}	
	document.myTripDetails.txtRefNo.value=mytempval;
	document.myTripDetails.submit();
}
function fnOnlyInt(objNum,isNagative)
{
	/**call this function onkeypress event this is only for integers take only posative*/
	if(event.keyCode!=13)
	{
		if(event.keyCode!=45)
		{
			if (event.keyCode<48 || event.keyCode>57)
			{
				event.keyCode=8
				return false
			}
			else
			{
				return true
			}
		}
		else
		{
			if(isNagative==true)
			{
				if(objNum.value!="")
				{
					event.keyCode=8
					objNum.focus()
					return false
				}
			}
			else
			{
				event.keyCode=8
				objNum.focus()
				return false
			}
		}
	}		
}




