function imagePopup(url){
	if(typeof(url)!="object"){
		window._w = window.open("","","width=30,height=30,scrollbars=no,resizable=yes");
		window._w.document.open();
		window._w.document.write('<html><head><title>::</title></head><body style="margin:0px"><a href="#" onclick="self.close(); return false;"><img src="'+url+'" border="0" alt="" onload="opener.imagePopup(this);" /></a></body></html>');
		window._w.document.close();
	}
	else{
		zoomwndw(url.width,url.height, window._w);
	}
}

function open_dialog(url, width, height) {
	var leftPos = (screen.availWidth - width) / 2
	var topPos = (screen.availHeight - height) / 2 
	Win = window.open(url,'','width=' + width + ',height=' + height + ',scrollbars=yes,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}


function zoomwndw(maxx, maxy, win) {
	var myWidth = 0, myHeight = 0;
	if(typeof(win.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = win.innerWidth;
		myHeight = win.innerHeight;
	}
	else {
		if( win.document.documentElement && ( win.document.documentElement.clientWidth || win.document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = win.document.documentElement.clientWidth;
			myHeight = win.document.documentElement.clientHeight;
		}
		else {
			if( win.document.body && ( win.document.body.clientWidth || win.document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = win.document.body.clientWidth;
			myHeight = win.document.body.clientHeight;
			}
		}
	}
	vch = maxy - myHeight; 
	vcw = maxx - myWidth; 
	win.resizeBy(vcw,vch);
}

