// JavaScript Document
var width = 0;
var height = 0;
var specials = 1; // 1 = enable and 0 = disable specials popup

function mag_onclick(file){
	getImgSize(file);
	if ((width > 0) && (height > 0)){
		window.showModalDialog(file,"", "dialogWidth:" + (width) + "px; dialogHeight:" + height + "px; center:yes; status:no;");
	}
}

function getImgSize(imgSrc){
	var myImage = new Image();
	myImage.name = imgSrc;
	myImage.onload = getWidthAndHeight;
	myImage.onerror = loadFailure;
	myImage.src = imgSrc;
}

function getWidthAndHeight() {
	width = this.width;
	height = this.height;
	return true;
}

function loadFailure() {
	width = 0;
	height = 0;
	return true;
}

function showSpecial(){
	if (specials == 1){
		window.showModalDialog("specials.html","", "dialogWidth:700px; dialogHeight:600px; center:yes");
	}
}
