﻿function openDownloadViewer (theFile, theTitle, theID)
{
downloadWin=window.open('http://www.stertiluk.com/stertilkoni/downloadviewer.asp?file='+theFile+'&downloadtitle='+theTitle+'&id='+theID,'downloadWindow','width=750,height=600,location=no,toolbars=no,scrollbars=yes,status=yes');
}

function openDownloadViewerDWG (theFile, theTitle, theID)
{
downloadWin=window.open('http://www.stertiluk.com/stertilkoni/downloadviewerdwg.asp?file='+theFile+'&downloadtitle='+theTitle+'&id='+theID,'downloadWindow','width=750,height=600,location=no,toolbars=no,scrollbars=yes,status=yes');
}

function openLargeReference (theID)
{
largeImageWin=window.open('http://www.stertiluk.com/stertilkoni/referencelarge.asp?id='+theID,'referenceImageWindow','width=790,height=620,location=no,toolbars=no,scrollbars=yes,status=yes');
largeImageWin.focus();
}

function openVideoViewer (theFile, theTitle)
{
videoWin=window.open('http://www.stertiluk.com/stertilkoni/videoviewer.asp?file='+theFile+'&title='+theTitle,'videoWindow','width=500,height=500,location=no,toolbars=no,scrollbars=yes,status=yes');
videoWin.focus();
}

function openVolvoVegaVideo ()
{
videoWin2=window.open('http://www.stertiluk.com/stertilkoni/volvovegavideo.html','videoWindow2','width=500,height=470,location=no,toolbars=no,scrollbars=no,status=yes');
}

function checkEnquiryEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.enquiryemail.value)){
// when the site is dynamic use this line below instead of the one above
// if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm["emailaddress[1]"].value)){
return (true);
}
alert("Invalid E-mail Address! Please re-enter");
myForm.enquiryemail.select();
return (false);
}

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}
