 $(document).ready(function(){
 	
/* 	 $(".leftm").hide();*/

 	 
	 $(function(){
	  $("TEXTAREA").focus(function(){
	  	$(this).css({color: "black", background: "#ffff83"});
	  })
	})
	
	$(function(){
	  $("TEXTAREA").blur(function(){
	  	$(this).css({color: "black", background: "white"});
	  })
	})
	
	$(function(){
	  $("input.inputbox_big").focus(function(){
  		$(this).css({color: "black", background: "#ffff83"});
	  })
	})


	$(function(){
	  $("input.inputbox_big").blur(function(){
	  	$(this).css({color: "black", background: "white"}); 
	  })
	})
	
	$(".box_content img").each(function() 
	{ 
		filenamepos = $(this).attr("src").lastIndexOf("/");
		path = $(this).attr("src").substr(0,filenamepos);
		filename = $(this).attr("src").substr(filenamepos + 1);
		if (filename.substr(0,6)=="small_")
		{
			filename = filename.substr(6);
			
		}
		
		$(this).wrap("<a href='" + path + "/_bigp_" + filename +"' class='thickbox'></a>");
		$(this).attr("rel","pics");	
		$(this).attr("alt",filename);	
		
	}
	)
	
	$("#leftpanel img").each(function() 
	{ 
		filenamepos = $(this).attr("src").lastIndexOf("/");
		path = $(this).attr("src").substr(0,filenamepos);
		filename = $(this).attr("src").substr(filenamepos + 1);
		
		$(this).wrap("<a href='" + path + "/_bigp_" + filename +"' class='thickbox'></a>");
		$(this).attr("rel","pics");	
		$(this).attr("alt",filename);	
		
	}
	)
	callafterload();
 } );
 
 function RunFlash(flashname, flashwidth, flashheight)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + flashwidth +'" height="' + flashheight + '" id="iseum" align="middle">\n');
	document.write('<param name="movie" value="' + flashname + '" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="wmode" value="transparent">\n');
	document.write('<embed src="' + flashname + '" wmode="transparent" quality="high" bgcolor="#fefefe" width="' + flashwidth + '" height="' + flashheight + '" name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');	
}


if (parseInt(navigator.appVersion.charAt(0))>=4)
{
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Windows") != -1) window.attachEvent("onload", alphaImages);
var startScroll = 0;
var textstartScroll = 0;

function scrollUp()
{
	var objDiv = document.getElementById("greenbox");
	objDiv.scrollTop = objDiv.scrollTop +2;
	timerID  = setTimeout("scrollUp()", 1);

}

function scrollDown()
{
	var objDiv = document.getElementById("greenbox");
	objDiv.scrollTop = objDiv.scrollTop - 2;
	timerID  = setTimeout("scrollDown()", 1);

}

function scrolldiv(direction)

{

	if (startScroll == 0)
	{
		startScroll = 1;
		if (direction == "up")
		{
			document.getElementById("btn_down").src = "/images/system/menu/button_az_roll.jpg";
			timerID  = setTimeout("scrollUp()", 1);
		}
		else		
		{
			document.getElementById("btn_up").src = "/images/system/menu/button_fz_roll.jpg";
			timerID  = setTimeout("scrollDown()", 1);
		}
		
	}
		
	
}

function stopscrolldiv()

{
	if (startScroll == 1)
	{
		document.getElementById("btn_up").src = "/images/system/menu/button_fz.jpg";
		document.getElementById("btn_down").src = "/images/system/menu/button_az.jpg";
		clearTimeout(timerID);
		startScroll = 0;
		
	}
		
	
}


function textscrollUp()
{
	var objDiv = document.getElementById("contenttextbox");
	objDiv.scrollTop = objDiv.scrollTop +2;

	timerID  = setTimeout("textscrollUp()", 1);

}

function textscrollDown()
{
	var objDiv = document.getElementById("contenttextbox");
	objDiv.scrollTop = objDiv.scrollTop - 2;
	timerID  = setTimeout("textscrollDown()", 1);

}



function textscrolldiv(direction)

{
	if (textstartScroll == 0)
	{
		textstartScroll = 1;
		if (direction == "up")
		{
			document.getElementById("txtbtn_down").src = "images/system/roll_also_s.jpg";
			timerID  = setTimeout("textscrollUp()", 1);
		}
		else		
		{
			document.getElementById("txtbtn_up").src = "images/system/roll_felso_s.jpg";
			timerID  = setTimeout("textscrollDown()", 1);
		}
		
	}
		
	
}

function textstopscrolldiv()

{
	if (textstartScroll == 1)
	{
		document.getElementById("txtbtn_up").src = "images/system/roll_felso_k.jpg";
		document.getElementById("txtbtn_down").src = "images/system/roll_also_k.jpg";
		clearTimeout(timerID);
		textstartScroll = 0;
		
	}
		
	
}


function alphaImages() 
{ 
	var els = document.getElementsByTagName("IMG"); 
	var s, w, h; 
	for (var i=0; i<els.length; i++)
	{	
		s = els[i].src;
		if (s.toLowerCase().indexOf(".png") != -1) 
		{ 
			els[i].src = "/images/system/spacer.gif";
			els[i].style.filter += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + s + "', sizingMethod=image);"; 
		} 
	}
}
