var VET_IfVer="05.00.02.13",
VET_ch,
VET_Ap=navigator.appName,
VET_Bv=parseInt(navigator.appVersion.substring(0,1)),
VET_Ag=navigator.userAgent.toLowerCase(),
VET_IE=VET_Ag.indexOf("msie")!=-1&&(VET_Bv>=4)&&VET_Ag.indexOf("opera")==-1,
VET_IE5=(VET_IE&&(VET_Ag.charAt(VET_Ag.indexOf('msie')+5)=='5')),
VET_Firefox=VET_Ag.indexOf('firefox')!=-1,
VET_Safari=((VET_Ag.indexOf("safari/")!=-1) && (parseInt(VET_Ag.substring(VET_Ag.indexOf("safari/")+7,VET_Ag.length)) >= 100)),
VET_NN=VET_Ap.indexOf("Netscape")!=-1,
VET_NN4=VET_NN&&VET_Bv==4,
VET_Gecko=VET_Ag.indexOf('gecko')!=-1,
VET_CS=VET_Ag.indexOf('cs 2000 7')!=-1,
VET_AOL=VET_Ag.indexOf('aol')!=-1,
VET_NN6=VET_NN&&(parseInt(navigator.vendorSub)==6),
VET_NN7=VET_NN&&(parseInt(navigator.vendorSub)==7)&&!VET_CS,
VET_AppVer=parseFloat(navigator.appVersion),
VET_XP=VET_Ag.indexOf("nt 5.1")!=-1,
VET_Vista=VET_Ag.indexOf("nt 6.")!=-1,
VET_Win=navigator.platform=="Win32",
VET_Mac=VET_Ag.indexOf('mac')!=-1,
VET_Java=navigator.javaEnabled(),
VET_Mim="application/x-mtx",
VET_Cv=VET_Hff=VET_Mc=VET_Dbg=VET_Sdr=0,
VET_NNtrgr="0",VET_Pu,
VET_AxPriID="03F998B2-0E00-11D3-A498-00104B6EB52E",
VET_AxPriNa="AxMetaStream.MetaStreamCtl",
VET_AxSecID="1B00725B-C455-4DE6-BFB6-AD540AD427CD",
VET_AxSecNa="AxMetaStream.MetaStreamCtlSecondary",
VET_AltPlugin=0,
VET_AxID=VET_AxPriID,
VET_Gnns=VET_Gac=VET_Gurl=VET_Gnam=VET_Gprp="",
VET_Dv="http://www.viewpoint.com/installer/",
VET_Re=VET_Dv+'index.html?',VET_Ln="none",VET_Tr="Trigger",VET_Rtyp=1,
VET_Ic="ISceneComponent",VET_Cf="ComponentFileName",
VET_Sc="SceneComponent.mtc",VET_Bk="BroadcastKeyFileURL",
VET_Premium=false,
VET_TopURL="",
VMPSupport,
VET_VistaHostMin=50659328,
VET_SupportURL="https://components.viewpoint.com/MTSInstallers/vmpSupport.js";

if(!window.VET_WindowID)VET_WindowID=(new Date()).getTime()+"_"+Math.floor(Math.random()*10000)
function VET_Mili(){var v=new Date();return v.getTime()}
function VET_Rand(f){return Math.floor(Math.random()*f)}
VET_StartGid=((VET_Mili()%100000)*10000)+VET_Rand(10000)
MTSPlugin.prototype.genid=VET_StartGid

function Check_OSX()
{
	if (!VET_Mac) return false
	if (VET_Ag.indexOf("mac os x") != -1) return true
	if (navigator.plugins)
		for(var i=0;i<navigator.plugins.length;i++){
			if(navigator.plugins[i].name.toLowerCase()=="default plugin carbon.cfm")return true
		}
	return false
}
VET_MacOSX=Check_OSX()

document.write('<script type="text/javascript" src="'+VET_SupportURL+'" id="VMPSupportLib"></script>');	
var localMsg = 'You are not online.\n\nViewpoint Media Player can not auto-install without an internet connection.';

VMPInstalled = function()
{ 
	if (typeof _VMPInstalled != "undefined") return _VMPInstalled() 
	else {
		var i = true, m = "MetaStream" + (VET_Mac? "3" : " 3 Plugin")
		if (VET_IE && !VET_Mac) i = VET_Ax()
		else i = VET_Np(VET_Mim, m)
		return i
	}
}

VMPSupported = function() 
{ 
	if (typeof _VMPSupported != "undefined") return _VMPSupported() 
	else {
		var VET_WinIESupport = (VET_IE&&(VET_Ag.charAt(VET_Ag.indexOf('msie')+5)*1 >= 5));
		var VET_WinNNSupport = (VET_NN&&(parseInt(navigator.vendorSub) >= 7) && !VET_CS);
		var VET_WinAOLSupport = (VET_AOL&&(VET_Ag.charAt(VET_Ag.indexOf('aol')+4)*1 >= 7));
		if (VET_MacOSX && (VET_Safari || VET_IE5) && (VET_Ag.indexOf("ppc") >= 27)) return true;
		if ((VET_Win) && (VET_WinIESupport || VET_Firefox || VET_WinNNSupport || VET_WinAOLSupport || VET_CS)) return true;
		return false;
	}
}

VMPInstallWithFrame = function()
{ 
	if (typeof _VMPInstallWithFrame != "undefined") return _VMPInstallWithFrame()
	else alert(localMsg);
}

VMPInstallWithPopup = function()
{ 
	if (typeof _VMPInstallWithPopup != "undefined") return _VMPInstallWithPopup()
	else alert(localMsg);
} 	

VMPInstallURL = function() 
{ 
	if (typeof _VMPInstallURL != "undefined") return _VMPInstallURL() 
	else return "javascript:alert(localMsg)";
}

VET_Pu="Javascript:MTSopenBrWindow('"+VET_Re+"'+VET_Rtyp+'&"+VET_IfVer+"&"+window.location.href+"','vet_install','width=500,height=400,toolbar=no,location=no,resizable=no')"
if(VET_IE&&!VET_Mac)document.write("<SCRIPT LANGUAGE=\"VBScript\">\nDim p_o\nFunction VET_IEChk(n)\nVET_IEChk=1\nOn Error Resume Next\nSet p_o=CreateObject(n)\nif IsObject(p_o) then\nVET_IEChk=0\nend if\nEnd Function\n</SCRIPT>\n")
function MTSDebugger(i){VET_Dbg=i}
function MTSConsole(p1,p2){arguments.length==1?_mtsConsole(p1):_mtsConsole(p1,p2)}
function VET_Ci(arg){
	if(VET_ch==null||VET_ch.closed){
		if(arguments.length==1&&arg==1&&!VET_Premium){
			VET_Premium=true
			MTSJumpToRedirector()
			return
		}
		var e=new Date();e.setTime(e.getTime()+30000)
		SetCookie("VETInstallerPopup",("AutoReload; expires="+e.toGMTString()))
		var c=GetCookie("VETInstallerPopup")
		if((c!=""&&c.substring(0,10)=="AutoReload")||IsMTSInstalled())location.reload()
	}
	else setTimeout("VET_Ci(0)",1000)
}

function MTSopenBrWindow(u,n,f){VET_ch=window.open(u,n,f);setTimeout("VET_Ci(1)",2000)}

function testPlugin(create)
{	
	if (typeof _testPlugin != "undefined") _testPlugin(create)
	else {
		if (create) {
			var divTemp = document.createElement("div");
			divTemp.setAttribute("id","vmpTempDiv");
			divTemp.setAttribute("style",'position: absolute; top: 1px; left: 1px; z-index: 1000;');
			document.body.appendChild(divTemp);
			document.getElementById('vmpTempDiv').innerHTML = '<embed Component="ISceneComponent" Componentfilename="SceneComponent.mtc" type="application/x-mtx" name="vmpTest" id="vmpTest" width="2" height="2" script="true" VMPClassID="{03F998B2-0E00-11D3-A498-00104B6EB52E}"></embed>';
		} else {
			if (typeof document.getElementById('vmpTempDiv') == "object") 
			{
				var tempRef = document.getElementById('vmpTempDiv');
				tempRef.parentNode.removeChild(tempRef);
				tempRef.innerHTML = "";
			}
		}
	}
}

function VET_Np(mimetype,pluginName)
{
	if (VET_NN && VET_Gecko)
		navigator.plugins.refresh(false);
	
	if (navigator.plugins) 
	{
		for (var i = 0; i < navigator.plugins.length; i++) 
		{
			if (navigator.plugins[i].name.toLowerCase() == pluginName.toLowerCase()) 
			{
				for (var j = 0; j < navigator.plugins[i].length; j++) 
				{
					var mim = navigator.plugins[i][j]
					if (mim.enabledPlugin && (mim.type == mimetype)) 
					{
						if (VET_Win && VET_Gecko && (document.body != null)) 
						{
							testPlugin(true);
							var VMPHostObj = false;
							try
							{
								VMPHostObj = typeof document.getElementById('vmpTest');
							}
							catch(e)
							{
								testPlugin(false);
								return false
							}
							if(VMPHostObj != false)
							{
								var retval = true;
								if (VET_Vista)
								{
									var VMPHostVer = document.embeds.vmpTest.DoCommand('GetVersion(Host)');
									if (VMPHostVer != "No base control" && VMPHostVer >= VET_VistaHostMin)
										retval = true;
									else
										retval = false;
								}
								
								setTimeout('testPlugin(false)',500);
								return retval;
							}
							else
							{
								testPlugin(false);
								return false;
							}
						}
						else if (VET_Mac && VET_Gecko && (!VET_Safari))
						{
							return false;
						}
						else
						{
							return true;
						}
					}
				}
				return false;
			}
		}
	return false;
	}
}

function VET_Ax()
{
	if (typeof _VET_Ax != "undefined") return _VET_Ax();
	else {
		if (VET_Vista) {
			var vmpCreated = false;
			try {
				var vetObj = new ActiveXObject("AxMetaStream.MetaStreamCtl");
			} catch(e) {
				if (e.description.indexOf("Automation") != -1) return false
			}
			var VMPHostVer = vetObj.PluginCommand('GetVersion(Host)',0,0);
			if (VMPHostVer != "No base control" && VMPHostVer >= VET_VistaHostMin)
				return true;
			else
				return false;
		}
		if(VET_IEChk(VET_AxPriNa)==0)return true
		if(VET_AltPlugin==1&&VET_IEChk(VET_AxSecNa)==0){VET_AxID=VET_AxSecID;return true}
		return false
	}
}

function IsMTSInstalled() { return VMPInstalled() }

MTSPlugin.prototype.createParams=function(pi)
{
	this.newParamString=""
	var cMV="50333440",gMV="50333440";this.LN=VET_Ln;var parms=""
	var hMV="50333440"
	if(pi!=null){var xso=pi.indexOf("xmltext")
		if(xso!=-1){var opi=pi,xs=xso+7
			while((xs<pi.length)&&(pi.substring(xs,xs+1)!="<"))xs++
			if(xs<pi.length){var xe=xs,xc=0
				while(xe<pi.length){var chr=pi.substring(xe++,xe)
					if(chr=="&")xc=2;else if(chr==";"){if(xc>0)xc--;else{xe--;break}}
				}
				var xt=pi.substring(xs,xe)
				parms+=AddParm("xmltext",xt)
				if(opi.substring(xe,xe+1)==";")xe++
				pi=opi.substring(0,xso)
				if(xe<opi.length-1)pi+=opi.substring(xe,opi.length)
			}
		}
	}
	if(pi!=null){var tA=pi.split(";")
		for(var i=0;i<tA.length;i++){
			if(tA[i]!=""){var tV=tA[i].split("=");re= / /g;
				tV[0]=tV[0].replace(re,"");var tv0l=tV[0].toLowerCase()
				if(tv0l=="genieminimumversion"){tV[1]=tV[1].replace(re,"");gMV=tV[1]}
				else if(tv0l=="hostminimumversion"){tV[1]=tV[1].replace(re,"");hMV=tV[1]}
				else if(tv0l=="componentminimumversion"){tV[1]=tV[1].replace(re,"");cMV=tV[1]}
				else if(tv0l=="classid"){tV[1]=tV[1].replace(re,"");VET_AxID=tV[1]}
				else if(tv0l=="layer"){tV[1]=tV[1].replace(re,"");this.LN=tV[1]}
				else if(tv0l=="componentname"){tV[1]=tV[1].replace(re,"");VET_Ic=tV[1]}
				else if(tv0l=="imagelink"){tV[1]=tV[1].replace(re,"");this.ImageLink=tV[1]}
				else if(tv0l=="altplugin"){tV[1]=tV[1].replace(re,"");if(tV[1]=="1"||tV[1]=='true')VET_AltPlugin=1;else VET_AltPlugin=0}
				else if(tv0l=="basehref"){tV[1]=tV[1].replace(re,"");if(tV[1]=="1")this.newParamString+="basehref"+"="+VET_href(this.LN)+";"}
				else if(tv0l=="topurl")
				{
					tV[1]=tV[1].replace(re,"");
					if(VET_TopURL=="")VET_TopURL=tV[1]
				}
				else{var idx=1,token1=tV[idx-1],token2=tV[idx];idx++
					while(tV[idx]!=null){token2+="="+tV[idx];idx++}
					parms+=AddParm(token1,token2)
					this.newParamString+=token1+"="+token2+";"
				}
			}
		}
	}
	parms+=AddParm("HostMinimumVersion",hMV)
	if(VET_Mac&&VET_MacOSX)
		parms+=AddParm("WindowID",VET_WindowID)
	parms+=AddParm("ComponentMinimumVersion",cMV)
	parms+=AddParm("GenieMinimumVersion",gMV)
	parms+=AddParm("VMPClassID",("{"+VET_AxID+"}"))
	parms+=AddParm("PageURL",window.location.href)
	if(this.LN!=VET_Ln&&VET_Mac&&VET_IE)this.newParamString+="layername="+this.LN+";"
	this.newParamString+="parentlocation="+self.location.href+";"
	this.newParamString+="mts3interfaceversion="+VET_IfVer+";"
	this.newParamString+="referrer="+(window.VET_Referrer?window.VET_Referrer:window.location.href)+";"
	return parms
}
function AddParm(n,v){if(VET_IE&&VET_Win)return MTSParm(n,v);else return (n+" = "+"'"+v+"' ")}
function GetCookie(a){var e,m=" "+document.cookie+";",N=" "+a+"=",s=m.indexOf(N),r="";if(s!=-1){s+=N.length;e=m.indexOf(";",s);r=unescape(m.substring(s,e))}return r}
function SetCookie(n,v){document.cookie=n+"="+escape(v)}
function ClearCookie(n){var e=new Date();e.setTime(e.getTime()-(3*24*60*60*1000));document.cookie=n+"=ImOutOfHere; expires="+e.toGMTString()}
function GetBase(){var ob=document.getElementsByTagName('BASE');return ((ob&&ob.length)?ob[0].href:null)}
function VET_href(ln){var t="mtsEmpty.html",doc="",c,l
	doc+="document."
	eval("c="+doc+"links.length")
	var y="write(\"<a href='\"+t+\"'></a>\")"
	eval(doc+y)
	eval("l="+doc+"links[c].href")
	if(t==l)l=""
	else{var re= /mtsEmpty.html/g;
		l=l.replace(re,"")}
	if(VET_Gecko)l=GetBase()
	return l
}
function MTS_IsString(s){if(s=="")return true;for(var i=0;i<s.length;i++){if(((s.charAt(i)<"0")||(s.charAt(i)>"9"))&&(s.charAt(i)!=".")&&(s.charAt(i)!="-"))return true}return false}
function MTSWrapValue(v){var rs=v.toString();if(MTS_IsString(rs))rs="'"+rs+"'";return rs}

function MTSPlugin(file, width, height, bkey, alt, parmsc)
{	
	try { VET_TopURL = top.location.href } catch(e) {}
	VET_Premium = true;
	if (!this.ImageLink=="1") alt="popup";

	if (VET_Dbg == 1 && arguments.length > 6) MTSConsole("Error: MTSPlugin function takes up to 6 parameters. You supplied "+arguments.length+".")
	
	var str = VET_Ln, na = this.name = "MetaCtl" + MTSPlugin.prototype.genid.toString();
	
	MTSPlugin.prototype.genid++;
	this.LN = VET_Ln;
	this.ImageLink="0";
	
	if (VET_Hff == 0 && VET_Mac && (VET_IE || VET_Gecko))
	{
		VET_Hff = 1;
		document.write("<div id='HiddenLayer' style='position:absolute;left:-1000px;top:-1000px;width:0px;height:0;z-index:0;visibility:hidden'><form name='MTS3'><input type=text name='mts3_js_jsfield'></form></div>")
		if (VET_Mac && !VET_MacOSX) setTimeout('ExecValue()',3)
	}
	if (VET_MacOSX) {
		this.sequenceID = 0;
		document.write("<div id='OSX_S_" + this._mtsPID() + "' name='OSX_S_" + this._mtsPID() + "' style='position:absolute;left:2px;top:0px;width:2px;height:2px;visibility:visible;z-index:999999'></div>")
	}
	
	var parms = this.createParams(parmsc)
	VET_IsIn = IsMTSInstalled()	
	if ((alt.length != 0) && (!VET_IsIn)) str = alt;
	if((((str.toLowerCase() == VET_Ln) && (!VET_Mac)) || ((GetCookie(na) == "1") && (!VET_Mac))) && ((!(this.popUp == "1")) || (str.toLowerCase() == VET_Ln)) || (VET_IsIn))
	{
		if (VET_Win && VET_IE)
		{
			var ch = ""
			if (file != "") ch = MTSParm("Source", file)
			ch += MTSParm("Component", VET_Ic) + MTSParm(VET_Cf, VET_Sc) + MTSParm(VET_Bk, bkey)
			ch += parms;
			ch += MTSParm("properties", this.newParamString)
			var cbURL = "https://components.viewpoint.com/MTSInstallers/MetaStream3.cab" + "?url=" + (window.VET_Referrer ? window.VET_Referrer : window.location.href) + "#Version=3,0,2,62";
			str = MTSMarkup("object", ch, "id", na, "classid", ("CLSID:" + VET_AxID), "width", width, "height", height, ((MTSPlugin.prototype.genid == VET_StartGid + 1) ? "codebase" : "dummy"), cbURL)
			if (VET_Dbg == 1 ) MTSConsole(str, na)
			document.write(str)
		} else {
		
			var tag
			if (VET_Mac && VET_IE && !VET_IsIn) {
				MTSJumpToRedirector(this.LN)
			} else {
				if (VET_Mac) bkey = "http://www.viewpoint.com/installer/UniversalBroadcastKey.mtx";
				tag = "PluginURL"
				str = MTSMarkup("embed", "<!-- -->", "component", VET_Ic, "componentfilename", VET_Sc, "source", file, "type", VET_Mim, "width", width, "height", height, "script", true, "name", na, VET_Bk, bkey, "properties", this.newParamString, "instancename", na, tag, VET_Pu, parms)
			}
			
			if (this.LN != VET_Ln) {
				if (VET_Dbg == 1) MTSConsole(str,na)
				if (VET_IE || VET_Gecko)
				{
					document.write(str);
				} else {
					VET_Gnns = str;
					var v = "document." + this.LN + ".document.write(VET_Gnns);";
					eval(v)
				}
			} else {
				if (VET_Dbg == 1) MTSConsole(str,na)
				document.write(str)
			}
			
			if (GetCookie(na + VET_Tr) == "1") ClearCookie(na+VET_Tr)
		}
		if (this.ImageLink == "1") ClearCookie(na)
		
	} else {
	
		if ((this.ImageLink != "1" && this.popUp == "1") || ((GetCookie(na) == "1") && (this.popUp == "1")) || (str.toLowerCase() == "popup") || (VET_Mac && ((str == VET_Ln) || (GetCookie(na) == "1")))) 
		{
			if (this.ImageLink == "1") ClearCookie(na)
			if ((alt != VET_Ln) && (alt.toLowerCase() != "popup")) {
				VET_Gac = alt
				if (VET_Dbg == 1) MTSConsole(alt,na)
				document.write(alt)
			}
			MTSJumpToRedirector(this.LN)
			
		} else {
			
			if (this.ImageLink == "1") {
				VET_Premium = true;
				str2 = 'JavaScript:mtsClick("' + this.LN + '")';
				str = MTSMarkup("A",str,"HREF",str2)
			}
			VET_Gac = str
			if (VET_Dbg == 1) MTSConsole(str, na)
			document.write(str)
		}
	}
}

function mtsClick(ln)
{
	var t=""
	for(var i=VET_StartGid;i<MTSPlugin.prototype.genid;i++){t="MetaCtl"+i.toString();SetCookie(t,'1')}
	ClearCookie("VETInstallerPopup")
	if(GetCookie("MetaCtl0")=="1")location.reload()
	else MTSJumpToRedirector(ln);
}
function ExecValue()
{
	document.MTS3.mts3_js_jsfield.value="MTS3_Req";var v=document.MTS3.mts3_js_jsfield.value
	if((v!="")&&(v!="MTS3_Req")){eval(v);v="";document.MTS3.mts3_js_jsfield.value=""}
	if(v=="MTS3_Req")document.MTS3.mts3_js_jsfield.value=""
	setTimeout('ExecValue()',3)
}
MTSPlugin.prototype.Console=function(m){_mtsConsole(m,this._mtsPID())}
MTSPlugin.prototype.Execute=function(a,b,c,d,e,f){var v,l=arguments.length;if(l==0)v=this._mtsCall();else if(l==1)v=this._mtsCall(a);else if(l==2)v=this._mtsCall(a,b);else if(l==3)v=this._mtsCall(a,b,c);else if(l==4)v=this._mtsCall(a,b,c,d);else if(l==5)v=this._mtsCall(a,b,c,d,e);else if(l==6)v=this._mtsCall(a,b,c,d,e,f);return v}
MTSPlugin.prototype.SetProperty=function(n,p,v,t,o){if(arguments.length==5)return this.Execute("SetProperty",n,p,MTSWrapValue(v),t,o);else return this.Execute("SetProperty",n,p,MTSWrapValue(v),t)}
MTSPlugin.prototype.GetProperty=function(n,p,t){return this.Execute("GetProperty",n,p,t)}
MTSPlugin.prototype.TriggerAnim=function(a){return this.Execute("TriggerAnimation",VET_An(a))}
MTSPlugin.prototype.ReverseAnim=function(a){return this.Execute("ReverseAnimation",VET_An(a))}
MTSPlugin.prototype.StopAnim=function(a){return this.Execute("StopAnimation",VET_An(a))}
MTSPlugin.prototype.StartAnim=function(a){return this.Execute("StartAnimation",VET_An(a))}
MTSPlugin.prototype.ResetAnim=function(a){return this.Execute("ResetAnimation",VET_An(a))}
MTSPlugin.prototype.ToggleCollapse=function(n){this.SetProperty(n,'clps',this.GetProperty(n,'clps')==0?1:0)}
MTSPlugin.prototype.SetCollapsed=function(n,v){return this.SetProperty(VET_In(n),'clps',MTSWrapValue(v),'mts_int')}
MTSPlugin.prototype.ToggleVisible=function(n){this.SetProperty(n,'visb',this.GetProperty(n,'visb')==0?1:0)}
MTSPlugin.prototype.SetVisible=function(n,v){return this.SetProperty(VET_In(n),'visb',MTSWrapValue(v),'mts_int')}
MTSPlugin.prototype.ClearScene=function(){return this.Execute("ClearScene")}
MTSPlugin.prototype.TogglePano=function(n){this.SetProperty('MTSScene','paac',this.GetProperty('MTSScene','paac')==0?1:0)}
MTSPlugin.prototype.Render=function(){return this.Execute("Render")}
MTSPlugin.prototype.LoadMTX=function(p){return this.Execute("LoadMTX",p)}
MTSPlugin.prototype.ResetCamera=function(){this.SetProperty('MTSScene','rstc','0')}
MTSPlugin.prototype.GetVer=function(c){return this.Execute("GetVersion",c)}
MTSPlugin.prototype.GetLastErrCode=function(){return this.Execute("GetLastErrCode")}
MTSPlugin.prototype.GetLastPluginErr=function(t){return this.Execute("GetLastPluginErr",t)}
MTSPlugin.prototype.SetPluginErr=function(t,v){return this.Execute("SetPluginErr",t,v)}
MTSPlugin.prototype.GetAllPluginErrFor=function(t){return this.Execute("GetAllPluginErrFor",t)}
MTSPlugin.prototype.ClearAllPluginErrs=function(t){return this.Execute("ClearAllPluginErrs",t)}
MTSPlugin.prototype.ExecuteVETScript=function(vs){return this.Execute("VETScript(" + vs + ")")}
MTSPlugin.prototype.PostEvent=function(n,d){var a=arguments,x=d;for(var i=2;i<a.length;i++)x+=(","+arguments[i]);return this.Execute("PostEvent",n,x)}
function MTSMarkup(tag,c){var a=arguments
	if(a.length==0)return ""
	var i,s="<"+a[0]
	for(var i=2;i<a.length;i+=2){
		if(a[i+1]!=null)s+=(" "+a[i]+"=\'"+a[i+1]+"\'")
		else s+=" "+a[i]
	}
	s+=(c.length?(">"+c+"</"+a[0]+">"):("/>"))
	return s
}
function MTSParm(n,v){return MTSMarkup("param","","name",n,"value",v.toString())}
MTSPlugin.prototype._mtsPID=function(){return this.name}

function _mtsConsole()
{
	if(VET_Dbg!=1)return;
	var a=arguments;
	var ct=a.length;
	if(ct==0)return
	var msg=a[0].toString(),pn=(ct==1)?"Default":((a[1].constructor==MTSPlugin)?a[1].name:a[1].toString())
	if(VET_Mc==0)
	{
		VET_Mc = window.open("","console","width=700,height=400,resizable,scrollbars");
		if(!VET_Gecko)VET_Mc.document.write('<title>debug_output<\/title><plaintext>')
		VET_Mc.focus()
	}
	if (!VET_Mc.closed) {
		var s=pn+"> "+msg+"\n"
		if (!VET_Gecko) {
			VET_Mc.document.write(s)
		} else {
			var re= /</g;s=s.replace(re,"&lt;");
			re= />/g;s=s.replace(re,"&gt;");
			VET_Mc.document.write("<pre>"+s+"</pre>")
		}
	}
}

function VET_OSX_SendCommand(s,h,w){if(!(VET_IE||VET_Gecko))return
	var l=w.length,x="",o=VET_IE?eval("document.all['OSX_S_"+h+"']"):eval("document.getElementById('OSX_S_"+h+"')")
	for(var i=0;i<l;i++){var c=w.charAt(i)
		switch(c){
			case '\'':x+="`";break
			case '\"':x+="#";break
			case '#':x+="\\#";break
			case '`':x+="\\`";break
			case '\\':x+="\\\\";break
			default:x+=c;break
		}
	}
	o.innerHTML="<embed	Component='SCRIPT' type='application/x-mtx' name='MetaScriptCtl0' width='1' height='1' ScriptCommand='"+h+"_"+s+"_"+x+"' ScriptOutTgt='document.MTS3.mts3_js_jsfield.value' WindowID='"+VET_WindowID+"'>"
	return document.MTS3.mts3_js_jsfield.value
}
function VET_An(n){var s='MTSAnimator.';return n.indexOf(s)==0?n:s+n}
function VET_In(n){var s='MTSInstance.';return n.indexOf(s)==0?n:s+n}
MTSPlugin.prototype._mtsCall=function(){var ar=arguments,c=ar.length
	if(++c<2){alert('too little arguments for functions call');return false}
	var rg=ar[0]+'(',l=c-2,i,li=c-1,pn=this._mtsPID()
	for(var i=1;i<li;i++){rg+=ar[i];if(i<l)rg+=','}rg+=')'
	var pID=pn,r,replace= /MetaCtl/i;
	pID=pID.replace(replace,"")
	if(VET_Mac&&(VET_IE||VET_Gecko)){
		if(VET_MacOSX){
			r=VET_OSX_SendCommand(this.sequenceID++,pn,rg)
			if(VET_Dbg==1)MTSConsole(rg,pn)
		}else{var s=("MTS3_JS"+pn+":"+(rg)+";"),x='document.MTS3.mts3_js_jsfield.value=s;'
			eval(x)
			r=document.MTS3.mts3_js_jsfield.value;document.MTS3.mts3_js_jsfield.value=""
			if(VET_Dbg==1)MTSConsole(s)
		}
	}else{var p,d='document.'
		if(VET_Win&&VET_IE)p=d+'all.'+pn+'.PluginCommand(\"'+rg+'\",0,0);'
		else{var p1=d+'embeds.'+pn+'.DoCommand(\"'+rg+'\");'
			if(this.LN==VET_Ln)p=p1
			else{
				if(VET_Gecko)p=p1
				else p=d+this.LN+'.'+p1
			}
		}
		r=eval(p)
		if(VET_Dbg==1)MTSConsole(rg,pn)
	}
	return r
}

function MTSJumpToRedirector(ln) {
	VET_Premium = true;
	var c,t="var _FS='"
	if (VET_Sdr < 1 || VET_Premium) {
		VET_Sdr++
		c = GetCookie("VETInstallerPopup");
		var inf = (window.location.search.indexOf("noreloadredir") != -1)
		if((c != "" && c.substring(0,10) == "AutoReload") || inf){
			if((c.substring(10,17) == "Premium") || inf) {
				var e = new Date();
				e.setTime(e.getTime() + 30000)
				SetCookie("VETInstallerPopup",("AutoReload; expires=" + e.toGMTString()))
			}
			else ClearCookie("VETInstallerPopup")
			return
		}
		if (VET_Premium) {
			var e = new Date();
			e.setTime(e.getTime() + 30000)
			SetCookie("VETInstallerPopup",("AutoReloadPremium; expires="+e.toGMTString()))
			var p = GetCookie("VETInstallerPopup");
			var trg = VET_Re + VET_IfVer + "|frame&" + (VET_TopURL != "" ? VET_TopURL : window.location.href)
			setTimeout("top.location.href='" + trg + "';", 250);
			return
		}
	}
}

function hyp_test(){
	if(hypon==1){
	hyp = 	vmp.GetProperty('MTSBaseComponent' , 'smod' , 'mts_int');
		if(hyp==0){
			vmp.SetProperty('MTSInstance.hyper_start' , 'clps' , '0' , 'mts_int');
			vmp.SetProperty('MTSInstance.hyper_end' , 'clps' , '1' , 'mts_int');
			hypon = 0;
		}
 setTimeout("hyp_test()", 100);
	}
}
function load_anim(a){
vmp.LoadMTX("vet/anim.mtx");
}
function load_test(a){
	alert(a);
}
function open_top(){
	window.open("index.html" , "_self");
}
function open_contop(){
	window.open("catalog.html" , "_self");
}
function hyp_start(){
vmp.SetProperty('MTSBaseComponent' , 'smod' , '1' , 'mts_int');
hypon = 1;
hyp_test();
}



