window.onload = function()
{
    if (navigator.product=="Gecko" && navigator.userAgent.indexOf("rv:1.7")>=-1)
    {
	var s=document.body.style;
	s.display="none";
	s.display="";
    }
	setBoxesPosition();
}
var time=new Date();
var url = document.location;
var nazwa = 'Kuchnie-Halupczok';
var setT=0;

function checkEmail(email)
{
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (!filter.test(email))
        return false;
    else
        return true;
}


function trim (str)
{
    var str = str.replace(/^\s+/, '');
    for (var i = str.length - 1; i >= 0; i--)
    {
	if (/\S/.test(str.charAt(i)))
	{
	    str = str.substring(0, i + 1);
	    break;
	}
    }
    return str;
}

function ulubione()
{
    if (window.sidebar) window.sidebar.addPanel(nazwa, url, "");
    window.external.AddFavorite(url, nazwa);
}

function set_bg_image(src)
{
    $('#bg_image').css('backgroundImage','url(\'files/produkty/bg_'+src+'\')');
    $('#frame_main_bg').css('backgroundImage','url(\'files/produkty/st_'+src+'\')');
	change_product_image(src);
	return false;
}

function rem_sale()
{
	//alert(0);
	//if($('#pageflip').css('display')!='none')
		$("#pageflip img").stop() 
			.animate({
				width: '0px', 
				height: '0px'
			}, 520);
		$(".msg_block").stop() 
			.animate({
				width: '0px', 
				height: '0px'
			}, 500);
		//$('#pageflip').delay(600).hide();
}

function change_product_image(src)
{
	if ($('div.product_photos').length==1)
	{
		var img=[];
		var cur="";
		$('div.product_photos').find('a').each(function(index){
			img[index]=$(this).attr('href').replace("files/produkty/","");
			if (img[index]==src)cur=index;
		});
		if (!isNaN(cur))
		{
			var next="",prev="";
			if (cur==0){next=2;prev=1;}
			else
			{
				next=cur+1;
				prev=cur-1;
			}
			if (next>img.length-1&&img.length>2)next=0;
			else if(next>img.length-1)next="";
			
			var _img = $("<img>").hide().bind("load",function(){
				$(this).fadeIn(300);
				if (isNaN(next))setBoxesPosition();
			});
			var _img1 = $("<img>").hide().bind("load",function(){
				$(this).fadeIn(300);
				setBoxesPosition();
			});
			/*_img.bind("load",function(){
				$(this).fadeIn(300);
				if (data.photo_n=="")setBoxesPosition();
			});*/
			/*_img1.bind("load",function(){
				$(this).fadeIn(300);
				setBoxesPosition();
			});*/
	
			if (!isNaN(prev) && $('#prev_product').length==1 && $('#prev_product').css('display')!="none")//'width':'222','text-align':'right'
			{	
				//$('#prev_product').unbind('click').removeAttr('style').css({'display':'block','height':'auto','width':'auto'}).removeAttr('onclick').bind('click',function(){set_bg_image(img[prev]);return false}).html('<image src="files/produkty/ou_'+img[prev]+'" alt="" style="max-width:222px;max-height:150px" />');
				$('#prev_product').unbind('click').removeAttr('style').css({'display':'block','height':'auto','width':'auto'}).removeAttr('onclick').bind('click',function(){set_bg_image(img[prev]);return false}).html(_img);
				_img.attr('src','files/produkty/ou_'+img[prev]).attr('alt','').css({'max-width':'222','max-height':'150'});
		
			}
			if (!isNaN(next) && $('#next_product').length==1 && $('#next_product').css('display')!="none")
			{
				//$('#next_product').unbind('click').removeAttr('style').css({'display':'block','height':'auto','width':'auto'}).removeAttr('onclick').bind('click',function(){set_bg_image(img[next]);return false}).html('<image src="files/produkty/ou_'+img[next]+'" alt="" style="max-width:222px;max-height:150px" />');
				$('#next_product').unbind('click').removeAttr('style').css({'display':'block','height':'auto','width':'auto'}).removeAttr('onclick').bind('click',function(){set_bg_image(img[next]);return false}).html(_img1);
				_img1.attr('src','files/produkty/ou_'+img[next]).attr('alt','').css({'max-width':'222','max-height':'150'});
			}
			//if (!isNaN(next) || !isNaN(prev))setBoxesPosition();
		}
	}
}

function set_vtext(text)
{
    window.document.vtext.SetVariable('verticalText', text.toUpperCase());
}

function product_category(category)
{
	 if ($('div.jspContainer').length==0)$('#frame_main_right').jScrollPane({showArrows:true,maintainPosition: false});
    var api=$('#frame_main_right').data('jsp');
	$('.small_box_product_info').remove();
	$('#main_anchor').remove();
    $.ajax({
        type: "POST",
        data: "category="+category,
	dataType: 'json',
	url: "ajax/product_category.php",
	beforeSend: function()
	{ 
		clearTimeout(setT);
		api.getContentPane().html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
		api.reinitialise();
		//$('#frame_main_right').html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
	},
	success: function(data, status)
	{
		
		set_vtext(data.vtext);
		$('div.menu_lightbox').hide();
		$('div.footer').css('padding-bottom',10);
		//$('#bg_image').css('backgroundImage','none');
		$('#bg_image').css('backgroundImage','url(\'files/produkty/bg_1302779548855_3.jpg\')');
		$('#frame_main_bg').css('backgroundImage','none');
		$('#prev_product').hide();
		$('#next_product').hide();
		$('.frame_news').text("");
		$('#frame_main_left').show();
		$('#frame_main_right').show().css('width','890px');
	    if(category!='10,11,12'){
			api.getContentPane().html(data.result);
			api.reinitialise();
		}else{
			api.getContentPane().html(data.result);
			$('div.jspPane').width('890px');
		}
		if (data.result.indexOf("<img")!=-1)setTimeout((function() {var api=$('#frame_main_right').data('jsp');api.reinitialise();}),1000);		
	    $('#stat24').html('<'+'scr'+'ipt type="text/javascript" src="http://s1.hit.stat24.com/_'+(new Date()).getTime()+'/script.js?id=bI4w5JB4p1OMaE3Y_wHAdpdRj70gYVu9biOAwaCMgy3.k7/l=11"></'+'scr'+'ipt>');
		// $('#frame_main_right').show().css('width','890px').html(data.result);
	},
	error: function (data, status, e)
	{
	    alert(e);
	}
    });	
	rem_sale();
	return false;
}

function contact(id, lang)
{
    if ($('div.jspContainer').length==0)$('#frame_main_right').jScrollPane({showArrows:true,maintainPosition: false});
    $('.small_box_product_info').remove();
    $('#main_anchor').remove();
    var api=$('#frame_main_right').data('jsp');
    $.ajax({
        type: "POST",
        data: "contact="+id+"&lang="+lang,
	dataType: 'json',
	url: "ajax/contact.php",
	beforeSend: function()
	{
		api.getContentPane().html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
		api.reinitialise();    	
		//$('#frame_main_right').html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
	},
	success: function(data, status)
	{
	    set_vtext(data.vtext);
	    $('div.menu_lightbox').hide();
	    $('div.footer').css('padding-bottom',10);
	    //$('#bg_image').css('backgroundImage','none');
	    $('#frame_main_bg').css('backgroundImage','none');
	    $('#prev_product').hide();
	    $('#next_product').hide();
	    $('.frame_news').text("");
	    $('#frame_main_left').show();
	    $('#frame_main_right').show().css('width','890px');
load_submap(0);
		api.getContentPane().html(data.result);
		api.reinitialise();    	
	    //$('#frame_main_right').show().css('width','890px').html(data.result)
		//$('#frame_main_right').jScrollPane();
		//$('#frame_main_right').data('jsp').reinitialise();;
	    $('#stat24').html('<'+'scr'+'ipt type="text/javascript" src="http://s1.hit.stat24.com/_'+(new Date()).getTime()+'/script.js?id=bI4w5JB4p1OMaE3Y_wHAdpdRj70gYVu9biOAwaCMgy3.k7/l=11"></'+'scr'+'ipt>');
	},
	error: function (data, status, e)
	{
	    alert(e);
	}
    });	
	rem_sale();
    return false;
}

function contact_load(id, lang)
{
    $.ajax({
        type: "POST",
        data: "contact="+id+"&lang="+lang,
	dataType: 'json',
	url: "ajax/contact_load.php",
	beforeSend: function()
	{
	    $('#map').html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
	    $('#contact_address').html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
	},
	success: function(data, status)
	{
	    $('#map').html(data.map);
	    $('#contact_address').html(data.result);
	    $('#stat24').html('<'+'scr'+'ipt type="text/javascript" src="http://s1.hit.stat24.com/_'+(new Date()).getTime()+'/script.js?id=bI4w5JB4p1OMaE3Y_wHAdpdRj70gYVu9biOAwaCMgy3.k7/l=11"></'+'scr'+'ipt>');
	},
	error: function (data, status, e)
	{
	    alert(e);
	}
    });
	rem_sale();
    return false;
}


function article(id, lang,ret)
{
    if ($('div.jspContainer').length==0)$('#frame_main_right').jScrollPane({showArrows:true,maintainPosition: false});
    var api=$('#frame_main_right').data('jsp');
    $('#main_anchor').remove();
    $('.small_box_product_info').remove();
    $.ajax({
        type: "POST",
        data: "article="+id+"&lang="+lang+"&ret="+ret,
	dataType: 'json',
	url: "ajax/article.php",
	beforeSend: function()
	{
		clearTimeout(setT);
    	    api.getContentPane().html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
		api.reinitialise();    	
		//$('#frame_main_right').html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
	},
	success: function(data, status)
	{
	    set_vtext(data.vtext);
	    $('div.menu_lightbox').hide();
	    $('div.footer').css('padding-bottom',10);
	    //$('#bg_image').css('backgroundImage','none');
		$('#bg_image').css('backgroundImage','url(\'files/produkty/bg_1302779548855_3.jpg\')');
	    $('#frame_main_bg').css('backgroundImage','none');
	    $('#prev_product').hide();
	    $('#next_product').hide();
	    $('.frame_news').text("");
	    $('#frame_main_left').show();
		$('#frame_main_right').show().css('width','890px');
	    api.getContentPane().html(data.result);
		api.reinitialise();    
		if (data.result.indexOf("<img")!=-1)setTimeout((function() {var api=$('#frame_main_right').data('jsp');api.reinitialise();}),1000);		
	    //$('#frame_main_right').show().css('width','890px').html(data.result);
	    $('#stat24').html('<'+'scr'+'ipt type="text/javascript" src="http://s1.hit.stat24.com/_'+(new Date()).getTime()+'/script.js?id=bI4w5JB4p1OMaE3Y_wHAdpdRj70gYVu9biOAwaCMgy3.k7/l=11"></'+'scr'+'ipt>');
	},
	error: function (data, status, e)
	{
	    alert(e);
	}
    });	
	rem_sale();
    return false;
}

function blog(id, lang)
{
    if ($('div.jspContainer').length==0)$('#frame_main_right').jScrollPane({showArrows:true,maintainPosition: false});
    $('.small_box_product_info').remove();
    $('#main_anchor').remove();
    var api=$('#frame_main_right').data('jsp');
    $.ajax({
        type: "POST",
        data: "blog="+id+"&lang="+lang,
	dataType: 'json',
	url: "ajax/blog.php",
	beforeSend: function()
	{
		api.getContentPane().html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
		api.reinitialise();    
		clearTimeout(setT);		
		//$('#frame_main_right').html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
	},
	success: function(data, status)
	{
	    //set_vtext(data.vtext.toUpperCase());
	    set_vtext(data.vtext);
	    $('div.menu_lightbox').hide();
	    $('div.footer').css('padding-bottom',10);
	    //$('#bg_image').css('backgroundImage','none');
		$('#bg_image').css('backgroundImage','url(\'files/produkty/bg_1302779548855_3.jpg\')');
	    $('#frame_main_bg').css('backgroundImage','none');
	    $('#prev_product').hide();
	    $('#next_product').hide();
	    $('.frame_news').text("");
	    $('#frame_main_left').show();
		$('#frame_main_right').show().css('width','890px');
		
		api.getContentPane().html(data.result);
		api.reinitialise();    	
	    //$('#frame_main_right').show().css('width','890px').html(data.result)
		//$('#frame_main_right').jScrollPane();
		//$('#frame_main_right').data('jsp').reinitialise();;
	    $('#stat24').html('<'+'scr'+'ipt type="text/javascript" src="http://s1.hit.stat24.com/_'+(new Date()).getTime()+'/script.js?id=bI4w5JB4p1OMaE3Y_wHAdpdRj70gYVu9biOAwaCMgy3.k7/l=11"></'+'scr'+'ipt>');
	},
	error: function (data, status, e)
	{
	    alert(e);
	}
    });	
	rem_sale();
	return false;
}

function product(pro)
{
	if ($('div.jspContainer').length==0)$('#frame_main_right').jScrollPane({showArrows:true,maintainPosition: false});
	var api=$('#frame_main_right').data('jsp');
	$('.small_box_product_info').remove();
	$('#main_anchor').remove();
    $('#prev_product').unbind('click');
    $('#next_product').unbind('click');
    $.ajax({
        type: "POST",
        data: "product="+pro,
	dataType: 'json',
	url: "ajax/product.php",
	beforeSend: function()
	{
		$('#frame_main_right').show();
    	    api.getContentPane().html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
			api.reinitialise();    	
			//$('#frame_main_right').show().html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
			$('#bg_image').css('backgroundImage','none');
			$('#frame_main_bg').css('backgroundImage','none');
	},
	success: function(data, status)
	{
	    	set_vtext(data.vtext);
		set_bg_image(data.photo);
		if(data.attachments != '')
			$('.frame_news').html('<div style="clear: both; float: left; width: 840px; margin: 0 auto;">' + data.news + '</div><div style="float: right; width: 130px; margin: 0 auto; text-align: center;">' + data.attachments + '<div><span class="get_details">Pobierz szczegóły</span></div></div><div style="clear: both;"></div>');
		else
			$('.frame_news').html(data.news);
		
		$('#frame_main_right').hide();
		api.getContentPane().html("");
		api.reinitialise();    	
		
	    //$('#frame_main_right').html("").hide();
		
		var _img = $("<img>").hide();
		var _img1 = $("<img>").hide();
		_img.bind("load",function(){
			$(this).fadeIn(300);
			if (data.photo_n=="")setBoxesPosition();
		});
		_img1.bind("load",function(){
			$(this).fadeIn(300);
			setBoxesPosition();
		});
		/*if (data.photo_p!="")$('#prev_product').removeAttr('style').css({'display':'block','height':'auto','width':'222','text-align':'right'}).removeAttr('onclick').bind('click',function(){set_bg_image(data.photo_p);return false}).html('<image src="files/produkty/ou_'+data.photo_p+'" alt="'+data.vtext+'" style="max-width:222px;max-height:150px" />');
		else $('#prev_product').hide();
		*/
		if (data.photo_p!="")
		{
			$('#prev_product').removeAttr('style').css({'display':'block','height':'auto','width':'auto'}).removeAttr('onclick').bind('click',function(){set_bg_image(data.photo_p);return false}).html(_img);
			_img.attr('src','files/produkty/ou_'+data.photo_p).attr('alt',data.vtext).css({'max-width':'222','max-height':'150'});
		}
		else $('#prev_product').hide();
		
		
		/*if (data.photo_n!="")$('#next_product').removeAttr('style').css({'display':'block','height':'auto','width':'222'}).removeAttr('onclick').bind('click',function(){set_bg_image(data.photo_n);return false}).html('<image src="files/produkty/ou_'+data.photo_n+'" alt="'+data.vtext+'" style="max-width:222px;max-height:150px" />');
		else $('#next_product').hide();*/
		
		if (data.photo_n!="")
		{
			$('#next_product').removeAttr('style').css({'display':'block','height':'auto','width':'auto'}).removeAttr('onclick').bind('click',function(){set_bg_image(data.photo_n);return false}).html(_img1);
			_img1.attr('src','files/produkty/ou_'+data.photo_n).attr('alt',data.vtext).css({'max-width':'222','max-height':'150'});
		}
		else $('#next_product').hide();
		
		if (data.slider!="")
		{
			$('div.slider').html(data.slider);
			$('div.menu_lightbox').show();
			menu_image_box(data.pos,data.cat, data.extra_cat);
		}
		//if (data.photo_p!="")$('#prev_product').fadeIn(300,function(){setBoxesPosition()});
		//if (data.photo_n!="")$('#next_product').fadeIn(00,function(){setBoxesPosition()});
		//if (data.photo_p!="" || data.photo_n!="")setBoxesPosition();
		$('#stat24').html('<'+'scr'+'ipt type="text/javascript" src="http://s1.hit.stat24.com/_'+(new Date()).getTime()+'/script.js?id=bI4w5JB4p1OMaE3Y_wHAdpdRj70gYVu9biOAwaCMgy3.k7/l=11"></'+'scr'+'ipt>');
	},
	error: function (data, status, e)
	{
	    alert(e);
	}
    });	
	rem_sale();
	return false;
}

function form(title,ma,anim)
{
	$("#dialog").dialog("destroy");
	clearTimeout(setT);
	$.post("ajax/kontakt_form.php",{"getKontakt":1,"sub":title,"ma":ma},function(data)
	{
	if(data.height) wysokosc=data.height+17; else wysokosc = 400;
	if (anim==1)
	{
		$("#dialog").html(data.html).attr("title",title).dialog
		({
			show:{
				effect:"slide", 
				duration:2000 
			},
			resizable : false,
			height: wysokosc,
			width: 500,
			modal: true
		});
		//$("#dialog").dialog('open');
	}
	else 
		$("#dialog").html(data.html).attr("title",title).dialog
		({
			resizable : false,
			height: wysokosc,
			width: 500,
			modal: true
		});
    },"json");
	rem_sale();
	return false;
}

function google_map(title,id)
{
	$("#dialog").dialog("destroy");
	clearTimeout(setT);
	$.post("ajax/map_load.php",{"id":id},function(data)
	{
		$("#dialog").html(data.html).attr("title",title).dialog
		({
			resizable : false,
			height: 460,
			width: 640,
			modal: true
		});
		load();
    },"json");
	return false;
}

function add_cookie_func(product,button)
{
	var	$button=$('#'+button);
	if ($button.length==0)$button="";
				$.ajax({
					type: "POST",
					url: "ajax/ulubione.php",
					data: "ido-cookie="+product,
					dataType: 'json',
					success: function(msg, status){
						if (msg.a=="tak")
						{
							if (msg.b!="all")
							{
								$("div.moje_ulubione").show();
								$("div.moje_ulubione_body").html(msg.b);
							}
							if (msg.c!="") $(".ilosc-ulubionych").html(msg.c);
							if ($button!="")
							{
								$button.removeAttr('onclick').attr({
									href:'ulubione,del,'+product,
									title:'msg.d'
								}).html(msg.d+" &raquo;");
								$button.unbind("click").click(function(){
									delete_cookie_func(product,button);
									return false;
								});
							}
						}
						alert(msg.msg);
					},
					error: function (data, status, e)
					{
						alert(e);
					}
				});
			return false;
}

function delete_cookie_func(product,button)
{
	var	$button=$('#'+button);
	if ($button.length==0)$button="";
			//var $mojeOgl=false;
			//if ($button.parent().find("input[name=moje-ogl]").val()==1)$mojeOgl=true;
			$.ajax({
					type: "POST",
					url: "ajax/ulubione.php",
					dataType: 'json',
					data: "ido-cookie="+product+"&delete-cookie="+product,
					success: function(msg,status){
						if (msg.a=="usun_t")
						{
							if (msg.b=="") 
							{
								//if ($mojeOgl)window.location.href="index.php";
								//else
								//{
									$("div.moje_ulubione").hide();
									if ($button!="")
									{
										$button.removeAttr('onclick').attr({
										href:'ulubione,add,'+product,
										title:'msg.d'
										}).html(msg.d+" &raquo;");
											$button.unbind("click").click(function(){
											add_cookie_func(product,button);
											return false;
										});
									}
								//}
							}
							else
							{
								$("div.moje_ulubione_body").html(msg.b);
								if (msg.c!="") $(".ilosc-ulubionych").html(msg.c);
								//if ($mojeOgl)$ogl.remove();
								else 
								{
									if ($button!="")
									{
										$button.removeAttr('onclick').attr({
										href:'ulubione,add,'+product,
										title:'msg.d'
										}).html(msg.d+" &raquo;");
											$button.unbind("click").click(function(){
											add_cookie_func(product,button);
											return false;
										});
									}
								}
							}
							alert(msg.msg);
						}
						else if(msg.a=="usun_n")alert(msg.msg);
					},
					error: function (data, status, e)
					{
						alert(e);
					}
				});
		return false;
}

$(document).ready(function(){
    $('#search_button').click(function(){
	if ($('div.jspContainer').length==0)$('#frame_main_right').jScrollPane({showArrows:true,maintainPosition: false});
	var api=$('#frame_main_right').data('jsp');
	$('#main_anchor').remove();
	$('.small_box_product_info').remove();
	$.ajax({
    	    type: "POST",
    	    data: "search_string="+$('#search_string').val(),
	    dataType: 'json',
	    url: "ajax/search.php",
	    beforeSend: function()
	    {
    		api.getContentPane().html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
		api.reinitialise();    	
	    },
	    success: function(data, status)
	    {
	        set_vtext(data.vtext);
		$('div.menu_lightbox').hide();
	        $('div.footer').css('padding-bottom',10);
		//$('#bg_image').css('backgroundImage','none');
		$('#bg_image').css('backgroundImage','url(\'files/produkty/bg_1302779548855_3.jpg\')');
	        $('#frame_main_bg').css('backgroundImage','none');
		$('#prev_product').hide();
		$('#next_product').hide();
		$('.frame_news').text("");
		$('#frame_main_left').show();
		$('#frame_main_right').show().css('width','890px');
		api.getContentPane().html(data.result);
		api.reinitialise();    	
	    },
	    error: function (data, status, e)
	    {
		alert(e);
	    }
	});	
        return false;
    });
	
	/*$('#frame_main_right').jScrollPane({showArrows:true,
	maintainPosition: false});*/
	
	/*
	$("#carousel").featureCarousel({
		startingFeature:1,
		trackerIndividual:false,
		trackerSummation:false,
		topPadding:0
          // include options like this:
          // (use quotes only for string values, and no trailing comma after last option)
          // option: value,
          // option: value
        });
	*/
	
	$("div.moje_ulubione").mouseover(function(){
				$(this).stop().animate({right:0},1000,function(){
				if ($(this).css("right")=="0px")
				$(this).find('div.top_bg_moje_ulubione').css("z-index",-1);		
				});
			}).mouseout(function() {
				$(this).stop().animate({right:-240},500,function(){
				if ($(this).css("right")=="-240px")
					$(this).find('div.top_bg_moje_ulubione').css("z-index",5);
				});
			});
	
});

function form_product(title)
{
	var t=new Date();
	var t1=t.getTime()-time.getTime();
	if (Math.floor(t1/1000/60)>=3)
	{
		form(title,'',1);
	}
    else setT=setTimeout((function() {form_product(title);}),60000);
}

function load_submap(id)
{
    if ($('div.jspContainer').length==0)$('#frame_main_right').jScrollPane({showArrows:true,maintainPosition: false});
    var api=$('#frame_main_right').data('jsp');
    $('#main_anchor').remove();
    $('.small_box_product_info').remove();
    $.ajax({
        type: "POST",
        data: "submap="+id,
	dataType: 'json',
	url: "ajax/contact_load.php",
	beforeSend: function()
	{
    	    $('#contact_desc').html('<div class="loader"><img src="img/h_loader_small.gif" alt="" /> loading...</div>');
	},
	success: function(data, status)
	{
	    set_vtext(data.vtext);
/*
	    $('div.menu_lightbox').hide();
	    $('div.footer').css('padding-bottom',10);
	    $('#bg_image').css('backgroundImage','url(\'files/produkty/bg_1302779548855_3.jpg\')');
	    $('#frame_main_bg').css('backgroundImage','none');
	    $('#prev_product').hide();
	    $('#next_product').hide();
	    $('.frame_news').text("");
	    $('#frame_main_left').show();
	    $('#frame_main_right').show().css('width','890px');
*/
	    $('#contact_desc').html(data.result);    	
	},
	error: function (data, status, e)
	{
	    alert(e);
	}
    });	
    return false;

}
