//scripts

// highlight item
function setHighlight(obj, flag){
	if (flag){
	obj.className='aHighlightH';
	}
	else {
	obj.className='aHighlight';
	}
}

// photo popup 
function WinPopUp(URL, winwidth, winheight) {
	winwidth = Math.max(winwidth + 10, 300); // keep min width to 300 (room for voting form)
	winheight = Math.max(screen.height - 65, winheight + 95); // add 95 pixels to make room for voting panel
	winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
	wintop = Math.max(0, (screen.height / 2) - (winheight / 2) - 35); // center the window top to bottom
	// show scrollbar only if we have reached max screen size
	if (wintop == 0){
	var scroll = "yes";
	}
	else {
	var scroll = "no";
	}
	var saveConfirm = window.open(URL, "_blank", 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth + ',status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=' + scroll);
}

function scorePopup(URL) {
	winwidth = 900; // width of the new window
	winheight = 600; // height of the new window
	winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
	wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
	var saveConfirm = window.open(URL, "_blank", 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth + ',status=no, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=yes');
}

function scoreDetails(URL) {
	winwidth = 800; // width of the new window
	winheight = 450; // height of the new window
	winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
	wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
	var saveConfirm = window.open(URL, "_blank", 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth + ',status=no, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=yes');
}

function sponsorPopup(URL) {
	winwidth = 600; // width of the new window
	winheight = 450; // height of the new window
	winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
	wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
	var saveConfirm = window.open(URL, "_blank", 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth + ',status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=no');
}

