/*
 * SimpleModal Basic Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2009 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: basic.js 185 2009-02-09 21:51:12Z emartin24 $
 *
 */

function SetCookie(cookieName, cookieValue)
{
    document.cookie = cookieName + "=" + escape(cookieValue) + ";path=/";
}

function SetCookieDays(cookieName, cookieValue, nDays)
{
    var today = new Date();
    var expire = new Date();
    if (nDays==null || nDays==0) nDays=1;
    expire.setTime(today.getTime() + 3600000*24*nDays);
    document.cookie = cookieName + "=" + escape(cookieValue) + ";path=/;expires=" + expire.toGMTString();
}

function ReadCookie(cookieName)
{
	var nameEQ = cookieName + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


$(document).ready(function () {
    if (null == ReadCookie('splash_pumpa')) {
        $('#basicModalContent').modal({overlayClose: true , onOpen: function (dialog) {
            dialog.overlay.fadeIn('_default', function () {
                dialog.data.hide();
                dialog.container.fadeIn('_default', function () {
                    dialog.data.slideDown('fast');
                    SetCookie('splash_pumpa', 'seen', 1);
                });
            });
        }});
    }
});
