	//This function is to pop up a window to display alert message that cookies are disabled
	function popViewer(URL)
	{
		var newwindow;
		//Open a new window to display the message
		newwindow = window.open(URL,'Alert','toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars=yes, width=300, height=100'); //changed for new popup detection
		
		if ((newwindow) && (typeof newwindow.document=="object")) //changed for new popup detection...
		{
			// Every thing is fine ..pop up blocker is not there..the window was opened successfully
			if(!newwindow.focus())
				newwindow.focus();
		}
		else
		{
			//the window could not be opened. So throw an alert saying please enable cookies
			alert('Cookies are currently disabled in the current browser settings. Please change the settings to allow cookies to view our site properly.');
		}
	}

	//this function returns all the cookies
	function getCookies()
	{
	 	var t = new Array();
		var pieces = new Array();
		var cookies = null;
		//if document.cookies exist then try to get it
		if (document.cookie) {
			t = document.cookie.split(';');
			for (var i = 0; i < t.length; i++) {
				pieces = t[i].split('=');
				try
				{
					eval('cookies[i].' + pieces[0].replace('[', '_').replace(']', '_') + ' = "' + pieces[1] + '";');
				}
				catch(e){}
			}
		if(cookies!=null && cookies.length > 0)    //cookie length greater than zero so cookies are enabled
			return cookies;
		else
		    return null;         //cookies are disabled ..so return null
		}
		
		//cookies do not exist..return null
		return null;
	}
	
	//This method tries to recapture the cookie that was set by setcookie method
	function getCookie(name)
	{
		//check if cookie with given name exists
		var start = document.cookie.indexOf(name+"=");
		//get the last index of cookie name
		var len = start+name.length+1;
		//if cookie with given name is missing ..return null
		if ((!start) && (name != document.cookie.substring(0,name.length))){return null;}
		if (start == -1){return null;}
		var end = document.cookie.indexOf(";",len);
		if (end == -1) end = document.cookie.length;
		//return cookie name
		return unescape(document.cookie.substring(len,end));
	}

	function setCookie(name,value,path,domain,secure)
	{
		//try to set cookie with given name
		var cookieText= name+ "=" +value; 
		document.cookie = cookieText;
	}
	
	function CheckCookieEnabled(url)
	{
	   var allCookies = null;
	   var cookieValue = null;
	   //set a cookie with Cookie1 Name  
	   //setCookie("Cookie1","Cookie1","","onetravel.com","true"); 
	   //try to get back cookie with the same name
	   cookieValue = getCookie("Cookie1");
	   //try to get all cookies
	   allCookies = getCookies();   
	   if(cookieValue ==null) //&& allCookies == null)
	   {
	   	  // Since cookies do not exist..pop up an alert
	      popViewer(url);
	   }
	}
	/* These functions are commented as they are not working properly
	function CheckIfJavascriptEnabled()
	{
	   if(document.getElementById('hidJavascript') !=null)
		document.getElementById('hidJavascript').value = "True";
	}
	
	if(document.getElementById('lblJavascriptDisabled') != null)
	   document.getElementById('lblJavascriptDisabled').style.visiblity = 'None';*/