function SHopenWindow()
{
  theWindow = window.open("shippingpolicy.php", 'shippinginfo', 'width=530,height=410,scrollbars=yes,resizable=yes');
  theWindow.focus();
}

function checkSpaces(strValue)
{
    var flag = true;

    if( strValue != "" )
    {
        for( var i=0; i < strValue.length; i++ )
        {
            if( strValue.charAt(i) != " " )
            {
                flag = false;
                break;
            }
        }
    }
    return flag;
}

function qtySubmit()
{
    var theform = document.qty;
    for( var whichProd in theform )
    {
        //alert( "Testing!! "+whichProd.substring( 0, 8 ) );
        if( whichProd.substring( 0, 8 ) != 'quantity' ) continue;
        if( theform[whichProd].type != 'text' ) continue;

        checkQuant = theform[whichProd].value;
        if( checkSpaces(checkQuant) || isNaN(checkQuant) )
        {
            alert( "An invalid quantity was specified: "+whichProd+"\n"+
                   "Please correct it before continuing." );
            return;
        }
    }
    document.qty.submit();
}

function doRemove(index)
{
    document.qty.remove.value = index;
    qtySubmit();
}
