$(document).ready(function() {
	if ($('#product_input').attr('value') == $('#product_input').attr('defaultValue')) {
		$('#product_input').addClass('default_input_text');
	}
	
	$('#product_input').focus(function() {
		if ($(this).attr('value') == $(this).attr('defaultValue')) {
			$(this).removeClass('default_input_text');
			$(this).attr('value', '');
		}
	})
	.blur(function() {
		if ($(this).attr('value').length == 0) {
			$(this).addClass('default_input_text');
			$(this).attr('value', $(this).attr('defaultValue'));
		}
	});
	
	
	$('#bookmark').click(function(event) {
		// add a "rel" attrib if Opera 7+
		if (window.opera) {
			if ($(this).attr('rel') != '') {
				$(this).attr('rel', 'sidebar');
			}
		}
		
		event.preventDefault();
		var url = $(this).attr('href');
		var title = $(this).attr('title');
		
		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url, '');
		}
		else if (window.external) { // IE Favorite
			window.external.AddFavorite(url, title);
		}
		else if(window.opera) { // Opera 7+
			return false; // do nothing - the rel="sidebar" should do the trick
		}
		else { // for Safari, Konq etc - browsers who do not support bookmarking scripts
			alert('Xin lỗi, trình duyệt của bạn không hỗ trợ lưu địa chỉ web.');
		}
	});
});
