/* global javascript file */

var currCaseStudyID = "";

/* general dom scripts */
function showContent(id) {
	document.getElementById(id).style.display = "block";
}
		
function hideContent(id) {
	document.getElementById(id).style.display = "none";
}

/* show/hide case study scripts */
function getCaseStudy(id) {
	newCaseStudyID = id;
	newCaseStudy = ("studyText"+newCaseStudyID);
	newCaseStudyImage = ("caseStudy"+newCaseStudyID);
	
	if(newCaseStudyID == 1)
	    window.location.href = "medical-rapid-prototyping.html";
	if(newCaseStudyID == 2)
	    window.location.href = "military-prototypes.html";
	if(newCaseStudyID == 3)
	    window.location.href = "consumer-goods-prototype.html";
	if(newCaseStudyID == 4)
	    window.location.href = "high-temperature-laser-sintering.html";
	
	if(currCaseStudyID!=="") {
		hideContent("studyText"+currCaseStudyID);
		document.getElementById("caseStudy"+currCaseStudyID).className = "";
		document.getElementById("caseStudy"+currCaseStudyID).src = "images/home_caseStudy"+currCaseStudyID+"off.jpg";
	} 
	else {
		document.getElementById("studyText00").style.display = "none";
	}
	
	showContent(newCaseStudy);
	document.getElementById(newCaseStudyImage).className = "selected";
	document.getElementById(newCaseStudyImage).src = "images/home_caseStudy"+newCaseStudyID+"on.jpg";
	
	currCaseStudyID = newCaseStudyID;
	
	

}

function caseStudyRollover(id) {
	document["caseStudy" + id].src = "images/home_caseStudy" + id + "on.jpg";
}
function caseStudyRollout(id) {
	document["caseStudy" + id].src = "images/home_caseStudy" + id + "off.jpg";
}


/* pop-up window script */
function launchPhoto(image)	{
	var prevWin=window.open('images/'+image,'pageTitle','width=810,height=620,scrollbars=0,left=50,top=50,screenx=50,screeny=50,resizable=no,toolbar=no,status=no,location=no');
	prevWin.focus();
}

