function ConfirmDelete()
{
	var i=confirm("Are you sure you want to DELETE this item?");
	if(i)
	{
		return true;
	}else{
		return false;
	}
}
function ConfirmPending(type)
{
    if(type == 'approve')
	   var i=confirm("Are you sure you want to APPROVE this theme?");
	else if(type == 'disable')
	   var i=confirm("Are you sure you want to DISABLE this theme?");
	if(i)
	{
		return true;
	}else{
		return false;
	}
}

window.addEvent('domready', function(){
    SqueezeBox.initialize({});
    SqueezeBox.assign($$('a[rel=boxed]'));
    SqueezeBox.assign($$('a.boxed'), {
        parse: 'rel'
    });
    
    
   //store titles and text
	$$('a.tipz').each(function(element,index) {
		var content = element.get('title').split('::');
		element.store('tip:title', content[0]);
		element.store('tip:text', content[1]);
	});


    var tipz = new Tips($$('.tipz'), {
    	timeOut		: 700,
    	maxTitleChars	: 50,
    	hideDelay		: 200,
    	className		: 'tipztop', //for you yo use in the css classes being then .tip .tip-title and .tip-text
    	initialize: function() { this.tip.fade('hide'); },
        onShow		: function(tip){
    	   tip.fade('in');
    	},
		onHide: function(tip) {
			tip.fade('out');
		}
    });
    
    //BLightBox = new SLightBox({color:'black', find:'BLightBox', Skin:{ 'black' : { 'hexcolor': '#000000', 'captionColor': '#FFFFFF', 'background-color': '#000', 'opacity': 0.7 }}});
    //myTips.tip.set('tween',{duration: 200});
    
    Sexy = new SexyAlertBox();
});


function okcas(f){
var c=[38,38,40,40,37,39,37,39,66,65,13],x=function(){x.c=x.c||Array.apply({},c);x.r=function(){x.c=null};return x.c},h=function(e){if(x()[0]==(e||window.event).keyCode){x().shift();if(!x().length){x.r();f()}}else{x.r()}};window.addEventListener?window.addEventListener('keydown',h,false):
document.attachEvent('onkeydown',h)
}
okcas(function()
{
    Sexy.error('<h1>Konami Kode</h1><br/><p>You have unlocked the special Konami Kode secret. Sorry it does nothing special at the moment, check back.</p>');
});

function Deak(f){
var c=[80,77,68,69,65,75],x=function(){x.c=x.c||Array.apply({},c);x.r=function(){x.c=null};return x.c},h=function(e){if(x()[0]==(e||window.event).keyCode){x().shift();if(!x().length){x.r();f()}}else{x.r()}};window.addEventListener?window.addEventListener('keydown',h,false):
document.attachEvent('onkeydown',h)
}
Deak(function()
{
    //alert('Deak');
    document.location = 'http://wii.spiffy360.com/messages.php?compose=1&usr=Deak Phreak';
});


function ShowNotes(themeid)
{
    var i = document.getElementById('AdminNotes_'+themeid).style.display;
    
    if(i == 'none')
        document.getElementById('AdminNotes_'+themeid).style.display = 'inline';
    else
        document.getElementById('AdminNotes_'+themeid).style.display = 'none';
}

function UpdateNotes(themeid)
{
    var note = document.getElementById('themenote_'+themeid).value;
    var req = new Request({
		method: 'get',
		url: 'http://wii.spiffy360.com/index.php',
		data: { 'tnid' : themeid , 'updatenote' : note },
		onComplete: function(response)
        {
            $('NotesMessage_'+themeid).set('html', response);
		}
	}).send();
}
