function printView(url)
{
	var printW = window.open('?print=1'+url,'','width=800,height=600,scrollbars=yes');
	return;
}
function replaceContent(print)
{
	var SourceEL = window.opener.document.getElementById('content');
	var TargetEL = window.document.getElementById('content');
	TargetEL.innerHTML = '<table width="100%" cellpadding=15 cellspacing=0 border=0 id="content" name="content">'+SourceEL.innerHTML+'</table>';
	/*alert(TargetEL.parentElement.innerHTML);*/
	if (print)
	{
		setTimeout("window.print()", 300);
	}
}
function SendLink(sUrl)
{
	window.open(sUrl,'saada','scrollbars=no, menubar=no,location=no,status=no, width=500,height=300');
}

function showimage(imageID,laius,korgus,imageType)
{
	today= new Date();
	seconds= today.getSeconds();	window.open("/index.php?viewimage=1&action=viewimage&imageID="+imageID+"&imageType="+imageType,'aken','resizable=0,scrollbars=0,statusbar=0,toolbar=0,width='+laius+',height='+korgus+',top=80,left=80');
}

function clearDefault(el) {
	if (el	.defaultValue==el.value) el.value = ""
}

function fillDefault(el, str) {
	if (el.value=="") el.value = str
}

function imgPreview(imgName)
{
   if (document.images)
    {
      imgLoad=eval(imgName + ".src");
      document.preview_img.src= imgLoad;
    }
}

function handleKeyPress(e,form) {
	var key=e.keyCode || e.which;
	if (key==13){
		form.submit();
	}
}
