var vs = 200; //(px/s)
var vms = vs / 1000;

function slideRight(div) {
    var _s = $("#" + div)[0].style.left.replace('px', '').replace('-', '') - 0;
    var _t = _s / vms;

    if (_s > 0)
        $("#" + div).animate({ left: '0px' }, _t);

    $("#test").animate({ left: '100px' }, "slow");
}

function slideLeft(div) {
    var _left = $("#" + div)[0].style.left.replace('px', '').replace('-', '') - 0;
    var _width = $("#" + div)[0].style.width.replace('px', '') - 0;

    var _s = (_width - 558) - _left;
    var _t = _s / vms;

    if (_s > 0)
        $("#" + div).animate({ left: '-' + (_width - 558) + "px" }, _t)
}

function stop(div) {
    $("#" + div).stop();
}

function showImg(container, sender, thumbs, src, numberDiv, number) {
    $("#" + thumbs + " > .active").attr("class", "");
    sender.className = "active";

    $("#" + container).css({ display: "none" });
    $("#" + container).html('');
    $("#" + container).html('<img src="' + src + '" alt="" title="" />')
    $("#" + container).fadeIn();

    $("#" + numberDiv).text(number);
}

/*****************************************/

function ChangeImage(OldImage, NewImagePath)
{
	OldImage.src = NewImagePath;
}

function MakeGray(obj, state, text)
{
	if (state && obj.value == '')
		obj.value = text;
	else if (!state && obj.value == text)
		obj.value = '';
}

function OpenWindow(Url, Width, Height)
{
	var _left = (screen.availWidth - Width)/2;
	var _top = (screen.availHeight - Height)/2;
	
	window.open(Url, '', "location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=" + Width + ",height=" + Height + ",top=" + _top + ",left=" + _left);
}

function FillData(FirstViewID, FirstValueID, SecondViewID, SecondValueID, SaveID)
{
	FillInlineData(FirstViewID, FirstValueID, true);
	
	if (SecondValueID != null)
	{
		FillInlineData(SecondViewID, SecondValueID);
		Show(document.getElementById(SaveID));
	}
	else
		Show(document.getElementById(SecondViewID));
}

function Hide(Object)
{
	Object.style.display = 'none';
}

function Show(Object)
{
	Object.style.display = 'block';
}

function FillInlineData(ViewID, ValueID, Focus)
{
	var view = document.getElementById(ViewID);
	Hide(view);
	
	var input = document.getElementById(ValueID);
	Show(input);
	
	input.value = view.innerHTML;
	Resize(input);
	
	if (Focus)
		input.focus();
}

function showRedBg(leftId,rightId,centerId)
{
	var leftDiv = document.getElementById(leftId);
	var rightDiv = document.getElementById(rightId);
	var centerDiv = document.getElementById(centerId);
	
	leftDiv.className = 'active-lborder';
	rightDiv.className = 'active-rborder';
	centerDiv.className = 'aktive-link menu-s';
}
function hideRedBg(leftId,rightId,centerId)
{
	var leftDiv = document.getElementById(leftId);
	var rightDiv = document.getElementById(rightId);
	var centerDiv = document.getElementById(centerId);
	
	leftDiv.className = 'lborder';
	rightDiv.className = 'rborder';
	centerDiv.className = 'link';
}				


function flash(version, filename, name, width, height, wmode, bgcolor, menu, flashvars) {

 if(width > 0 && height > 0){
 document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version+"' width='"+width+"' height='"+height+"' id='"+name+"' align='middle'>");
 }
 else {
 document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version+"' id='"+name+"' align='middle'>");
 }
 document.write("<param name='allowScriptAccess' value='sameDomain' />");
 document.write("<param name='wmode' value='"+wmode+"' />");
 document.write("<param name='bgcolor' value='"+bgcolor+"' />");
 document.write("<param name='salign' value='lt' />");
 document.write("<param name='movie' value='"+filename+"' />");
 document.write("<param name='menu' value='"+menu+"' />");
 document.write("<param name='quality' value='high' />");
 document.write("<param name='flashvars' value='"+flashvars+"' />");
 if(width > 0 && height > 0){
 document.write("<embed src='"+filename+"' wmode='"+wmode+"' menu='"+menu+"' quality='high' flashvars='"+flashvars+"' salign='lt' width='"+width+"' height='"+height+"' bgcolor='"+bgcolor+"' name='"+name+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
 }
 else{
 document.write("<embed src='"+filename+"' wmode='"+wmode+"' menu='"+menu+"' quality='high' flashvars='"+flashvars+"' salign='lt' bgcolor='"+bgcolor+"' name='"+name+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
 }
 document.write("</object>");

}


function moveLeft()
{
        _width = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
        var _outer = document.getElementById('outer');
                                              
        if(_width < 1300)
        {
           _outer.className = 'marginClass';
        }
        else if(_width>=1300)
        {
            _outer.className = '';
        }                    
}