﻿/*
    Wizetrade TV Script Library
    Author: Joel Dow
*/

var $j = jQuery.noConflict();

$j(document).ready(function() {
    //This will only happen on the login page.
    try {
        if ($j('#globalLoginUsername').attr('value') == '')
            $j('#globalLoginUsername').focus();
        else
            $j('#globalLoginPassword').focus();
    }
    catch (err) { alert(err); }
});

function copy(text) {
    try
    {
        $j.copy(text);

        log('copy', 'Attempt to copy text to clipboard');
    }
    catch(e){alert(e);}
}

//function logout(url) {
//    $j('.SilverlightPlayer').fadeOut('slow', function() {
//        location.href = url;
//    });
//}

//Firebug logging
function debug(method, message) {
    try {
        console.debug('%s - %s', method, message);
    } catch (e) { }
}

function info(method, message) {
    try {
        console.info('%s - %s', method, message);
    } catch (e) { }
}

function warning(method, message) {
    try {
        console.warn('%s - %s', method, message);
    } catch (e) { }
}

function error(method, message) {
    try {
        console.error('%s - %s', method, message);
    } catch (e) { }
}

function log(method, message) {
    try {
        console.log('%s - %s', method, message);
    } catch (e) { }
}