function openWindow( pageToLoad, winName, width, height, center)
{
    xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + ","
    + "height=" + height + ","
    + "location=0,"
    + "menubar=0,"
    + "resizable=No,"
    + "scrollbars=1,"
    + "status=0,"
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
}

function CheckRegisterFields()
{
        var account = document.CreateAccount;

        if (account.UserName.value == "") {
                alert("Please enter your 'User Name'.");
                return false;
        }
        else if (account.Password.value == "") {
                alert("Please enter a 'Password'.");
                return false;
        }
        else if (account.Password.value != account.ConfirmPassword.value){
                alert("Your 'Password' and 'Confirm Password' do not match.");
                return false;
        }
        else if (account.Email.value == "") {
                alert("Please enter your 'Email Address'.");
                return false;
        }
        else if (account.Name.value == "") {
                alert("Please enter your 'Name'.");
                return false;
        }

        return true;
}
function CheckPwdFields()
{
        var chgpwd = document.ChangePassword;

        if (chgpwd.OldPwd.value == "") {
                alert("Please enter a 'Old Password'.");
                return false;
        }
        else if (chgpwd.NewPwd.value == "") {
                alert("Please enter a 'New Password'.");
                return false;
        }
        else if (chgpwd.NewPwd.value != account.ConfirmPassword.value){
                alert("Your 'New Password' and 'Confirm Password' do not match.");
                return false;
        }

        return true;
}

function CheckUserFields()
{
        var addr = document.UpdateAcct;

        if (addr.Name.value == "") {
                alert("Please enter your 'Name'.");
                return false;
        }
        else if (addr.Address1.value == "") {
                alert("Please enter a 'Address'.");
                return false;
        }
        else if (addr.City.value == "") {
                alert("Please enter your 'City'.");
                return false;
        }
        else if (addr.provList.value == "") {
                alert("Please enter your 'Province'.");
                return false;
        }
        else if (addr.PostalCode.value == "") {
                alert("Please enter your 'Postal Code'.");
                return false;
        }
        else if (addr.Email.value == "") {
                alert("Please enter your 'Email Address'.");
                return false;
        }

        return true;
}

function CheckSearchKW()
{
        var search = document.searchform;

        if (search.kw.value == "") {
                alert("Please enter keywork to search.");
                return false;
        }

        return true;
}
function confirmPlaceOrder()
{
var agree=confirm("Are you sure you want to place this order?");
if (agree)
        return true ;
else
        return false ;
}

