function css() {

	
	$('input[type=text]').clear();
	
}

function ie() {
	/* go on for IE in generall */
	if($.browser.msie){
		
		/* take care IE 6 only */
		if($.browser.version <= 6) {
		
			
			
			$('div:first-child, li:first-child, td:first-child').addClass('first-child');
		
			$('input').each(function(){
				t = $(this).attr('type');
				$(this).addClass(t);
			});
		
		}
		
		$('div:last-child, li:last-child, td:last-child').addClass('last-child');
		
		
	}
	
}

$(document).ready(css);
$(document).ready(ie);


jQuery.fn.clear = function(){
	return this.each(function(i){
		var val;
		
		$(this).focus(function(){ 
			val = $(this).val(); 
			$(this).attr('rel',val)
			$(this).val(''); 
		}); // focus
		
		$(this).blur(function(){ 
			val = $(this).attr('rel');
			if($(this).val() == ''){
				$(this).removeAttr('rel');
				$(this).val(val); 
			}
		});	// blur
		
	}); // each	
};	


jQuery.fn.corners = function(option) {
	option = jQuery.extend({
		tl: 1,
		tr: 1,
		bl: 1,
		br: 1,
		sufix: 1
	}, option);	
	
	return this.each(function(i){	
		path = 'image/';
		
		
		if(option.tl)
			$(this).append('<img src="'+path+'img-cor-'+option.sufix+'-NW.png" class="corner corner-nw" />');
		if(option.tr)
			$(this).append('<img src="'+path+'img-cor-'+option.sufix+'-NE.png" class="corner corner-ne" />');
		if(option.bl)
			$(this).append('<img src="'+path+'img-cor-'+option.sufix+'-SW.png" class="corner corner-sw" />');		
		if(option.br)
			$(this).append('<img src="'+path+'img-cor-'+option.sufix+'-SE.png" class="corner corner-se" />');

		cornerBorder = parseInt($(this).css('border-width'));
		cornerBorder = cornerBorder > 0 ? '-'+cornerBorder+'px' : '0';
		
		
		$(this).css('position','relative').children('.corner').css({
			'position'	: 'absolute',
			'z-index'	: '1'
		});
		
		$(this).children('.corner-nw').css({
			'top'	: cornerBorder,
			'left'	: cornerBorder
		}).next('.corner-ne').css({
			'top'	: cornerBorder,
			'right'	: cornerBorder
		}).next('.corner-sw').css({
			'bottom': cornerBorder,
			'left'	: cornerBorder
		}).next('.corner-se').css({
			'bottom': cornerBorder,
			'right'	: cornerBorder
		});
		
		
			
	}); // each
}

