function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
	for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i]; }}
}

var userAgent = navigator.userAgent.toLowerCase();

var browser = {
    userAgent: navigator.userAgent.toLowerCase(),
    version: (userAgent.match( /(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
	safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ),
	opera: /opera/.test( userAgent ),
	msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
	mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ),
	chrome: /chrome/.test( userAgent )
};

// ------------------------ popUp window ----------------------------------

function OpenPicture(pic_name)
{
var argv = OpenPicture.arguments;
var argc = OpenPicture.arguments.length;	
var W = (argc > 1) ? argv[1] : 725;
var H = (argc > 2) ? argv[2] : 620;
var w = window.screen.width;
var h = window.screen.height;
var X = w-W;
//Math.ceil((w-W)/2);
var Y = 0;
//Math.ceil((h-H)/2);

window.open("picture.html?" + pic_name, "_blank", "top=" + Y +", left=" + X +", width=" + W +", height=" + H +", scrollbars=1, status=0, menubar=0");

}

function OpenCenterWindow(url)
{
var argv = OpenCenterWindow.arguments;
var argc = OpenCenterWindow.arguments.length;	
var w = window.screen.width;
var h = window.screen.height;
var W = (argc > 1) ? argv[1] : 600;
var H = (argc > 2) ? argv[2] : h;
var X = Math.ceil((w-W)/2);
var Y = 0;
//Math.ceil((h-H)/2) - 20;

window.open(url, "_blank", "top=" + Y +", left=" + X +", width=" + W +", height=" + H +", scrollbars=1, status=0, menubar=0");

}
 
// -------------------------------------- Exit popup ---------------------------------------

var ShowExitPopup = true;

function ExitPage()
{
if (ShowExitPopup) { 
ShowExitPopup = false;
location.href = top.document.location + "#buy";

return "*************************************************\nWait! Hold On A Second!\n\nSorry to see you leaving without giving LifeCell a try.\nListen, Hollywood actors, celebrities, supermodels and\neven...European Royalty... use LifeCell (based on Nobel\nPrize-winning science) to keep their skin looking young,\nbeautiful, and age-free without cosmetic injections or\nplastic surgery!\n\nAnd when you get yours today, we'll give you $400 in BONUSES\n for FREE - just for trying LifeCell. That's right. $400.00 of \nbonuses yours to keep even if you return back LifeCell!\n\nRemember, LifeCell comes with the strongest guarantee in the\ncosmetics industry:  Try it free - pay no money for 30-days,\nhave a total of 120-days (4 months) money-back-guarantee.\nWe are not asking you to buy... just try it without risking a dime.\n\nClick on the CANCEL button to stay on this webpage and get\nLifeCell plus $400 value Bonuses for FREE!\n\n*************************************************";
                    }
}

function getCookieVal( offset )
{
    var endstr = document.cookie.indexOf (";", offset);

    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name)
{
    var arg  = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i    = 0;

    while (i < clen)
    {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
          return getCookieVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return null;
}

function SetCookie( name, value )
{
    var argv    = SetCookie.arguments;
    var argc    = SetCookie.arguments.length;
    var expiredays = (argc > 2) ? argv[2] : null;
    var path    = (argc > 3) ? argv[3] : null;
    var domain  = (argc > 4) ? argv[4] : null;
    var secure  = (argc > 5) ? argv[5] : false;
    
	
	var ExpDate = new Date();
        ExpDate.setDate(ExpDate.getDate() + expiredays);
	
    document.cookie =
        name + "=" + escape (value) +
        ((expiredays == null) ? "" : ("; expires=" + ExpDate.toGMTString())) +
        ((path == null) ? "" : ("; path=" + path)) +
        ((domain == null) ? "" : ("; domain=" + domain)) +
        ((secure == true) ? "; secure" : "");
}