

function InputValue(){
    var match = 'input.default[@type=text]';

    $(match).focus(function(){
        this.valuedefault = this.valuedefault || this.value;
        if (this.value == this.valuedefault)
            this.value = '';
        $(this).css('color','#656565');
    });
    
    $(match).blur(function(){
        if (this.value.length == 0 || this.value == this.valuedefault)
            $(this).css('color','#656565');
        if (this.valuedefault && this.value.length==0)
            this.value = this.valuedefault;
    });
}




$(document).ready(function() {	

	$('a[name=modal]').click(function(e) {
		e.preventDefault();

		var id = $(this).attr('href');
	
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		var winH = $(window).height();
		var winW = $(window).width();

		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		$(id).fadeIn(2000); 
	
	});
        
          
	
	$('.window .close').click(function (e) {
		
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
	});		
	
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});			
	
});



