// Compacted by ScriptingMagic.com
/*
Script Name: Javascript Cookie Script
Author: Public Domain, with some modifications
Script Source URI: http://techpatterns.com/downloads/javascript_cookies.php
Version 1.1.1
Last Update: 4 October 2007

Changes:
1.1.1 fixes a problem with Get_Cookie that did not correctly handle case
where cookie is initialized but it has no "=" and thus no value, the 
Get_Cookie function generates a NULL exception. This was pointed out by olivier, thanks

1.1.0 fixes a problem with Get_Cookie that did not correctly handle
cases where multiple cookies might test as the same, like: site1, site

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
*/
function Get_Cookie(a){var b=document.cookie.split(";");var c="";var d="";var e="";var f=false;for(i=0;i<b.length;i++){c=b[i].split("=");d=c[0].replace(/^\s+|\s+$/g,"");if(d==a){f=true;if(c.length>1){e=unescape(c[1].replace(/^\s+|\s+$/g,""))}return e;break}c=null;d=""}if(!f){return null}}function Set_Cookie(a,b,c,d,e,f){var g=new Date();g.setTime(g.getTime());if(c){c=c*1000*60*60*24}var h=new Date(g.getTime()+(c));document.cookie=a+"="+escape(b)+((c)?";expires="+h.toGMTString():"")+((d)?";path="+d:"")+((e)?";domain="+e:"")+((f)?";secure":"")}function Delete_Cookie(a,b,c){if(Get_Cookie(a)){document.cookie=a+"="+((b)?";path="+b:"")+((c)?";domain="+c:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}