
function showUploadedThumb(pic,width,height){
	window.open("./images/uploaded_images/"+pic,"mypic","resize=no-resize,width="+width+",height="+height);
}

function openForPrint(content, img, lang){
	var options='scrollbars=yes,resizable=yes, width=700,height=540, left=0 ,top=0';
	if(lang == 'bg')
	{
		var size = 285;
	}
	else
	{
		var size = 260;
	}
	imgWin=window.open('about:blank','',options);
	while(content.indexOf(" if(!check_int_value(this.value)) { alert('Моля въвеждайте само цели числа!!!'); this.value = '';} ", content) != -1)  content = content.replace(" if(!check_int_value(this.value)) { alert('Моля въвеждайте само цели числа!!!'); this.value = '';} ","");

	with (imgWin.document)
		{
			writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
			writeln('<html>\n<head>\n<title><\/title><style type="text/css"> @import "./css/screen.css";  @import "./css/img-replace.css"; @import "./css/reset.css"; strong{font-weight:bold;} body { margin:0px; text-align:left;} h3{margin-bottom: -1em;} h2{margin-bottom:10px;} </style>');
			writeln('<\/head>\n<body class="contdocument" onload="self.focus(); print();" >');


			writeln('<div id="header"  style="background: url(images/site_img/headers/'+img+') no-repeat;">');
			writeln('<div id="logo"><h1><a href="index.php?ln='+lang+'"><img src="./images/site_img/logo_'+lang+'.png" width="'+size+'" height="60" alt="Industrial Holding Bulgaria" /></a></h1>');
			writeln('</div></div>');


			writeln('<table  cellspacing="0" cellpadding="0" align="left" border="0" style="font-size:11px; font-family: tahoma, sans-serif;"><tr><td class="bord">');
			writeln('\t'+ content +'\n<\/td><\/tr><tr><td class="bord">');


			writeln('<p style="margin-top: 20px;">');
			writeln('&nbsp;&copy; 2007 <strong>Industrial Holding Bulgaria</strong>');
			writeln('<\/td><\/tr><\/table><br /><\/body>\n<\/html>');
			close();
		}//end with
}//end func

function main_reports(lang, id)
{
	new Ajax.Updater('reports', 'ajax.php', {
 		 parameters: { reports: 1, lg: lang, id: id }
		});

}
function vew_report(id, lang)
{
	new Ajax.Updater('reports', 'ajax.php', {
 		 parameters: { reports: 1, lg: lang, id: id }
		});

}
function vew_subreport(sub_id, id, lang)
{
	new Ajax.Updater('subreport', 'ajax.php',
	{
 		 parameters: { subreports: 1, lg: lang, sub_id: sub_id, id: id }
	});

}


//this function clear search text on all pages

function res_txt(id) {
	if(id) {
		var res = document.getElementById(id).value = "";

		return res;
	}

}