﻿//Disable the control that submits the form
function submitFormOnce(sender) {
   if (sender.disabled==false) {
        document.aspnetForm.submit();
        sender.disabled=true;
    } else {
        return false;
    }
}
//prints the contents of an iFrame and blocks the form submit
function printiFrame() {
    top.ifrm.focus();
    top.ifrm.print();
    return false;
}

//Goes back one page in the browser history
function backPage() {
    document.aspnetForm.submit=true;
    window.history.go(-1);
    return false;
}

//Confirms that the button action is t/f
function confirmClick(sMsg) {
    if (confirm(sMsg)) {
        //alert('Action confirmed!');
        document.aspnetForm.action='';
        document.aspnetForm.submit();
    } else {
        //alert('** Block Action **');
        return false;
    }
}

//Kills the enter key on a text box
function killEnter(myfield,e) {
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    if (keycode == 13) {
        return false;
    } else {
        return true;
    }
}

//Checks for the barcode being entered
function checkForBarcode(sender,e) {
    //alert(getKeyCode(e));
    //222=#
    //56=*
    if (getKeyCode(e)==56) {
        if (event.shiftKey==1) {
		    sender.value='';
		    aspnetForm.parkFocus.focus();
		    return false;
		}
    }
}

//Returns the key code
function getKeyCode(e) {
    if (window.event)
        return window.event.keyCode;
    else if (e)
        return e.which;
    else
    	return null;
}

var shim = 'gfx/blank.gif';

$(document).ready(function() 
{
    // font end image fading
    if ($(".product-image-container").length > 0)
    {
        $('.product-image-container').cycle(
        {
            fx: 'fade',
            random: 1,
            speed: 1500,
            timeout: 5000
        });
    }
});

function ShowDiv(s) {
    //alert('in');       
    s.style.visibility = 'visible';
    s.style.display = 'block';
}

function HideDiv(s) {
    //alert('out');
    s.style.visibility = 'hidden';
    s.style.display = 'none';
}