
var yuiRequestHandleFailure = function(o) {
    document.getElementById('pstatus').style.visibility='hidden';
    document.getElementById('ajaxalert').style.display='';
    document.getElementById('ajaxalertcontent').innerHTML = LANG_ajax_error + o.statusText;
};

function toggleElement(elm) {
    
    var obj = document.getElementById(elm);
    
    if(obj) {
        if(obj.style.display == 'none') {
            obj.style.display = '';
            
        } else {
            obj.style.display = 'none';
        }
    }
}

function checkSearchQuery() {
    var query = document.fsitesearch.query.value;
    if (query == '' || query == LANG_header_search_message)
        return false;
}

YAHOO.namespace("makemovies");

function premAcctAlertInit() {
    YAHOO.makemovies.accountalert = new YAHOO.widget.Panel("premium_alert_panel",
                       { width : "550px",
                         fixedcenter : true,
                         visible : false,
                         zindex: 5000,
                         modal: false,
                         constraintoviewport : true
                      } );
    YAHOO.makemovies.accountalert.render();
    YAHOO.util.Dom.setStyle('premium_alert_panel','display','block');

    var closeEl = YAHOO.util.Dom.get('btn_signup_cancel');
    YAHOO.util.Event.on(closeEl, 'click', function(e){ YAHOO.makemovies.accountalert.cfg.setProperty("visible",false); });

}

YAHOO.util.Event.onDOMReady(premAcctAlertInit);


function makeMovieRequest(uuid,channel,premiumAccount) {

    if (premiumAccount != 1) {
        YAHOO.makemovies.accountalert.cfg.setProperty("visible",true);
    } else {

        document.location = siteurl + '/makemovies/new_movie/?template=' + uuid + '&channel=' + channel;
    }
}

function remixMovieCheckRequest(premiumAccount) {
    if (premiumAccount != 1) {
        YAHOO.makemovies.accountalert.cfg.setProperty("visible",true);
        return false;
    } else {
        return true;
    }
}

