<!--
/**
 * JavaScrits
 *
 * @author Aurimas Tubis a.k.a Okanakis <aurimas@univelas.com>
 * @package SkemtaTVS
 * @version v1.0/2008
 */

var working = 0;

/*
setContentOuterWidth = function(topW) {
	if (topW)
		$('div.content_outer').css("width", topW);
}
*/

setContentWidth = function(topW) {
	if (topW)
		$('div.content').css("width", topW);
}
//---------------------------------------------------------------

initContentWidth = function() {
	topW = $('#top').width();
	if (topW < 976)
		topW = 976;
	setContentWidth(topW);
}
//---------------------------------------------------------------

/*
loadPage = function(href, topW)
{
	if (working == 0)
		working = 1;
	else
		return false;
	
	//$('#loading').fadeIn('fast');
	//$('#loading').show();
	showLoading();
	$.ajax({
		url: href + ',ajax.1',
		cache: false,
		success: function(html) {
			if (html)
			{
				var container = createNewPage(topW);
				if ($(container))
				{
					$(container).html(html);
					nextPage(topW);
				}
				else {
					//$('#loading').fadeOut('fast');
					$('#loading').hide();
				}
			} else {
				window.location = href;
			}
		}
	});
}
//---------------------------------------------------------------
*/

showLoading = function()
{
	var yy = document.all? truebody().scrollTop : pageYOffset;
	if ((!yy) || (yy < 0))
		yy = 0;
	$('#loading').css({	top: yy+'px' });
	$('#loading').show();
}
//---------------------------------------------------------------

/*
nextPage = function(topW)
{
	var margin = parseInt($(".top_inner").css("marginLeft"));
	margin -= topW;
	$(".top_inner").animate({"marginLeft": margin+"px"}, 1000, function(){
		//$('#loading').fadeOut('fast');
		$('#loading').hide();
		deletePrevPage(topW);
		working = 0;
	});
}
//---------------------------------------------------------------

prevPage = function(topW)
{
	var margin = parseInt($(".top_inner").css("marginLeft"));
	if (margin < 0)
	{
		margin += topW;
		$(".top_inner").animate({"marginLeft": margin+"px"}, 500);
	}
}
//---------------------------------------------------------------

deletePrevPage = function(topW)
{
	var row = document.getElementById('container_row');
	var margin = parseInt($(".top_inner").css("marginLeft"));
	
	if (row && (margin < 0) && (parseInt(row.cells.length) > 1))
	{
		margin += topW;
		row.deleteCell(0);
		$(".top_inner").css("marginLeft", margin+"px");
	}
}
//---------------------------------------------------------------

createNewPage = function(topW)
{
	var row = document.getElementById('container_row');
	if (row)
	{
		var cell = row.insertCell(parseInt(row.cells.length));
		var div = document.createElement('div');
		//cell.style.verticalAlign = 'middle';
		cell.className = 'container_cell';
		$(div).attr("class", "content_outer");
		cell.appendChild(div);
		setContentOuterWidth(topW);
		
		return div;
	}
	
	return false;
}
//---------------------------------------------------------------
*/

function truebody() {
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
//---------------------------------------------------------------

//-->

