$(document).ready(function(){
	$("#srch_input").focus(function(){
		if (trim1($(this).val()) == ieskoti+'...') {
			$(this).val('');
		}
	});	
	$("#srch_input").blur(function(){
		if (trim1($(this).val()) == '') {
			$(this).val(ieskoti+'...');
		}
	});	
	
	$("#srch_button").click(function(){
		var srch_txt = trim1($("#srch_input").val());
		if(srch_txt != '' && srch_txt != ieskoti+'...') {
			$("#srch_form").submit();
			/*
			<div id="srch_field">
				<form method="post" action="{$siteadress}">
					<input id="srch_txt" type="text" name="srch" value="{$srch_var}" />
				</form>
			</div>
			*/
			//alert(srch_txt);
		}
	});
})


function trim1 (str) {
	var	str = str.replace(/^\s\s*/, ''),
		ws = /\s/,
		i = str.length;
	while (ws.test(str.charAt(--i)));
	return str.slice(0, i + 1);
}



jQuery.jPrintArea=function(el) {
	var title = $('#content_title').html();
	var print_area = window.open(siteadress+'print.html', 'print_a', 'top=10, left=10, width=800, height=600, scrollbars=1, titlebar=0, toolbar=0, location=0, menubar=0, resizable=1, channelmode1=0, directories=0, status=0');
	var links=window.document.getElementsByTagName('link');
	print_area.document.write('<head>');
	print_area.document.write('<script type="text/javascript" src="js/print.js"></script>');
	print_area.document.write('<style type="text/css">.no_show{display:none}</style><style type="text/css" media="print">#pbut{display:none}.no_show{display:none}</style>');
	
	
	
	
	for(var i=0;i<links.length;i++)
		if(links[i].rel.toLowerCase()=='stylesheet')
			print_area.document.write('<link type="text/css" rel="stylesheet" href="'+links[i].href+'"></link>');
	print_area.document.write('</head>');
	print_area.document.write('<body onLoad="self.print()">');
	print_area.document.write('<p style="font-weight:bold">'+ title +'</p>');
	print_area.document.write('<hr>');
	print_area.document.write('<div id="content" style="margin:0">');
	
	print_area.document.write('<div class="'+$(el).attr("class")+'">'+$(el).html()+'</div>');
	
	print_area.document.write('<div id="pbut" style="page-break-before:always">');
	print_area.document.write('<a  style="float:right;font-size:10px;clear:both;width:80px;height:16px;line-height:16px;text-align:center;color:#000;display:block;text-decoration:none;border:1px solid;black" href="javascript:printP();">Spausdinti</a>');
	print_area.document.write('</div></div></body>');
	print_area.document.close();
	print_area.focus();

}
