function readCookie(cookieName) {
 	var theCookie=""+document.cookie;
 	var ind=theCookie.indexOf(cookieName);
 	if (ind==-1 || cookieName=="") return "";
 	var ind1=theCookie.indexOf(';',ind);
 	if (ind1==-1) ind1=theCookie.length; 
 	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
	};

 function retrieveCookie(){ 
		 if (cookiesAreAllowed())
			 { var temp = readCookie('clientOptions');
			   if (temp !=='')
				  { temp = temp.split('|');
					setConfigValues(temp[0],temp[1],temp[2]) }
			  }
	 };

function setCookie(cookieName,cookieValue,expires) {
	var nextYear;
	var expiresIn;
	nextYear = new Date();
	nextYear.setFullYear(nextYear.getFullYear()+1);
	expiresIn = nextYear.toGMTString();	
	document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expiresIn + "; path=/";
	};

	
function deleteCookie (cookieName) {
	var expireNow = new Date();
	document.cookie = cookieName + "=" +
				"; expires=Thu, 01-Jan-70 00:00:01 GMT" +"; path=/";
	};
	
function cookiesAreAllowed() {
	testValue=100;
	//alert('jim1');
	setCookie('gigurtsisTest',testValue,true);
	if (testValue==readCookie('gigurtsisTest')) 
	    return true
	else
	    return false
   };
   
 
function testCookies() {
  if (cookiesAreAllowed())
     { var temp = readCookie('clientOptions');
	   if (temp !=='')
	      { temp = temp.split('|');
	   		setConfigValues(temp[0],temp[1],temp[2]) }
     };
	};