isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isMSIE=document.all && document.all.item //Microsoft Internet Explorer 4+
isNetscape4=document.layers //Netscape 4.*
isOpera=window.opera //Opera
isOpera5=isOpera && isDOM //Opera 5+
isMSIE5=isDOM && isMSIE && !isOpera //MSIE 5+
isMozilla=isNetscape6=isDOM && !isMSIE && !isOpera


function ShowMedia(parent,id,mediaid) 
{
  window.open('/cgi-bin/main.cgi?module=media&act=show&parent='+parent+'&id=' + id + '&mediaid=' + mediaid,'','resizable=yes, menubar=no, status=no, scrollbars=yes, statusbar=no, toolbar=no, width=650, height=500').focus();
  return false;
}


/*
function lightMedia(urltoload, w, h) {
	$("body").append('<div class="lb-content" id="light-media"><iframe height="100%" width="100%"></iframe></div>');
	if ( w!=undefined ) { $("#light-media").css({ width: w }); }
	if ( h!=undefined ) { $("#light-media").css({ height: h }); }
	$("#light-media iframe").attr("src",urltoload);
	$("#light-media").lightbox_me({ centered: true, destroyOnClose: true });
}*/

function ShowPhoto(fileid) 
{
  window.open('/photo/show/' + fileid + '/');
  //window.open('/photo/show/' + fileid + '/','','resizable=yes, menubar=no, status=no, scrollbars=yes, statusbar=no, toolbar=no, width=700, height=600').focus();
  return false;
}

function resize(){
	  var obj = window.document.getElementById('media_photo');
	  if(obj) { 
	    window.resizeTo (obj.width+90, window.document.body.scrollHeight + 80);
	  }
}

function mainResize() {
	if (window.innerWidth>1200 || document.documentElement.offsetWidth>1200) {
		document.documentElement.className="wide";
	} else {
		document.documentElement.className="";
	}
}
mainResize();
//window.onload = mainResize;
window.onresize = mainResize;

/*$(document).ready(function(){
	$(".bb-img a").click(function(){
		var toload = $(this).attr("href");
		$("body").append('<div style="display: none; background: #fff; padding: 5px;" class="bb-img" id="temp-img"><img src="'+toload+'" style="display: block;"/></div>')
		$("#temp-img").lightbox_me({ centered: true, destroyOnClose: true });
		return false;
	});
});*/

