﻿    function CountrySelecting(DropDownListCountry, div_DropDownListState, div_TextBoxState, StarState)
    {
        var country = document.getElementById(DropDownListCountry);
        var dvDdlState = document.getElementById(div_DropDownListState);
        var dvTxtState = document.getElementById(div_TextBoxState);
        var dvStarState = document.getElementById(StarState);
        var show, sort;
        for(var idx = 0; idx < country.options.length; idx ++)
        {
            if (country.options[idx].selected) 
            {
                show = country.options[idx].value;
                if (show != "")
                {
                    if (show == "US")
                    {
                        dvDdlState.style.display = "inline";
                        dvTxtState.style.display = "none";
                        dvStarState.style.display = "inline";
                    }
                    else
                    {
        	            
                        dvDdlState.style.display = "none";
                        dvTxtState.style.display = "inline";
                        dvStarState.style.display = "none";
                    }
                }
                else
                {
                    dvDdlState.style.display = "inline";
                    dvTxtState.style.display = "none";
                    dvStarState.style.display = "inline";
                }
                break;
            }
        }
    }   

    function CountrySelectingBillingAndShipping()
    {
        CountrySelecting('ctl00_ContentPlaceHolderMainContent_ucBillingInfo1_DropDownListCountry', 'ctl00_ContentPlaceHolderMainContent_ucBillingInfo1_div_DropDownListState', 'ctl00_ContentPlaceHolderMainContent_ucBillingInfo1_div_TextBoxState', 'ctl00_ContentPlaceHolderMainContent_ucBillingInfo1_div_StarState');
        CountrySelecting('ctl00_ContentPlaceHolderMainContent_ucShippingInfo1_DropDownListCountry', 'ctl00_ContentPlaceHolderMainContent_ucShippingInfo1_div_DropDownListState', 'ctl00_ContentPlaceHolderMainContent_ucShippingInfo1_div_TextBoxState', 'ctl00_ContentPlaceHolderMainContent_ucShippingInfo1_div_StarState');
    }   
    
    function SetOpacityForImage(imageobject, opacity)
    {            
         if (navigator.appName.indexOf("Netscape") != -1 && parseInt(navigator.appVersion)>=5)
         {
            imageobject.style.MozOpacity=opacity/100;
            imageobject.style.opacity = opacity/100;
         }
         else 
         {
             if (navigator.appName.indexOf("Microsoft") != -1 && parseInt(navigator.appVersion)>=4)
                imageobject.filters.alpha.opacity = opacity;
             else
             {
                if (navigator.appName.indexOf("Opera") != -1)
                {
                    imageobject.style.opacity = opacity/100;                   
                }
                else                
                    {
                        imageobject.style.opacity = opacity;
                    } 
             }
         }
    }  
    function OrderTotal(productprice, taxprice, shipmethod, TotalMessage)
    {
        var shipprice = document.getElementById(shipmethod).value;
        var totalprice = parseFloat(productprice) + parseFloat(taxprice) + parseFloat(shipprice);
        document.getElementById(TotalMessage).innerHTML = "$" + totalprice;        
    }   
