function showPic (fvPicSrc) {
	if (document.getElementById) {
		document.getElementById('picsHolder').src = fvPicSrc.href;
		return false;
	} else {
		return true;
	}
}

function fAskForReset () {
	var confirm = window.confirm("Are you sure you want to clear the fields?" + "\n" +
								 "Click OK if yes, or CANCEL if you don't want to clear them");
	if (confirm) {
		return true;
	} else {
		return false;
	}
}

function fCheckForm () {
	var myForm = document.emailform;
	
	var validForm = false;
	
	var validName = false;
	var validEmail = false;
	var validMsg = false;
	
	if ((myForm.name.value) && (myForm.name.value != "your name here")) {
		validName = true;
	} else {
		alert("Please provide your name.");
		myForm.name.focus();
		return false;
	}
	
	if (myForm.company.value == "your company name") {
		myForm.company.value = "";
	}
	
/* email checking function */
	var emailAddress = new String(myForm.email.value);
	var atIndex = emailAddress.indexOf("@");
	var dotIndex = emailAddress.indexOf(".", atIndex);

	if ((atIndex > 0) && (dotIndex > atIndex+1) && (emailAddress.length > dotIndex+1)) {
		validEmail = true;
	} else {
		alert("Please provide a valid e-mail address.");
		myForm.email.focus();
		return false;
	}
/* email checkeing finished */
	
	if (myForm.subject.value == "e-mail subject") {
		myForm.subject.value = "";
	}
	
	if ((myForm.msg.value) && (myForm.msg.value != "your message here")) {
		validMsg = true;
	} else {
		alert("Please fill in the messege field.");
		myForm.msg.focus();
		return false;
	}
	
	if ((validName) && (validEmail) && (validMsg)) {
		return true;
	} else {
		alert("Some data missing");
		return false;
	}
}

function openWindow (fvSrc,fvWidth,fvHeight,fvScroll) {
	fvParams = "directories=no," +
			   "height=" + fvHeight + "," +
			   "width=" + fvWidth + "," +
			   "location=no," +
			   "menubar=no," +
			   "resizable=no," +
			   "scrollbars=" + fvScroll + "," +
			   "status=yes,"+
			   "toolbar=no";
	newWindow = window.open(fvSrc,null,fvParams);
}

function fWindowWidth (fvWidth,fvHeight) {
	window.resizeTo(fvWidth,fvHeight);
}

function fToggleDivs(fvActiveDiv,fvDirection) {
	switch (fvDirection) {
		case "next":
			newDiv = fvActiveDiv + 1;
			break;
		case "prev":
			newDiv = fvActiveDiv - 1;
			break;
	};
	
	document.getElementById('part' + activeDiv).style.display = "none";
	document.getElementById('part' + newDiv).style.display = "block";
								
	activeDiv = newDiv;
}

function legalPopup() {
    window.open('legalInfo.html', 'legal', 'width=330, height=190, scrollbars=0, resizable=0, toolbar=0');
	return false;
}