if (document.images)
{
mapPic1= new Image();
mapPic2= new Image();
mapPic3= new Image();
mapPic4= new Image();
mapPic5= new Image();
mapPic6= new Image();
mapPic7= new Image();
mapPic8= new Image();
mapPic9= new Image();
mapPic10=new Image();
mapPic11=new Image();
mapPic12=new Image();
mapPic13=new Image();
mapPic14=new Image();
mapPic15=new Image();
mapPic1='mapImages/map-1x1.gif';
mapPic2='mapImages/map-2x1.gif';
mapPic3='mapImages/map-2x3.gif';
mapPic4='mapImages/map-3x1.gif';
mapPic5='mapImages/map-3x2.gif';
mapPic6='mapImages/map-3x3.gif';
mapPic7='mapImages/map-3x4.gif';
mapPic8='mapImages/map-4x1.gif';
mapPic9='mapImages/map-4x2.gif';
mapPic10='mapImages/map-4x3.gif';
mapPic11='mapImages/map-4x4.gif';
mapPic12='mapImages/map-4x5.gif';
mapPic13='mapImages/map-4x6.gif';
mapPic14='mapImages/map-4x7.gif';
mapPic15='mapImages/map-4x8.gif';
}

function openApplication(url) {
    var settings = "width=1000,height=625,location=no,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no,top=5,left=5";
    window.open(url, "", settings);
}

function closeFlashProductDetail() {
    var oFrame = document.getElementById("b2cFlashCatalog_embedFrame");
    oFrame.contentWindow.closeFlashProductDetail();
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



//2 functions used on checkout page for address setting
function checkoutShippingAddressAdjust() {
    try {
        var form = document.getElementById("formCheckout");
        var isDisabled = false;
        
        for (var loop=0; loop < form.length; loop++) {
            var oElement = form[loop];
            try {
                var id = new String(oElement.id);
                
                if (id.indexOf("shippingAddressSameAsBilling", 0) > 0) {
                    isDisabled = oElement.checked;
                }
                
                if (isShippingAddressField(id)) {
                    oElement.disabled = isDisabled;
                }
            } catch (oError) {
                continue;
            }
        }
    } catch (oError) {
        return;
    }
}

function isShippingAddressField(fieldName) {
    
    try {
        if (fieldName.indexOf("shippingAddressRecipientTextBox", 0) > 0) {
            return true;
        }
        
        if (fieldName.indexOf("shippingAddressCountryDropDownList", 0) > 0) {
            return true;
        }
        
        if (fieldName.indexOf("shippingAddress1TextBox", 0) > 0) {
            return true;
        }
        
        if (fieldName.indexOf("shippingAddress2TextBox", 0) > 0) {
            return true;
        }
        
        if (fieldName.indexOf("shippingAddressCityTextBox", 0) > 0) {
            return true;
        }
        
        if (fieldName.indexOf("shippingAddressStateRegionTextBox", 0) > 0) {
            return true;
        }
        
        if (fieldName.indexOf("shippingAddressRegionDropDownList", 0) > 0) {
            return true;
        }
        
        if (fieldName.indexOf("shippingAddressPostalCodeTextBox", 0) > 0) {
            return true;
        }
    } catch (oError) {
        return false;
    }
    
    return false;
}
//end checkout page functions

