Cufon.replace('#page-title h1', { fontFamily: 'Gotham Medium' });
Cufon.replace('#menu a', 
	{ 
		fontFamily: 'Gotham Medium',
		hover: {
			color: '#4988a4'
		}
	}
);
Cufon.replace('#startpagecontent .cuf', { fontFamily: 'Gotham Bold' });
Cufon.replace('#ourservice h2', { fontFamily: 'Gotham Bold' });
Cufon.replace('#lang_rub', { fontFamily: 'Gotham Medium' });


function go(url){
	location.href=url;
}


$(document).ready(function()
{
    $(".search").focus(function(srcc)
    {
        if ($(this).val() == $(this)[0].title)
        {
            $(this).removeClass("defaultTextActive");
            $(this).val("");
        }
    });
    
    $(".search").blur(function()
    {
        if ($(this).val() == "")
        {
            $(this).addClass("defaultTextActive");
            $(this).val($(this)[0].title);
        }
    });
    
   	 
	var mouse_is_inside = false;
	
	$('#help a').bind({
	  click: function() {
	  	mouse_is_inside = true;
		//alert(mouse_is_inside);
	    $('#showhelp').toggle();
	  }
	});
	
	
	
	$('body').bind({
		click: function(){
			 //event.stopPropagation();
			if($('#showhelp').is(":visible") && !mouse_is_inside)
				$('#showhelp').hide();
		}
	})
	
	$('#showhelp').hover(function(){ 
        mouse_is_inside=true; 
    }, function(){ 
        mouse_is_inside=false; 
    });
	
	$('#help a').hover(function(){ 
        mouse_is_inside=true;
    }, function(){ 
        mouse_is_inside=false;
    });
	
	
	$('.searchbtn').bind({
		click: function(){
			$("#testform").submit();
		}
	});
	
	
	$(function() {
			$( "#ad_tags" ).autocomplete({
				source: projects,
				focus: function( event, ui ) {
					$( "#ad_tags" ).val( ui.item.label );
					return false;
				},
				select: function( event, ui ) {
					$( "#ad_tags" ).val( ui.item.label );
					$( "#ad_hidden" ).val( ui.item.value );
					$( "#ad_id" ).val( ui.item.id );		
					//alert($( "#ad_id" ).val());
					return false;
				}
			});
		});	
	
	

});

function searchfor(x){
	
	var id = "#id_" + x;
	var title = "#title_"+x;
	var value = "#val_"+x;
	
		$( "#ad_tags" ).val( $(title).val() );
		$( "#ad_hidden" ).val($(value).val() );
		$( "#ad_id" ).val( $(id).val() );
	
	
		$("#testform").submit();
	}
