sfHover = function() {	var sfEls = document.getElementById("navmenu").getElementsByTagName("LI");	for (var i=0; i<sfEls.length; i++) {		sfEls[i].onmouseover=function() {			this.className+=" sfhover";		}		sfEls[i].onmouseout=function() {			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");		}	}}//if (window.attachEvent) window.attachEvent("onload", sfHover);//----------------------------------------------------------/*	Opens popup window, whitch is centered in screen	Param:		url string (link to the file you want to open)		width int (window width)		height int (window height)*/function OpenImagePopup(url,width,height) {	var rnd = (Math.round((Math.random()*999)+1));		var SH = screen.height;	var SW = screen.width;	if (SW < width)	{		newW = Math.round(SW * 0.90);		dif = newW / width;		newH = Math.round(height * dif);		height = newH;		width = newW;	}
	if (SH < height)	{		newH = Math.round(SH * 0.90);		dif = newH / height;		newW = Math.round(width * dif);		height = newH;		width = newW;	}	var top = (screen.height) ? (screen.height-height)/2 : 0;	var left = (screen.width) ? (screen.width-width)/2 : 0;	iw = width;	ih = height;	my_window = window.open("", "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no");	my_window.document.writeln("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" "+"\"http://www.w3.org/TR/html4/strict.dtd\">");	my_window.document.writeln("<html><head><title>Picture preview</title>");	my_window.document.writeln("<meta http-equiv=\"Content-Script-Type\" ","content=\"text/javascript\"><\/head>");	my_window.document.writeln("<body style='margin:0px;padding:0px;'>")	my_window.document.writeln("<img src='" + url + "' onclick='window.close();' border='0' width='" + iw + "' height='" + ih + "' alt='' />");	my_window.document.writeln("<\/body><\/html>");	my_window.document.close();}//---------------------------------------------------------------/*	Opens popup window, whitch is centered in screen	Param:		url string (link to the file you want to open)		width int (window width)		height int (window height)*/function openPopup(url,width,height) {	var rnd = (Math.round((Math.random()*999)+1));		scrollbars = 'yes';		var top = (screen.height) ? (screen.height-height)/2 : 0;	var left = (screen.width) ? (screen.width-width)/2 : 0;	my_window = window.open(url, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars="+scrollbars+",location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no");	my_window.document.close();}//---------------------------------------------------------------function trimString (str){	while (str.charAt(0) == ' ')		str = str.substring(1);	while (str.charAt(str.length - 1) == ' ')		str = str.substring(0, str.length - 1);	return str;}//---------------------------------------------------------------function truebody() {	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}//---------------------------------------------------------------function getCookie(name) {	var nameEQ = name + "=";	var ca = document.cookie.split(';');	for(var i=0;i < ca.length;i++) {		var c = ca[i];		while (c.charAt(0)==' ') c = c.substring(1,c.length);		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);	}	return null;}//----------------------------------------------------------function setCookie (name, value, days) {	var expireDate = new Date();	var expstring = expireDate.setDate(expireDate.getDate()+parseInt(days));	document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";}//----------------------------------------------------------function deleteCookie(name) {	setCookie(name,"",-1);}//----------------------------------------------------------function fadeBlock (obj, id, checkVal) {	var val = obj.value;	if ($('#' + id)) {		if ((checkVal) && (checkVal == val))			$('#' + id).fadeIn('fast');		else if (checkVal)			$('#' + id).fadeOut('fast');	}}//----------------------------------------------------------function slideBlock (obj, id, checkVal) {	var val = obj.value;	if ($('#' + id)) {		if ((checkVal) && (checkVal == val))			$('#' + id).slideDown('fast');		else if (checkVal)			$('#' + id).slideUp('fast');	}}//----------------------------------------------------------$(document).ready(function(){	$('#aBox_controler #show_hide').click(function(){		var c = $('#aBox_content');		if (c.length)		{			if (c.is(':visible')) {				c.slideUp('fast');				$('#aBox_controler #show_hide').html('<img src="images/pl.gif" alt="" /> rodyti');			} else {				$('#aBox_controler #show_hide').html('<img src="images/mi.gif" alt="" /> slėpti');				c.slideDown('fast');			}		}	});	//----------------------------------------------------------	activateLeft = function() {		$('#btn_move_left').attr({src: 'images/arrow_left.gif'});	}	//----------------------------------------------------------	activateRight = function() {		$('#btn_move_right').attr({src: 'images/arrow_right.gif'});	}	//----------------------------------------------------------	deActivateLeft = function() {		$('#btn_move_left').attr({src: 'images/arrow_left-inactive.gif'});	}	//----------------------------------------------------------	deActivateRight = function() {		$('#btn_move_right').attr({src: 'images/arrow_right-inactive.gif'});	}	//----------------------------------------------------------		//var items = document.getElementById("list_images_inner").getElementsByTagName("div");	var items = $('#view_gallery_inner .img');		var numItems = 0;	var maxWidth = 0;	var marginLeft = parseInt($("#view_gallery_inner table").css("marginLeft"));	var containerW = parseInt($('#view_gallery_inner').css('width'));	var clicks = 0;	var itemW = 144;	var inline = 4;		numItems = items.length;		if (numItems > inline) {		activateRight();	}		moveLeft = function() {		if (clicks >= (numItems - inline)) {			clicks = (numItems > inline) ? numItems - inline : 0;			deActivateRight();		}		if (clicks > 0)			activateLeft();		marginLeft = clicks * itemW;		$("#view_gallery_inner table").animate({"marginLeft": -marginLeft+"px"}, 500);	}	//----------------------------------------------------------	moveRight = function() {		if (clicks <= 0) {			clicks = 0;			deActivateLeft();		}		if (clicks < (numItems - inline))			activateRight();		marginLeft = clicks * itemW;		$("#view_gallery_inner table").animate({"marginLeft": -marginLeft+"px"}, 500);	}	//----------------------------------------------------------		$("#btn_move_left").click(function() {		clicks--;		moveRight();		$(this).blur();		return false;	});						//----------------------------------------------------------	$("#btn_move_right").click(function() {		clicks++;		moveLeft();		$(this).blur();		return false;	});	//----------------------------------------------------------});//---------------------------------------------------------------
