// Open links in new window option- By spk100 (spk100@yahoo.com)
// Script featured on Dynamic Drive
// Visit http://www.dynamicdrive.com for this script and more

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function setLinkTargets() {
	where = "_blank";
	
	for (var i = 0; i <= (document.links.length - 1); i++) {
		var isFound = document.links[i].href.indexOf("joyfixation.org")

		if (isFound < 0 && document.links[i].href != "#") {
			document.links[i].target = where;
			throwaway = document.links[i].target;
		}
			
	}
}

function highlight(img, weshould) {
	if (weshould)
		img.filters.alpha.opacity = 50;
	else
		img.filters.alpha.opacity = 100;
}

function changeOpacity(img, opac) {
	img.filters.alpha.opacity = opac;
}

function openPic(gallery, img, width, height) {
    var date = new Date();
    var inc = date.getSeconds();

    theURL = 'photos.php?gallery=' + gallery + '&img=' + img + '&h=' + height + '&w=' + width;
    theName = 'win_' + inc;
    theScrollbars = 'scrollbars=no';
    theAttributes = 'location=no,status=no,resizable=no,scrolling=no,scrollbars=no,left=25,top=25,screenX=2,screenY=2,height=' + height + ',width=' + width;

	x = (screen.availWidth - width) / 2;
	y = (screen.availHeight - height - 100) / 2 ;
	
    WindowObj = window.open(theURL,theName,theAttributes);

	WindowObj.moveTo(x,y);
	WindowObj.focus();
}

function viewComments(n) {
    window.open('/comments.php?id=' + n, 'comments' + n, 'directories=0,height=480,location=0,resizable=1,scrollbars=1,toolbar=0,width=515');
}    

function viewImageComments(n) {
	window.open('comments_photos.php?id=' + n, 'comments' + n, 'directories=0,height=480,location=0,resizable=0,scrollbars=1,toolbar=0,width=450');
}

function viewRatings(n) {
	window.open('ratings.php?id=' + n, 'comments' + n, 'directories=0,height=480,location=0,resizable=0,scrollbars=1,toolbar=0,width=450');
}

