point = 0;
mTop = 0;
frameHeight = 385;
qElem = 0;
function zoomIn(){
	document.sp_jvw.runon(0.0, 0.0, 0.98039);
}
function zoomOut(){
	document.sp_jvw.runon(0.0, 0.0, 1.02);
}
function zoomStop(){
	document.sp_jvw.runon(0.0, 0.0, 1.0);
}
jQuery(function() {
	$(".virtImageList a.linkSlide").click(function(){
		this.blur();
		var slTitle = $(this).attr("title");
		var slTarget = $(this).attr("href");
		$(".linkSlide span img").fadeTo("fast", 0.4);
		$("#activity").attr({"id":""});
		$(".currentImage").attr({"class":""});
		$(this).attr({"id":"activity"});
		$("#activity span img").attr({"class":"currentImage"}).fadeTo("fast", 1);
		$("#currentSubscribe").css({display:"none"}).html(slTitle).fadeIn("normal");
		$('div#currentBig').html('<object height="223" width="342" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="slide" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="' + slTarget + '" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#ffffff" /><param name="wmode" value="opaque" /><embed src="' + slTarget + '" quality="high" scale="noscale" bgcolor="#ffffff" width="342" height="223" name="slide" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" wmode="opaque"/>');
		return false;
	});
	$(".virtImageList .linkSlide span img:not(.currentImage)").hover(
		function(){$(this).fadeTo("fast", 1);},
		function(){
			if($(this).attr("class") == "currentImage"){
				return;
			}else{
				$(this).fadeTo("fast", 0.4);
			}
		}
	);
	if(document.getElementById("slideLine")){var slideLineHeight = parseInt(document.getElementById("slideLine").offsetHeight);}
	$(".virtImageList.str_control img").click(function(){
		var horShift = parseInt(document.getElementById("scrobber").style.marginLeft);
		if(!horShift){
			horShift = 0;
		}
		var step = 86;
		var fixedLine = 343;
		var direction = $(this).attr("id")
		var q = $(".slidePreview").length;
		var boxWidth = q*step;
		var smart = parseInt($("#activity").attr("name"));
		if(direction == "right_dir"){
			smart=smart + 1;
		}else{
			smart=smart - 1;
		}
		if(smart < 0 || smart >= q){
			return false;
		}
		if((smart == 4 || smart == 8)&& direction == "right_dir"){
			var x1 = q*step-fixedLine+horShift;
			if(x1<=fixedLine){
				$("#scrobber").css({marginLeft:horShift-x1 + "px"});
			}
			else{
				$("#scrobber").css({marginLeft:horShift-fixedLine + "px"});
			}
		}
		else if(direction == "left_dir"){
			hideElems = -parseInt(horShift/step);
			if(smart == hideElems && hideElems <=4){
				$("#scrobber").css({marginLeft:"0"});
			}
			else if(smart + 1 == hideElems){
				$("#scrobber").css({marginLeft:horShift+fixedLine+"px"});
			}
		}
		$("a.linkSlide[name='" + smart + "']").click();
	});
});
jQuery(function() {
	$(".gallImageList a.linkSlide").click(function(){
		this.blur();
		var slTitle = $(this).attr("title");
		var slTarget = $(this).attr("href");
		$(".linkSlide span img").fadeTo("fast", 0.4);
		$("#activity").attr({"id":""});
		$(".currentImage").attr({"class":""});
		$(this).attr({"id":"activity"});
		$("#activity span img").attr({"class":"currentImage"}).fadeTo("fast", 1);
		$("#currentBigLink").hide();
		$("#currentBigLink img").attr({"src": slTarget});
		$("#currentBigLink").attr({"href": slTarget}).fadeIn("normal");
		if(document.getElementById('currentSubscribe')){
			$("#currentSubscribe").html(slTitle).fadeIn("normal"); // Строка зачем-то была закомментирована О_о
		}
		return false;
	});
	$(".gallImageList .linkSlide span img:not(.currentImage)").hover(
		function(){$(this).fadeTo("fast", 1);},
		function(){
			if($(this).attr("class") == "currentImage"){
				return;
			}else{
				$(this).fadeTo("fast", 0.4);
			}
		}
	);
	if(document.getElementById("slideLine")){var slideLineHeight = parseInt(document.getElementById("slideLine").offsetHeight);}
	$(".gallImageList.str_control img").click(function(){
		var fin = false;
		var horShift = parseInt(document.getElementById("scrobber").style.marginLeft);
		if(!horShift){
			horShift = 0;
		}
		var step = 86;
		
		var fixedLine = 343;
		var direction = $(this).attr("id")
		var q = $(".slidePreview").length;
		var boxWidth = q*step;
		var smart = parseInt($("#activity").attr("name"));
		
		if(direction == "right_dir"){
			smart=smart + 1;
		}else{
			smart=smart - 1;
		}
		if(smart < 0 || smart >= q){
			return false;
		}
		if((smart == 4 || smart == 8 || smart == 12 || smart == 16 || smart == 20 || smart == 24 || smart == 28 || smart == 32 || smart == 36 || smart == 40) && direction == "right_dir"){
		//if((smart % 4 == 0) && direction == "right_dir"){
			var x1 = q*step-fixedLine+horShift;
			if(x1<=fixedLine){
				$("#scrobber").css({marginLeft:horShift-x1 + "px"});
				fin = true;
			}
			else{
				$("#scrobber").css({marginLeft:horShift-fixedLine + "px"});
			}
		}
		else if(direction == "left_dir"){
			hideElems = -parseInt(horShift/step);
			if(hideElems == smart && smart>0){
				$("#scrobber").css({marginLeft:horShift+fixedLine+"px"});
			}
		}
		$("a.linkSlide[name='" + smart + "']").click();
	});
});

