sendAFriendStatus = 0;  // 0=hidden 1=showing
sendAFriendMsgStatus = 0;

//Scroll Function Placeholder to be redefined when needed on a page-by-page basis
function doScroll() {		}

function clearInput(inId,inVal) {
	inValue = document.getElementById(inId).value;
	if (inValue == inVal) {
		document.getElementById(inId).value = '';
	}
}

function newsSignup() {
	email = document.getElementById('nlemail').value;
	
	if ((email)&&(email!='enter email')&&(email.indexOf("@")!=-1)&&(email.indexOf(".")!=-1)) {
		outUrl = '/ajax/newssignup.php?email='+escape(email);

		$.get(outUrl, function(data){
			if (data == 'true') {
				alert('Thanks for subscribing!');
			} else {
				alert(data);
			}
		});
	} else {
		alert('Please enter a valid email address.');
	}
}

preLoad = new Image();
preLoad.src = '/images/loading450.png';

function doImg(inImg,stay) {
	if ((imgList)&&(imgList[inImg])) {
		document.getElementById('itemImage').src = preLoad.src;
		nextImg = 1;
		if (imgList[inImg+1]) {	nextImg = inImg+1;	}
		document.getElementById('itemImage').src = imgList[inImg].src;
		document.getElementById('itemImageA').href = 'javascript:doImg('+nextImg+')';
		if (!stay) {	window.scrollTo(0,200);	}
	}
	
}

function showAFriend() {
	if (!sendAFriendStatus) {
		$("#sendAFriend").show('blind',500);
		//document.getElementById('sendAFriend').style.display = 'block';
		sendAFriendStatus = true;
	}
}

function closeAFriend(inMsg) {
	if (sendAFriendStatus) {
		$("#sendAFriend").hide('blind',500);
		//document.getElementById('sendAFriend').style.display = 'none';
		sendAFriendStatus = false;
		if (inMsg) {	showSendAFriendMessage(inMsg);	}
	}
}

function showAFriendMsg() {
	$("#sendAFriendMsg").show('blind',500);
	//document.getElementById('sendAFriendMsg').style.display = 'block';
}

function hideAFriendMsg() {
	$("#sendAFriendMsg").hide('blind',500);
	//document.getElementById('sendAFriend').style.display = 'none';
	clearTimeout(sendAFriendMsgStatus);
}

function showSendAFriendMessage(inMsg) {
	document.getElementById('sendAFriendMsg').innerHTML = inMsg + '<br><br>';
	showAFriendMsg();
	sendAFriendMsgStatus = setTimeout('hideAFriendMsg();',5000);
}

function doConditionDefinitions() {
	defwin = window.open('definitions.php','hsdefinitions','top=50,left=50,width=600,height=400');
	defwin.focus();
}
