var ids_uid ;
(
function()
{
function Cookie( name, hours, path, domain, secure )
{
this.params = new Array() ;
if ( name )
{
this.name = name ;
}
else
{
this.name = "default" ;
}
if( hours )
{
if( hours < 0 )
{
this.expires = (new Date( Date.parse("31 DEC 2099 23:59:59") )).toGMTString()
}
else
{
this.expires = (new Date( new Date().getTime() + hours * 3600 * 1000 )).toGMTString() ;
}
}
else
{
this.expires = null ;
}
if( path )
{
this.path = path ;
}
else
{
this.path = null ;
}
if( domain )
{
this.domain = domain ;
}
else
{
this.domain = null ;
}
if( secure )
{
this.secure = ture ;
}
else
{
this.secure = false ;
}
this.close = Cookie_close ;
this.put = Cookie_put ;
this.get = Cookie_get ;
this.elements = Cookie_elements ;
this.exists = Cookie_exists ;
this.remove = Cookie_remove ;
this.removeAll = Cookie_removeAll ;
this.toString = Cookie_toString ;
this._load = Cookie__load ;
this._store = Cookie__store ;
}
function Cookie_close()
{
this._store() ;
}
function Cookie_put( key, value )
{
key += "" ;
if( value == null)
{
this.params[ key ] = null ;
}
else
{
this.params[ key ] = value + "" ;
}
}
function Cookie_get( key )
{
key += "" ;
if( this.exists( key ) )
{
return this.params[ key ] ;
}
else
{
return null ;
}
}
function Cookie_elements()
{
return this.params ;
}
function Cookie_exists( key )
{
key += "" ;
var b ;
b = typeof this.params[ key ] == "string" ; 
return b ;
}
function Cookie_remove( key )
{
this.params[ key ] = null ;
var newParams = new Array() ;
for ( var prop in this.params )
{
if( typeof this.params[ prop ] != "string" )
{
continue ;
}
newParams[ prop ] = this.params[ prop ] ;
}
this.params = newParams ;
}
function  Cookie_removeAll()
{
for ( var prop in this.params )
{
this.remove( prop ) ;
}
}
function Cookie__load()
{
var cookies = document.cookie ;
var start = cookies.indexOf( this.name + "=" ) ;
if(start == -1 )
{
return false ;
}
start += (this.name + "=").length ;
var end = cookies.indexOf( ";", start ) ;
if( end == -1 )
{
end = cookies.length ;
}
var cookievals = cookies.substring( start, end ) ;
var array = cookievals.split( "&" ) ;
for (var prop in array)
{
var keyvalue = array[ prop ].split( ":" ) ;
var key , value ;
key  = unescape( keyvalue[ 0 ] ) ;
value = unescape( keyvalue[ 1 ] ) ;
this.params[ key ] = value ;
}
return true ;
}
function Cookie__store()
{
var val = "" ;
for ( var prop in this.params )
{
if( typeof this.params[ prop ] != "string" )
{
continue ;
}
if(val != "" )
{
val += "&" ;
}
val += escape( prop ) + ":" + escape( this.params[ prop ] ) ;
}
var cookie = "" ;
cookie += this.name + "=" + val ;
if( this.expires )
{
cookie += "; " ;
cookie += "expires=" + this.expires ;
}
if( this.path )
{
cookie += "; " ;
cookie += "path=" + this.path ;
}
if( this.domain )
{
cookie += "; " ;
cookie += "domain=" + this.domain ;
}
if( this.secure )
{
cookie += "; " ;
cookie += "secure" ;
}
document.cookie = cookie ;
}
function Cookie_toString()
{
var str = "" ;
for ( var prop in this.params )
{
if( str != "" )
{
str += "," ;
}
str += prop ;
str += "=" ;
str += this.params[ prop ] ;
}
return str ;
}
function Cookie__open( name, expire, path, domain, secure )
{
var o = new Cookie( name, expire, path, domain, secure ) ;
o._load() ;
return o ;
}
Cookie.open = Cookie__open ;
Cookie.MAX_SIZE = 4096 ;
var c ;
c = Cookie.open( "promo", -1, ids_path, ids_domain, false ) ;
ids_uid = c.get( "uid" ) ;
if( !ids_uid )
{
ids_uid = "t5coNxS-0ecm50cC2FcpDQ" ;
c.put( "uid", ids_uid ) ;
}
c.close() ;
}
)()
