window.onerror=null;
var popup;
var popup2;
var movie;
var title;
var src;
var mheight;
var mwidth;
var curmovie;


// openWin is used for all normal dimension (small) product demos. For larger demos, like etraining, use openWin2
function openWin(movie) {

	if (popup="closed") popup = window.open("http://www.sierragold.com/demo.html", "popup", "screenX=25,screenY=25,directories=no,height=486,width=700,location=no,menubar=no,toolbar=no,status=no,dependent=no,resizable=no,scrollbars=no,titlebar=no,top=25,left=25");
//for development, window path is /newwebsite/(sitename)/demo.html
//for staging, window path is /staging/(sitename)/demo.html
//for live version, window path is http://www.sierragold.com/demo.html


	else popup.location.reload(true);
	popup.focus();
	document.getElementById('movie').innerHTML=movie;
}

// openWin2 is used for larger demos, like etraining. For all normal dimension (small) product demos, use openWin
function openWin2(movie) {

	if (popup2="closed") popup2 = window.open("http://www.sierragold.com/demo.html", "popup2", "screenX=25,screenY=25,directories=no,height=645,width=800,location=no,menubar=no,toolbar=no,status=no,dependent=no,resizable=no,scrollbars=no,titlebar=no,top=25,left=25");
//for development, window path is /newwebsite/(sitename)/demo.html
//for staging, window path is /staging/(sitename)/demo.html
//for live version, window path is http://www.sierragold.com/demo.html


	else popup2.location.reload(true);
	popup2.focus();
	document.getElementById('movie').innerHTML=movie;
}


// set compatible object model
function getObject(obj) {

	if (document.all) {
		if (typeof obj == "string") 
			return document.all(obj).innerHTML;
		else
			return obj.innerHTML;
	}

	if (document.getElementById) {
		if (typeof obj == "string") 
			return document.getElementById(obj).innerHTML;
		else 
			return obj.innerHTML;
	}

	return null;
}

function whichMovie(movie)
{
	switch (movie){
		case "datawizard":
			title = "DataWizard Demo";
			src = "datawizard_skin.swf";
			mwidth = "700";
			mheight = "436";
			break;

		case "dynamic":
			title = "Dynamic Reports Demo";
			src = "dynamicreports_skin.swf";
			mwidth = "700";
			mheight = "486";
			break;

		case "netquery":
			title = "NetQuery Demo";
			src = "netquery_skin.swf";
			mwidth = "700";
			mheight = "436";
			break;

		case "voip":
			title = "VoIP Demo";
			src = "voip_skin.swf";
			mwidth = "700";
			mheight = "436";
			break;

		case "vts":
			title = "Sierra Gold VTS Demo";
			src = "intro_skin.swf";
			mwidth = "700";
			mheight = "436";
			break;

		case "etraining":
			title = "eTraining Demo";
			src = "webdemo_skin.swf";
			mwidth = "800";
			mheight = "645";
			break;

		default:
			title = "Sierra Gold VTS Demo";
			src = "intro_skin.swf";
			mwidth = "700";
			mheight = "436";
	}
}


// initialize movie
function setMovie() {

	whichMovie(curmovie);
	document.title=title;
	document.getElementById("mcode").innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='" + mwidth + "' height='" + mheight + "' title='" + title + "' id='Captivate1'><param name='movie' value='flash/" + src + "'><param name='quality' value='high'><embed src='flash/" + src + "' quality='high' pluginspage='http://www.adobe.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + mwidth + "' height='" + mheight + "'></embed></object>";
}


