if (document.all) {
}
else if (document.getElementById) { 
    document.captureEvents(Event.MOUSEDOWN)
}
else if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN)
}

document.onmousedown = mousedown_handler

function mousedown_handler(mouse_event) {

    // This is the message that will appear
    var no_right_click = "Sorry, right-clicking is not allowed!"
    
    if (document.all) {

        //Probably Internet Explorer 4 and later
        if (event.button == 2 || event.button == 3) {
            alert(no_right_click)
            return false
        }
    }
    else if (document.getElementById) { 

        // Probably Netscape 6 and later
        if (mouse_event.which == 3) {
            alert(no_right_click)
            return false
        }
    }
    else if (document.layers) {

        // Probably Netscape 4
        if (mouse_event.which == 3) {
            alert(no_right_click)
            return false
        }
    }
}

function copy_shipping_to_billing(o) {
	// o = document.orderform;
	alert(o.use_shipping.value);
}

function limitChars(textid, limit, infodiv)
{
	var text = $('#'+textid).val(); 
	var textlength = text.length;
	if(textlength > limit)
	{
		$('#' + infodiv).html('You cannot write more then '+limit+' characters!');
		$('#'+textid).val(text.substr(0,limit));
		return false;
	}
	else
	{
		$('#' + infodiv).html('You have '+ (limit - textlength) +' characters left for your Gift Message.');
		return true;
	}
}

