// Popup

function popup(loc, width, height, scrollbars) {
	var _params = "width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,scrollbars="+scrollbars+",resizable=no,top=" + (screen.height-height)/2 + ",left=" + (screen.width-width)/2;

	var newWin = window.open(loc, 'window', _params);
	newWin.focus();
}

// Hide Status Bar

function hidestatus(){
window.status='www.vahagnartgallery.com'
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus

// Disable Select

function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false")

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}

// Disable Right-click

document.oncontextmenu = function(){return false}
if(document.layers) {
    window.captureEvents(Event.MOUSEDOWN);
    window.onmousedown = function(e){
        if(e.target==document)return false;
    }
}
else {
    document.onmousedown = function(){return false}
}

// Fight Spam

function fightSpam(user,domain)
{
		locationstring = "mailto:" + user + "@" + domain;
		window.location = locationstring;
}

// External Links

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;