// JavaScript Document

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
	{
	for(var i=0; i<document.images.length; i++)
		{
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
			if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
				{
				var imgID = (img.id) ? "id='" + img.id + "' " : ""
				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				var imgStyle = "display:inline-block;" + img.style.cssText 
				if (img.align == "left") imgStyle = "float:left;" + imgStyle
				if (img.align == "right") imgStyle = "float:right;" + imgStyle
				if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle               
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
				img.outerHTML = strNewHTML
				i = i-1
			}
		}
	}
window.attachEvent("onload", correctPNG);

function set(){
	if(document.getElementById('page1')){
	document.getElementById('page1').style.color='#000000';
	document.getElementById('page1').style.fontWeight='bold';
	}lastid=1;
}

function ShowTree(id){
	var menu = 'TABLE' + id;
	var folder = 'FOLDER' + id;
	var node = 'NODE' + id;
	if(lastid!=id){
	if(document.all(menu) != null){
		if(document.all(menu).style.display == 'none'){
			for(i=1;i<30;i++){
			if(document.all('TABLE'+i)!= null)
			document.all('TABLE'+i).style.display = 'none';
			}
			document.all(menu).style.display = '';
			//document.images[node].src = '/img/node_minus.gif';
		}
		else{
			document.all(menu).style.display = 'none';
			//document.images[node].src = '/img/node_plus.gif';
		}
	}
	}lastid=id;
}

function page(id) {
for(i=1;i<20;i++){
	if(document.getElementById('page'+i)){
	document.getElementById('page'+i).style.color='#996600';
	document.getElementById('page'+i).style.fontWeight='normal';
	}}
document.getElementById('page'+id).style.color='#000000';
document.getElementById('page'+id).style.fontWeight='bold';
}

function popwin(url,w,h) {
opwin = window.open(url,'Photo','width='+w+',height='+h+',top=260,left=196');
opwin.document.write("<HTML><BODY style='margin:0'>");
opwin.document.write("<div align='center'>");
opwin.document.write("<img src='"+url+"'>");
opwin.document.write("</div>")
opwin.document.write("</BODY></HTML>");
}

function popphoto(url,w,h) {
k = url.indexOf(".jpg");
tmp = url.substring(0,k);
m = tmp.lastIndexOf("/");
buf = url.substring(m+1,k);
/*if(m==-1){
buf1 = tmp.substring(0,3);buf2 = tmp.substring(4,8);buf3 = tmp.substring(9,13);buf4 = tmp.substring(14,15);
id=buf1+buf2+buf3+buf4;title=buf1+"-"+buf2+"-"+buf3+"-"+buf4;
}else{
buf1 = tmp.substring(2,5);buf2 = tmp.substring(6,10);buf3 = tmp.substring(11,15);
id=buf1+buf2+buf3;title=buf1+"-"+buf2+"-"+buf3;
}*/
id=buf;
title="Licurici.md";
opwin = window.open("",id,"width="+w+",height="+h+",top=260,left=196,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no");
opwin.document.write("<HTML><head><title>"+title+"</title></head><BODY style=\"margin:0\">");
opwin.document.write("<div align=\"center\">");
opwin.document.write("<img src=\""+url+"\">");
opwin.document.write("</div>")
opwin.document.write("</BODY></HTML>");
opwin.document.close();
}

function popruk(url,name) {
var w=350;
var h=450+102;
k = url.indexOf(".jpg");
tmp = url.substring(0,k);
m = tmp.lastIndexOf("/");
buf = url.substring(m+1,k);
id=buf;
title="Licurici.md";
opwin = window.open("",id,"width="+w+",height="+h+",top=260,left=196,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no");
opwin.document.write("<HTML><head><title>"+title+"</title></head><BODY style=\"margin:0\">");
opwin.document.write("<div align=\"center\">");
opwin.document.write("<img src=\"../img/sh350ro.gif\">");
opwin.document.write("<img src=\""+url+"\">");
opwin.document.write("</div>");
opwin.document.write("<table width=\"350\" height=\"51\" background=\"../img/sh350bot.gif\">");
opwin.document.write("<tr><td  align=\"center\"><font color=\"#333333\" face=\"Verdana\" size=\"2\">"+name+"</font>");
opwin.document.write("</table>");
opwin.document.write("</BODY></HTML>");
opwin.document.close();
}

function poprep(url,name) {
var w=450;
var h=300+102;
k = url.indexOf(".jpg");
tmp = url.substring(0,k);
m = tmp.lastIndexOf("/");
buf = url.substring(m+1,k);
id=buf;
title="Licurici.md";
opwin = window.open("",id,"width="+w+",height="+h+",top=260,left=196,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no");
opwin.document.write("<HTML><head><title>"+title+"</title></head><BODY style=\"margin:0\">");
opwin.document.write("<div align=\"center\">");
opwin.document.write("<img src=\"../img/sh450ro.gif\">");
opwin.document.write("<img src=\""+url+"\">");
opwin.document.write("</div>");
opwin.document.write("<table width=\"450\" height=\"51\" background=\"../img/sh450bot.gif\">");
opwin.document.write("<tr><td  align=\"center\"><font color=\"#333333\" face=\"Verdana\" size=\"2\">"+name+"</font>");
opwin.document.write("</table>");
opwin.document.write("</BODY></HTML>");
opwin.document.close();
}

function poprep2(url,name) {
var w=920;
var h=600+102;
k = url.indexOf(".jpg");
tmp = url.substring(0,k);
m = tmp.lastIndexOf("/");
buf = url.substring(m+1,k);
id=buf;
title="Licurici.md";
id = id.replace(/-/g,'_')
opwin = window.open("",id,"width="+w+",height="+h+",top=-20,left=50,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes");
opwin.document.write("<HTML><head><title>"+title+"</title></head><BODY style=\"margin:0\">");
opwin.document.write("<div align=\"center\">");
opwin.document.write("<img src=\"../img/sh900ro.gif\">");
opwin.document.write("<img src=\""+url+"\">");
opwin.document.write("</div>");
opwin.document.write("<table width=\"900\" height=\"51\" background=\"../img/sh900bot.gif\">");
opwin.document.write("<tr><td  align=\"center\"><font color=\"#333333\" face=\"Verdana\" size=\"2\">"+name+"</font>");
opwin.document.write("</table>");
opwin.document.write("</BODY></HTML>");
opwin.document.close();
}

//----ACTIVATING FLASH-----
function flash(flash_content){
	document.write(flash_content);
	}

function wflash(url,w,h){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'" id="myFlash">'
      +'<param name="movie" value="'+url+'">'
      +'<param name=quality value=high>'
      +'<param name="wmode" value="opaque">'
      +'<embed src="'+url+'" wmode="opaque" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" name="myFlash" swliveconnect="true"></embed>'
    +'</object>'
	);
	}
//----ACTIVATING FLASH-----