function openScript(url) {
        var Win = window.open(url, 'newspop', config='width=420,height=200,resizable=0,scrollbars=no,menubar=no,status=no');
}
function openScript1(url) {
        var Win = window.open(url, 'newspop', config='width=460,height=220,resizable=0,scrollbars=no,menubar=no,status=no');
}
function openScript2(url) {
        var Win = window.open(url, 'newspop', config='width=480,height=300,resizable=0,scrollbars=yes,menubar=no,status=no');
}
function openScript3(url) {
        var Win = window.open(url, 'newspop', config='width=500,height=300,resizable=0,scrollbars=no,menubar=no,status=no');
}
function openScript4(url) {
        var Win = window.open(url, 'newspop', config='width=560,height=400,resizable=0,scrollbars=no,menubar=no,status=no');
}
function openScript5(url) {
        var Win = window.open(url, 'newspop', config='width=640,height=500,resizable=0,scrollbars=yes,menubar=no,status=no');
}
function openScript6(url) {
        var Win = window.open(url, 'newspop', config='width=680,height=500,resizable=0,scrollbars=yes,menubar=no,status=no');
}
function openScript7(url) {
        var Win = window.open(url, 'newspop', config='width=700,height=500,resizable=0,scrollbars=yes,menubar=no,status=no');
}
function openScript8(url) {
        var Win = window.open(url, 'newspop', config='width=740,height=500,resizable=0,scrollbars=yes,menubar=no,status=no');
}
function onColor(source) {
source.style.backgroundColor='#ffffff';
}
function ofColor(source) {
source.style.backgroundColor='#ffffff';
}
function ofTextbox(source) {
source.style.backgroundColor='#FFFFFF';
}
function ofCheckbox(source) {
source.style.backgroundColor='#E8F7DF';
}
function ClearButtons() {  
if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a");  
 for (var i=0; i<anchors.length; i++) {  
 var anchor = anchors[i];  
 anchor.blur();  
 }  
}
function LinkUp()
{
var number = document.DropDown.DDlinks.selectedIndex;
location.href = document.DropDown.DDlinks.options[number].value;
}
//This function is used on the Paypal page and verifies that the
//amount entered is a double (valid money)
function verifyMoney(value) {
    //alert("value is: " + value);
}
function currency(num) {

}
function formatCurrency(textbox) {
    var num;
    num = textbox.value;
    num = num.toString().replace(/\$|\,/g,'');
    if (isNaN(num)) {
        alert("Please enter a valid number");
        textbox.select;
        textbox.focus();
        return false;
    } else {
        sign = (num == (num = Math.abs(num)));
        num = Math.floor(num * 100 + 0.50000000001);
        cents = num % 100;
        num = Math.floor(num / 100).toString();
        if (cents < 10)
            cents = "0" + cents;
        //for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
        //num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));
        //return (((sign) ? '' : '-') + '$' + num + '.' + cents);
        var output;
        output = ((sign) ? '' : '-') + num + '.' + cents;
        //alert(output);
        textbox.value = output;
        return true;
    }
}
function handleSubmit()
{
	var shippingMethod = document.getElementById("shippingMethod").value;
	if (shippingMethod == 1) {
		Interoffice.submit();
		//alert("Will be submitting form for Interoffice");
	} else if (shippingMethod == 2) {
		Pickup.submit();
		//alert("Will be submitting form for Pickup");
	} else if (shippingMethod == 3) {
		HomeDelivery.submit();
		//alert("Will be submitting form for Home Delivery");
	} else {
		alert("Please select a shipping method");
		document.getElementById("shippingMethod").focus();
		return false;
	}
}


