/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var x = $(document).ready(initCommon);

function initCommon()
{
    $('.delete').click( function() {
        result = confirm('Are you sure you want to delete this entry?');
        return result;
    });

    $('.row').hover(function() {
        $(this).addClass('rowhover');
    }, function() {
        $(this).removeClass('rowhover');
    });
}


/*
 * General Purpose functions
 */

function livehelp() {
    openwin = this.open("http://onlinemachinist.com/chat/livehelp.php?department=1", "livehelp", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=600,height=400,left=175,top=60");
}


function showLoading()
{
    $("#contentLoading").show();
}
function showLoading( msg )
{
    $("#contentLoading").show();
    $("#overlay").show();
	$("#overlay").css('height', $(document).height() + 'px');

    var h = $(document).scrollTop() + 150;
    var w = $(document).width() / 2 - 100;
	$("#contentLoading").css("top",h + "px");
    $("#contentLoading").css("left",w + "px");

    if (msg!= null) $("#contentLoading span").append(msg);

    ("#contentLoading").fadeIn('slow').animate({opacity: 1.0}, 500).fadeOut('slow');
}

