function over(x) {
    var c = x.src;
	var i = c.substr(c.lastIndexOf("."), 3);
	x.src = (c.substr(c.lastIndexOf(".")-5,5).indexOf("over") == 1) ? c.replace("_over","") : c.replace(i, "_over" + i);
}

function view(x,w,h) {
	var i = x.src.lastIndexOf('photos/');
	var n = (x.src.substr(i, x.src.length - i)).replace("thumbnails","images");
	w = (w != null) ? w : "640";
	h = (h != null) ? h : "390";
	window.open("browser.html?image=" + n, "browser", "width=" + w + ",height=" + h + ",screenX=50,screenY=50");
}

function blowup(x) {
	window.open('browser.aspx?image=' + x,'image','width=300, height=300, resizable=no');
}

// idiotic IE right placement fix
function fixright() {
	if(RIGHTTARGET == null) { return null; }
	if(document.documentElement.clientWidth % 2 != 0) {
		document.getElementById(RIGHTTARGET).style.right = "-1";
	} else {
		document.getElementById(RIGHTTARGET).style.right = 0;
	}
}

function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}