hov=new Image(139,23);
hov.src="/Data/1112/UserFiles/images/add_hover.png";
hov=new Image(238,32);
hov.src="/Data/1112/UserFiles/images/add_b_hover.png";


$(document).ready(function(){

	$('ul.tabs').tabs('div.panes > div');
	$('#productParameters dt:first, #productParameters dd:first').css('border',0);
	
	$('#left ul.Cat li.selected > a').css('text-decoration','underline');
	$('.ShopProductParentCategories ul').prepend('<li><a href="/">Úvod</a>  &gt;&gt; </li>');

	$("#productparams table tr:nth-child(odd), table#order tr:nth-child(odd)").addClass('odd');
  	$("#productparams table tr:nth-child(even), table#order tr:nth-child(even)").addClass('even');
	$("table#order").before('<h2>Moje objednávky</h2>');
	
	$("#special_buttons .comparelink a").html("Pridať produkt do porovnania");
	$("#special_buttons .comparelink img").parent().html("Produkt je pridaný do porovnania");	
	$(".prorating .message").remove();
	
	$("#paymentsBox .payment:nth-child(odd)").addClass('odd');
  	$("#paymentsBox .payment:nth-child(even)").addClass('even');
	
	$(".WithBorder tr:nth-child(1)").addClass('header');
	
	if($('#right .SeenProducts').length){
		var seencontent = $('#right .SeenProducts').html();
		$('#right .SeenProducts').removeClass('SeenProducts').addClass('basic002 seenproductbox').html('<h2 class="title">Naposledy videné</h2><div class="content">'+seencontent+'</div>');
	}

	/* inline label pre query */
	input_query = $('#adresat');
	input_query.attr('value', input_query.attr('title')).bind('focus', function(){	
		if (input_query.attr('value') == input_query.attr('title')) {
			input_query.attr('value', '').removeClass('empty');
		}
	}).bind('blur', function(){
		if ((input_query.attr('value') == '') || (input_query.attr('value') == input_query.attr('title'))) {
			input_query.attr('value', input_query.attr('title')).addClass('empty');
		}
	});
	
	/* /inline label pre query */
	
	$('.totop').click(function() {
		 goToByScroll("top");
     	return false;
     });

	/* oprava png s alpha kanálom pre IE5.5 a IE6 */
	if ($.browser.msie && $.browser.version < 7) {
		$(this).find('*').each(function() {
			
			b = $(this).css('background-image');
			if (b.indexOf('.png') != -1) {
				var f = b.split('url("')[1].split('")')[0];
				$(this).css('background-image', 'none');
			}
	
			if ($(this).is('[src$=.png]')) {
				var f = $(this).attr('src');
				$(this).attr({
					src: '/Data/default/UserFiles/images/blank.gif',
					width: $(this).width(),
					height: $(this).height()
				});
			}
	
			if (f) $(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + f + "')";
		});
	}
	/* /oprava png s alpha kanálom pre IE5.5 a IE6 */

});

function goToByScroll(id){
	$('html,body').animate({scrollTop: $("#"+id).offset().top},500);
}
