
// You can edit the following:

// the width of the window
var mmq_width = 350;

// the height of the window
var mmq_height = 603;

// the html file that will be loaded into the window
var mmq_htmlfile = '123-site.html';

//the border color
var mmq_bordercolor = '#888888';

///////////////////////////////////////////////////////
/////// DO NOT EDIT BELOW THIS LINE ///////////////////
///////////////////////////////////////////////////////

function getposxy(e)
{
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft	+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop 	+ document.documentElement.scrollTop;
	}
	mmq_x = posx - mmq_width/2;
	mmq_y = posy - mmq_height/2;
	if(mmq_x < document.body.scrollLeft) mmq_x = document.body.scrollLeft + 10;
	if(mmq_y < document.body.scrollTop ) mmq_y = document.body.scrollTop + 10;
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			mmq_winW = window.innerWidth-16  + document.body.scrollLeft;
			mmq_winH = window.innerHeight-16 + document.body.scrollTop;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			mmq_winW = document.body.offsetWidth-20 + document.body.scrollLeft	+ document.documentElement.scrollLeft;
			mmq_winH = document.body.offsetHeight-20 + document.body.scrollTop + document.documentElement.scrollTop;
		}
	}
}
function click(e)
{
	getposxy(e);
	if(
	(navigator.appName == 'Netscape') &&
	(e.which == 3)
	)
	{
		openWindow();
		return true;
	}
	else
	{
		if(navigator.appName == 'Microsoft Internet Explorer' && event.button==2)
		{
			openWindow();
			return true;
		}
	}
	return true;
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

var mmqwind = null;
var mmq_x = 100;
var mmq_y = 100;
var mmq_winH = 500;
var mmq_winW = 700;

addLoadEvent(function() {
	if (document.layers) {
		document.captureEvents(Event.MOUSEDOWN);
	}
	document.onmousedown = click;
	document.oncontextmenu = function(){return false;};
	
	x = document.createElement('div');
	x.setAttribute('id','mmqwind');
	document.body.appendChild(x);
	xtext = "<div style='border:1px solid "+mmq_bordercolor+" !important;text-align:right !important;background:#0099FF !important;padding:5px !important;'><a href='#' style='font-family:verdana !important;font-weight:bold !important;font-size:13px !important;color:#990000 !important;' onClick='closeWindow(); return false;'>[Close]</a></div>";
	xtext += "<iframe style='border:1px solid "+mmq_bordercolor+";background:white;' oncontextmenu='return false;' id='mmq_iframe' name='mmq_iframe' border='0' src='"+mmq_htmlfile+"' width='"+(mmq_width-2)+"' height='"+(mmq_height-30)+"'></iframe>";
	xtext += "";
	x.innerHTML = xtext;
	x.style.display = 'block';
	x.style.position = 'absolute';
	x.style.top = '-1000px';
	x.style.left = '-1000px';
	x.style.background = '#ffffff';
	x.style.width = mmq_width+'px';
	x.style.height = mmq_height+'px';
	mmqwind = x;
});

function openWindow()
{
	x = mmqwind;
	if(mmq_x + mmq_width > mmq_winW) { mmq_x = mmq_winW - mmq_width -5 };
	if(mmq_y + mmq_height > mmq_winH) { mmq_y = mmq_winH - mmq_height -5 };
	x.style.top = mmq_y + 'px';
	x.style.left = mmq_x + 'px';
	x.style.display = 'block';
	window.frames['mmq_iframe'].document.oncontextmenu = function(){return false;};
	return false;
}
function closeWindow()
{
	mmqwind.style.display = 'none';
	return false;
}