//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);
	winheight = Math.max(winheight + 95, 600);
	winheight = Math.min(screen.height - 65, winheight);
	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 = 600; // width of the new window
	winheight = 350; // 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');
}

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');
}

function gotoBody( )
{
  document.form1.freviewdescription.focus();
}

function textCounter( field, countfield ) {
    countfield.value = field.value.length;
}
