jQuery(document).ready(function() {

    jQuery('#mycarousel').jcarousel({
        vertical: true,
        scroll: 1,
        animation: "slow"
    });

    $(".liHover").click(function(){
    	$(".mainPortDVpics").html("<div style=\"padding-left: 15px; padding-top: 25px;\"><img src=\"/images/indicator_verybig.gif\"></div>");
        //$("#computerPicPlace").stopTime('timer333');

    	$("#bigPicPlace").html("&nbsp;");
    	$(".liHover").each(function(){
           $(this).css("outline","none");
    	});
    	$(this).css("outline","solid 2px #FF7200");
    	var bPic = "";
    	bPic = $(this).children().children().attr("imgID");

        $("#loadingBPic").show();

    		JsHttpRequest.query(
		    "/skin/php/lg_loadBPic.php",
		    {
		   		"bPic": bPic
		    },
		    function (result,errors)
		    {
				if (result)
				{
					var ok = result.ok;
					var bigPic = result.bigPic;
					var description_en = result.description_en;
					var site_url = result.site_url;
					var site_name = result.site_name;
					var tvPics = result.tvPics;
					var tvPicsLink = result.tvPicsLink;
					var compPicsN = result.compPicsN;

					if(ok == 'ok')
					{
						$(".mainPortDVpics").html(compPicsN);

						$('#portfolio').innerfade({
							speed: 3000,
							timeout: 7000,
							type: 'sequence',
							containerheight: '220px'
						});

					    var imgNEw = "/langsAdmin/portfolioPics/"+bigPic;
					    $("#bigPicPlace").html("<img src=\""+imgNEw+"\" style=\"width: 504px; height: 406px; display: none;\">");
					    $("#loadingBPic").hide();
						$("#bigPicPlace").html("<a href=\""+site_url+"\" target=\"_blank\"><img src=\""+imgNEw+"\" style=\"border: 0px; width: 504px;\"></a>");
						$(".pageNavPlace").html("<a class=\"portSiteLink\" href=\""+site_url+"\" target=\"_blank\">"+site_name+"</a>");
						$(".descPlace").html(description_en);
                        /*
						$("#computerPicPlace").everyTime(3000, 'timer333', function(i) {
							$(".tEst").text("");
							var randDigit = "";
							var n = "";
							var bPic = "";
							var countElem = "";
							countElem = tvPics.length;
                            countElem = parseInt(countElem);

							if(countElem <= 1)
							{
                                n = 0;
							}
							else
							{
								n = (tvPics.length) - 1;
							}
							n = parseInt(n);
					        randDigit = Math.floor( Math.random( ) * (n+1) );

							randDigit = parseInt(randDigit);
							var pictureP = "<a href=\""+tvPicsLink[randDigit]+"\" target=\"_blank\"><img class=\"showBigPicPort\" src=/system/langsAdmin/portfolioPics/"+tvPics[randDigit]+" style=\"width: 157px; height: 180px; display: none; cursor: pointer; border: 0px;\" alt=\"\" title=\"\" /></a>";

							$("#computerPicPlace").html(pictureP);
							$(".showBigPicPort").fadeIn(500);

							pictureP = "";
						});
						*/
					}
					else
					{

					}
				}
				else
				{

				}
		    },
		    true
		   )
    });

    $(".liHover:first").trigger("click");
});
