var saveWidth = 0;
var maxWidth = 500;

function scaleImg(what,isAjax){
what = document.getElementById(what);
if (navigator.appName=="Netscape")
winW = window.innerWidth;
if (navigator.appName.indexOf("Microsoft")!=-1)
winW = document.body.offsetWidth;
if (what.width>(maxWidth) || saveWidth>(maxWidth)) {
if (what.width==(maxWidth))
what.width=saveWidth;

else
{
saveWidth = what.width;
what.style.cursor = "pointer";
what.width=(maxWidth);
}

}
//var parentWidth=what.width+10;
//document.getElementById("big-photo").style.width=parentWidth;
if(isAjax)Modalbox.resizeToContent();
}

var bigpopup;
function bigpopup(url) {
	//bigpopup = Dialog.alert({url: url, options: {method: 'get'}}, {className:"alphacube", width:"800px", height:"550px", okLabel:"Close"});
	//setTimeout('cbk_bigpopup();',1000);
var width=$('page').getWidth();
if (width <= 50) width=200;
width = width - (width*0.1);
var height=$('page').getHeight();
if (height <= 100) height=300;
height = height - (height*0.05);
	Modalbox.show(url,{title: "High Resolution",width: width,height: height});
}

function showcomments(url) {
	url += "?showcomments=1";
	new Ajax.Updater('popupcontainer', url);
}

function addcomment(url) {
        url += "?addcomment=1";
        new Ajax.Updater('popupcontainer', url);
}

function showcode(url) {
	url += "?showcode=1";
        new Ajax.Updater('popupcontainer', url);
}

function invite(url) {
	url += "?invite=1";
        new Ajax.Updater('popupcontainer', url);
}
