Event.observe(window,'load',function(){
	var cookie = getCookie('goodcookie');
	if(cookie != 'yumm') {
		alert('Your browser has the use of "cookies" disabled.\nPlease enable third party cookies in order to use this website');
	}
});

function joinNow() {
	new Ajax.Request('register/postEngine',{
	    method:'post',
		parameters:{action:10, type:'json'},
		onComplete:function(transport) {
			var json = transport.responseText.evalJSON();
			if(json.logged == 1) {
				if(json.subscribed == 1) {
				    location.href = 'entry';
				} else {
					Lightview.show({
                        href: 'register/iface/credit',
                        rel: 'ajax',
                        title: 'Welcome to ReallyWoolly.com, powered by FraboomLIVE!  Join the camp!',
		                overflow: 'hidden',
                        options: {
                            width: 720,
		                    height: 420,
                            ajax: {
                                method: 'get',
                                evalScripts: true
                            }
                        }
                    });
				}
			} else {
				login();
			}
		}
	});
}

function login() {
	Lightview.show({
        href: 'register/iface/login',
        rel: 'ajax',
        title: 'Welcome to ReallyWoolly.com!',
		overflow: 'hidden',
        options: {
            width: 720,
		    height: 380,
            ajax: {
                method: 'get',
                evalScripts: true
            }
        }
    });
}

function password() {
	Lightview.show({
        href: 'register/iface/retrieve',
        rel: 'ajax',
        title: 'Login information retrieval - ReallyWoolly.com',
		overflow: 'hidden',
        options: {
            width: 300,
		    height: 90,
            ajax: {
                method: 'get',
                evalScripts: true
            }
        }
    });
}

function popup(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600,left = 240,top = 212');");
}

function sneakpeek() {
    new Ajax.Request('register/postEngine',{
	    method:'post',
	    parameters:{action:0, type:'json'},
		onComplete:function(transport){
			var json = transport.responseText.evalJSON();
		    if(json.flag == 'true') {
				location.href = 'sneakpeek';
			} else {
				Lightview.show({
                    href: 'register/iface/register',
                    rel: 'ajax',
                    title: 'Welcome to ReallyWoolly.com!  Registration is FREE!',
		            overflow: 'hidden',
                    options: {
                        width: 740,
		                height: 450,
                        ajax: {
                            method: 'get',
                            evalScripts: true
                        }
                    }
                });
			}
		}
	});	
}

function update() {
    new Ajax.Request('register/postEngine',{
	    method:'post',
	    parameters:{action:0, type:'json'},
		onComplete:function(transport){
			var json = transport.responseText.evalJSON();
		    if(json.flag == 'true') {
				Lightview.show({
                    href: 'register/iface/update',
                    rel: 'ajax',
                    title: 'Profile update form - ReallyWoolly.com',
		            overflow: 'hidden',
                    options: {
                        width: 700,
		                height: 375,
                        ajax: {
                            method: 'get',
                            evalScripts: true
                        }
                    }
                });
			} else {
				login();
			}
		}
	});	
}
/*
document.observe('lightview:hidden', function(event) {
	login();
});
*/