/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
 
function trimString(x) {
	if (x!=null)
		return x.replace(/^\s+|\s+$/g,"");

	return x;
}
 
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = trimString(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

var wOpen = $.cookie('winOpen');

var winPop = function() {
	if(parseInt(wOpen) != 1) {
		$.cookie('winOpen', '1',{path: '/', secure: false });
		$(".mailPop").click();
	}
}

/*Mailing List Popup*/
$(document).ready(function() {
	$("body").append('<a href="http://www.shoplondons.com/mailinglist-pop.html?iframe=true&width=395&height=285" rel="prettyPhoto[iframes]" style="display: none;" onclick="return false;" class="mailPop"></a>');
	var tInfin;
	if(switchMail) {
		tInfin = setTimeout(winPop, (waitTime * 1000));
		$("body").mousemove( function() {
			clearTimeout(tInfin);
			if(parseInt(wOpen) != 1) {
			    tInfin = setTimeout(winPop, (waitTime * 1000));
			}
		});
	}
});

/*sc.fscd.store.pages.v.1.0.0.js*/
try{SC.addVersion('0185', '1.0.000', 'Free Shipping Countdown for the Solid Cactus Mini Cart');}catch(err){}; function SCFSO( ){var fsLimit; var fsInitBanner1=''; var fsDiffBanner1=''; var fsQualBanner1=''; var fsInitBanner2=''; var fsDiffBanner2=''; var fsQualBanner2=''; this.setScFSVars= function (SCFSo){fsLimit=SC.forceFloat(SCFSo['f\x73\x4cimit']); fsInitBanner1=((SCFSo['\x66s\x49\x6eitB\x61nner1'])?SCFSo['fsIni\x74Banner\x31']: ''); fsDiffBanner1=((SCFSo['fsDiffBa\x6ener1'])?SCFSo['f\x73DiffB\x61\x6ene\x721']: ''); fsQualBanner1=((SCFSo['\x66\x73\x51ualB\x61nner1'])?SCFSo['\x66sQua\x6c\x42an\x6e\145\x721']: ''); fsInitBanner2=((SCFSo['\146\x73Init\x42anner2'])?SCFSo['fs\x49nitBa\x6e\x6eer\x32']: ''); fsDiffBanner2=((SCFSo['\x66sIni\x74\x42an\x6e\x65r2'])?SCFSo['\x66sDi\x66\x66Ba\x6e\156\x65r2']: ''); fsQualBanner2=((SCFSo['\146\x73InitB\x61nner2'])?SCFSo['fsQu\x61lBann\x65r2']: ''); };this.initScFSCD= function ( ){try {SCFSY( ); try {scMiniCart.callbacks.refresh.add(SCFSY); }catch (e){}}catch (e){}};function SCFSY( ){var SCFSy=0; if (SC.fromJSON(unescape(SC.getCookie("m\x69nCook-006\x31")))!=null){if (SC.fromJSON(unescape(SC.getCookie("\x6d\x69\x6eCo\x6fk-0061"))).s){SCFSy=SC.forceFloat(SC.fromJSON(unescape(SC.getCookie("minCoo\x6b-0061"))).s); }}var SCFSI=SC.getById('\x66reeSh\x69\x70C\x6funtDown\x42anner\x31'); var SCFSi=SC.getById('\x66reeSh\x69\x70Co\x75ntDownB\x61nner2'); if (SCFSI || SCFSi){if (SCFSy==0){if (SCFSI && fsInitBanner1!=''){SCFSI.innerHTML=fsInitBanner1;}if (SCFSi && fsInitBanner2!=''){SCFSi.innerHTML=fsInitBanner2;}}else if (SCFSy<fsLimit){var SCFSA=SC.toPrice(fsLimit-SCFSy);if (SCFSI && fsDiffBanner1!=''){var SCFSa=fsDiffBanner1.split('@FREE-\x53HIPPI\x4eG-DIFFE\x52\105\x4eCE@'); SCFSI.innerHTML=SCFSa[0]+SCFSA+SCFSa[1]; }if (SCFSi && fsDiffBanner2!=''){var SCFSE=fsDiffBanner2.split('\x40FREE\x2d\x53H\x49\120\x50ING-DI\x46FERENC\x45\100'); SCFSi.innerHTML=SCFSE[0]+SCFSA+SCFSE[1]; }}else if (SCFSy>=fsLimit){if (SCFSI && fsQualBanner1!=''){SCFSI.innerHTML=fsQualBanner1;}if (SCFSi && fsQualBanner2!=''){SCFSi.innerHTML=fsQualBanner2;}}}}}var initScFS=new SCFSO( );
