Cufon.replace('h1');

$(document).ready(function () {

    var wks_x=$('#wks_x').val();
    var wks_y=$('#wks_y').val();
    if (wks_x && wks_y){
        var map = new GMap2(document.getElementById('google_map'));
        var coords = new GLatLng(wks_x, wks_y);
        var marker=new GMarker(coords);
        map.setCenter(coords, 16);
        map.setUIToDefault();
        map.addOverlay(marker);
        map.enableScrollWheelZoom();
    }

    var search=$('#search');
    if (search){
        title=search.attr( 'title' );
        search.focus(function() {
            if ($(this).val()==title){
                $(this).val('');
            }
            
        });
        search.blur(function(){
            if ($(this).val()==''){
                $(this).val(title);
            }

        });
    }
    
    $('.product_small').hover(
        function () {
            $(this).addClass('product_small_hover');
        },
        function () {
            $(this).removeClass('product_small_hover');
        }
    );
    
    $('#image_navigation a').click(function() {
        $('#image_navigation a').removeClass('active');
        $('#images div').hide();
        $('#image_'+$(this).html()).show();
        $(this).addClass('active');
        return false;
    });
    
    $('#images div a').click(function() {
        $('#image_navigation a').removeClass('active');
        $('#images div').hide();
        $('#image_'+$(this).attr( 'rel' )).show();
        $('#img_nav_'+$(this).attr( 'rel' )).addClass('active');
        return false;
    });
    
});


