function shiftValue( f, t, r )
{
    var vt = document.getElementById(t) ;
    var vf = document.getElementById(f) ;

    if( r )
    {
        if( vt )
        {
            vt.value = '';
            return true ;
        }
    }
    else
    {
        if( vt && vf )
        {
            vt.value = vf.value ;
            return true ;
        }

    }
    return false ;
}
function shiftSelect( f, t, c, r )
{
    vt = document.getElementById(t) ;
    vf = document.getElementById(f) ;

    if( r )
    {
        if( vt )
        {
            vt.options.selectedIndex = 0 ;
            if( c )
            {
                updateState1() ;
            }
            return true ;
        }
    }
    else
    {
        if( vt && vf )
        {
            vt.options[vf.options.selectedIndex].selected = true ;
            if( c )
            {
                updateState1() ;
            }
            return true ;
        }

    }
    return false ;
}
function shiftAddress()
{
    var e = document.getElementById('optin');
    var r = false ;

    if( e )
    {
        if( e.checked )
        {
            r = false ;
        }
        else
        {
            r = true ;
        }
    }
    shiftValue( 'customer_firstname', 'customer_firstname1' , r ) ;
    shiftValue( 'customer_lastname', 'customer_lastname1' , r ) ;
    shiftValue( 'company', 'company1' , r ) ;
    shiftValue( 'address1', 'address11' , r ) ;
    shiftValue( 'address2', 'address21' , r ) ;
    shiftSelect( 'id_country', 'id_country1', true , r ) ;
    shiftSelect( 'id_state', 'id_state1' , false , r ) ;
    shiftValue( 'postcode', 'postcode1' , r ) ;
    shiftValue( 'phone', 'phone1' , r ) ;
    shiftValue( 'city', 'city1' , r ) ;
    shiftValue( 'phone_mobile', 'phone_mobile1' , r ) ;

 

    if( r )
    {
        document.getElementById('id_gender11').checked = false ;
        document.getElementById('id_gender21').checked = false ;
    }
    else
    {
        document.getElementById('id_gender11').checked = document.getElementById('id_gender1').checked ;
        document.getElementById('id_gender21').checked = document.getElementById('id_gender2').checked ;

        
    }
}