function adjustPhotoLinks() {

	if(counter >= maxCounter) {
		document.getElementById("nextLink").disabled = true;
	} else {
		document.getElementById("nextLink").disabled = false;
	}

	if(counter <= 1) {
		document.getElementById("previousLink").disabled = true;
	} else {
		document.getElementById("previousLink").disabled = false;
	}
}

function backToThumbNails() {

	document.getElementById("thumbs").className = "";
	document.getElementById("closeUps").className = "hideArea";

}

function trimString(thisString) {
	return thisString.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 
}

function openDialogWin(target) {

	win1 = window.open(target,'loyalReferral','menubar=no,resizable=yes,scrollbars=no,top=20,left=20,width=420,height=500');
	if (win1 == null) {
		alert("Error opening Window!");
	}
	else
	{
		win1.focus();
	}
}

function openLargeDialogWin(target) {

	win1 = window.open(target,'pkgOption','menubar=no,resizable=yes,scrollbars=no,top=20,left=20,width=670,height=700');
	if (win1 == null) {
		alert("Error opening Window!");
	}
	else
	{
		win1.focus();
	}
}
