function openWindow(url, type, width, height, winName) {
	var paramStr="";
	if (type=="console") {
		paramStr="resizable,height="+height+",width="+width;
	} else if (type=="econsole") {
		paramStr="resizable,scrollbars,height="+height+",width="+width;
	} else if (type=="fixed") {
		paramStr="status,height="+height+",width="+width;
	} else if (type=="elastic") {
		paramStr="toolbar,menubar,scrollbars,"+"resizable,location,height="+height+",width="+width;
	}
	if(!winName) {
		winName = ('myWin_'+url.substr(0,url.indexOf("."))).replace(/[\/\\]/g,'_');
	}
	winObj = window.open(url, winName, paramStr);
	winObj.focus();
}

function openContact() {
	openWindow( 'http://www.bluemarmot.com/contact.php?ws=ut13', 'console', '350', '475', 'contactWin' );
}

function openPrivacy(from)
{
	openWindow('http://www.bluemarmot.com/privacy.phtml?ws=ut13', 'econsole', '450', '500', 'privacyWin' );
}

function openPics() {
	openWindow( 'pics.phtml?0', 'console', '475', '550', 'picWin' );
}

function openRegister() {
	openWindow( 'reg/', 'console', '600', '450', 'regWin' );
}

function openLst() {
	openWindow( 'lst.phtml', 'console', '350', '300', 'lstWin' );
}

function openScans() {
	openWindow( 'scans.phtml', 'econsole', '500', '550', 'scansWin' );
}


var clickmessage="This image is copyrighted. Please contact me for permission to use."

var PIMG = "main_img";
function disableclick(e) {
	if (document.all) {
		if (event.button==2||event.button==3) {
			if (event.srcElement.id==PIMG){
				alert(clickmessage);
				return false;
			}
		}
	}
	else if (document.layers) {
		if (e.which == 3) {
			alert(clickmessage);
			return false;
		}
	}
	else if (document.getElementById){
		if (e.which==3&&e.target.id==PIMG){
			alert(clickmessage)
			return false
		}
	}
}

function init_p() {
	if (document.all)
		document.onmousedown=disableclick
	else if (document.getElementById)
		document.onmouseup=disableclick
	else if (document.layers)
		document.images[PIMG].onmousedown=disableclick;
}
