//
// Copyright (c) 2003-2004 LaserAnimation Sollinger GmbH
// For use with Lpv Player only!
//
var lpv_thresh_versionx = "0001000000000056"; 
var lpv_latest_versionx = "0001000000000064"; 
function BrowserInfoClass ()
{
this.agent = navigator.userAgent.toLowerCase();
this.is_ie = (this.agent.indexOf("msie") != -1) && (this.agent.indexOf("opera") == -1);
this.is_mozax = false; 
this.IsIE = function () {return (this.is_ie);}
if ( ! this.IsIE()
&& navigator.plugins
&& navigator.plugins.length) {
var i;
for (i = 0; ! this.is_mozax && (i < navigator.plugins.length); i++) {
var plugin = navigator.plugins[i];
if ( (plugin.name.indexOf('ActiveX') != -1)
&& plugin.length) {
var m;
for (m = 0; ! this.is_mozax && (m < plugin.length); m++) {
var mime = plugin[m];
if (mime.type.indexOf('oleobject') != -1)
this.is_mozax = true; 
}
}
}
}
this.IsMozAx = function () {return (this.is_mozax);}
this.SupportsLpv = function () {return (this.is_ie || this.is_mozax);}
this.SupportsLpvScripting = function () {return (this.is_ie);}
}
var BrowserInfo = new BrowserInfoClass ();
function LpvGetActiveXStatus (versionx)
{
if (! document.getElementById)
return (0);
var lpv = document.getElementById ("Lpv");
if ( ! lpv
|| ( (lpv.offsetWidth == 0)
&& (lpv.offsetHeight == 0)))
return (0); 
if ( BrowserInfo.SupportsLpvScripting ()
&& (typeof (lpv.AboutBox) == "undefined") 
&& (typeof (lpv.LineWidth) == "undefined") 
)
return (100); 
if (typeof (lpv.LineWidth) == "unknown")
return (1000); 
if ( (typeof (lpv.GetLicenseAccepted) != "undefined")
&& ! lpv.GetLicenseAccepted ())
return (500); 
if (! versionx)
versionx = lpv_thresh_versionx;
if ( ! lpv.GetVersionX
|| (lpv.GetVersionX().toLowerCase() < versionx.toLowerCase()))
return (2000); 
return (5000);
}
function LpvCheckActiveXStatusSub (language, updating)
{
if (! document.getElementById)
return (-1); 
var lpv = document.getElementById ("Lpv");
var err = document.getElementById ("LpvError");
var tab = document.getElementById ("LpvTable");
if (! err) {
return (0); 
}
if (! language)
language = "e";
var url_base = "http://www.laseranimation.com";
if (window.location.host.toLowerCase().indexOf ("lasergraph-dsp") >= 0)
url_base = "http://www.lasergraph-dsp.de";
var status = LpvGetActiveXStatus (updating ? lpv_latest_versionx : lpv_thresh_versionx);
var text = "";
var show_download = false;
var show_download_stand_alone = false;
var show_failed_info = false;
if (status < 100) {
if (! document.LpvNoLpvControlCount)
document.LpvNoLpvControlCount = 0;
if (document.LpvNoLpvControlCount < 2) {
document.LpvNoLpvControlCount++;
return (0); 
}
text = "<H2 style='color:red'>"
if (language == "d")
text += "Lpv Player ActiveX konnte nicht gestartet werden.";
else
text += "The Lpv Player ActiveX Control could not be started.";
text += "</H2>";
if (language == "d")
text += "<p>Automatischer Download/Install fehlgeschlagen.</p>";
else
text += "<p>Automatic download/install failed.</p>";
show_download = true;
show_download_stand_alone = false;
show_failed_info = updating;
} else if ((status >= 100) && (status < 500)) {
document.LpvBlink = ! document.LpvBlink;
if (document.LpvBlink)
text += "<H2 style='color:red;'>";
else
text += "<H2>";
if (language == "d")
text += "Lpv Player ActiveX wird geladen, bitte warten...</H2>";
else
text += "Downloading Lpv Player ActiveX Control, please wait...</H2>";
show_download = true;
show_download_stand_alone = true;
show_failed_info = false;
} else if ((status >= 500) && (status < 1000)) {
document.LpvBlink = ! document.LpvBlink;
if (document.LpvBlink)
text += "<H2 style='color:red;'>";
else
text += "<H2>";
if (language == "d")
text += "Sie m&uuml;ssen die Lizenzbedingungen akzeptieren um Lpv Player zu nutzen:<br>"
+ "<a href=# onClick='LpvShowLicense()'>Lizenz zeigen</a>"
+ "</H2>";
else
text += "You need to accept the license in order to use Lpv Player:<br>"
+ "<a href=# onClick='LpvShowLicense()'>Show License</a>"
+ "</H2>";
show_download = false;
} else if ((status >= 1000) && (status < 2000)) {
if (! document.LpvNoScriptingCount)
document.LpvNoScriptingCount = 0;
if ( ! updating
&& (++document.LpvNoScriptingCount >= 10)) {
status = 5000;
} else {
document.LpvBlink = ! document.LpvBlink;
if (document.LpvBlink)
text += "<H2 style='color:red;'>";
else
text += "<H2>";
if (language == "d") {
text += "Lpv Player geladen, aber Scripting ist nicht erlaubt.</H2>"
+ "<p>Funktionen die Scripting ben&ouml;tigen funktionieren nicht."
+ "<br>Pr&uuml;fen Sie die Sicherheitseinstellung des Browsers und"
+ " schalten Sie Scripting ein, wenn Sie Lpv Player in vollem Umfang"
+ " nutzen m&ouml;chten.</p>";
} else {
text += "Lpv Player was loaded, but scripting is disabled.</H2>"
+ "<p>Functionality that requires scripting will not work."
+ "<br>Please check the security settings of your browser and enable"
+ " scripting in order to take full advantage of Lpv Player.</p>"
}
show_download = false;
}
} else if ((status >= 2000) && (status < 5000)) {
if (! document.LpvOutdatedCount)
document.LpvOutdatedCount = 0;
if ( ! updating
&& (++document.LpvOutdatedCount >= 10)) {
status = 5000;
} else {
document.LpvBlink = ! document.LpvBlink;
if (document.LpvBlink)
text += "<H2 style='color:red;'>";
else
text += "<H2>";
var version = "";
if (lpv.GetVersion)
version = " (" + lpv.GetVersion () + ")";
if (language == "d")
text += "Ihre Version von Lpv Player" + version + " ist veraltet!</H2>";
else
text += "Your version of Lpv Player" + version + " is outdated!</H2>";
if (updating) {
if (language == "d")
text += "<p>Automatisches Update fehlgeschlagen.</p>";
else
text += "<p>Automatic update failed.</p>";
show_download = true;
show_download_stand_alone = false;
show_failed_info = updating;
} else {
if (language == "d")
text += "<p>Bitte besuchen sie die Lpv Player Update Seite: "
+ "<nobr><a href=\"" + url_base + "/lpv/update_d.html\">"
+ url_base + "/lpv/update_d.html"
+ "</a></nobr></p>";
else
text += "<p>Please visit the Lpv update page: "
+ "<nobr><a href=\"" + url_base + "/lpv/update_e.html\">"
+ url_base + "/lpv/update_e.html"
+ "</a></nobr></p>";
show_download = false;
}
}
} else {
if (updating) {
if (language == "d")
text += "<H2>Lpv Player ActiveX erfolgreich geladen.";
else
text += "<H2>Lpv Player ActiveX successfully loaded.";
if (lpv.GetVersion)
text += " (Version " + lpv.GetVersion() + ")";
text += "</H2>";
show_download = true;
show_download_stand_alone = true;
}
}
if ( updating
|| (status < 5000)) {
if (show_download) {
if (show_failed_info) {
if (language == "d")
text += "<p>Beachten Sie, dass Administrator-Rechte notwending sind,"
+ " damit die automatische Installation funktioniert."
+ "<br>Falls angezeigt wurde, dass Lpv Player installiert wurde,"
+ " ist es eventuell ist es notwendig den Webbrowser neu zu starten"
+ " um die Installation abzuschlie&szlig;en. Schlie&szlig;en Sie"
+ " alle Fenster des Browsers (und Active Desktop)."
+ "<br>Falls das nicht hilft starten Sie Windows neu."
+ "<br>Wenn es dann immer noch nicht klappt bitte Lpv Player"
+ " von dem unten angegebenen Link laden und installieren."
+ "</p>";
else
text += "<p>Please verify that you are logged on with administrative"
+ " privileges to install/update Lpv Player ActiveX."
+ "<br>If installation has been indicated, but you still get"
+ " this message: it might be required to restart your web"
+ " browser in order to complete the installation. Close all"
+ " browser windows (and Active Desktop) and try again."
+ " If this doesn't help, restart Windows."
+ "<br>Finally - if still no success - download Lpv Player from the link given below."
+ "</p>";
}
if (show_download_stand_alone) {
if (language == "d")
text += "<p>Lpv Player Download: <a";
else
text += "<p>Download stand-alone Lpv Player here: <a";
} else {
if (language == "d")
text += "<p>Lpv Player Download: <a";
else
text += "<p>Download Lpv Player here: <a";
}
if (updating)
text += " target=_top";
else
text += " target=_blank";
if (language == "d")
text += " href=\"" + url_base + "/links/lpv_d.html\">"
+ url_base + "/links/lpv_d.html"
+ "</a></p>";
else
text += " href=\"" + url_base + "/links/lpv_e.html\">"
+ url_base + "/links/lpv_e.html"
+ "</a></p>";
}
err.style.fontSize = "";
err.style.lineHeight = "";
} else {
err.style.fontSize = "0px";
err.style.lineHeight = "0px";
}
err.innerHTML = text;
if (tab) {
if (typeof (document.SaveLpvTabWidth) == "undefined")
document.SaveLpvTabWidth = tab.style.width;
if (typeof (document.SaveLpvTabHeight) == "undefined")
document.SaveLpvTabHeight = tab.style.height;
if (status < 1000) {
if ( (tab.style.width != "80px")
|| (tab.style.height != "60px")) {
tab.style.width = "80px";
tab.style.height = "60px";
}
} else {
if ( (typeof (document.SaveLpvTabWidth) != "undefined")
&& (typeof (document.SaveLpvTabHeight) != "undefined")
&& ( (tab.style.width != document.SaveLpvTabWidth)
|| (tab.style.height != document.SaveLpvTabHeight))) {
tab.style.width = document.SaveLpvTabWidth;
tab.style.height = document.SaveLpvTabHeight;
}
}
}
return (status);
}
function LpvCheckActiveXStatus (language, updating)
{
if (! language)
language = "";
if (! updating)
updating = false;
var status = LpvCheckActiveXStatusSub (language, updating);
if ((status >= 0) && (status < 5000))
setTimeout ("LpvCheckActiveXStatus(\"" + language + "\", " + updating + ")", 1000);
}
function ConditionalLpvPlayerActiveXUpdate (text)
{
var lpv = document.getElementById("Lpv");
if ( ! lpv
)
return (false); 
if (text)
text += "\n\n";
else
text = "";
text += "Your version of Lpv Player might be outdated.\n"
+ "Do you want to visit the Lpv Player update page?";
if (! confirm (text))
return (false);
var url_base = "http://www.laseranimation.com";
if (window.location.host.toLowerCase().indexOf ("lasergraph-dsp") >= 0)
url_base = "http://www.lasergraph-dsp.de";
window.location = url_base + "/lpv/update_e.html"
return (true);
}
function LpvShowLicense ()
{
var lpv = document.getElementById ("Lpv");
if (lpv)
lpv.ShowLicense ();
}
function Reset()
{
var lpv = document.getElementById("Lpv");
lpv.Reset = 1;
}
function SetFog(force,intensity,minint,clouds)
{
var lpv = document.getElementById("Lpv");
if (force != 1)
lpv.ForceFog = force; 
lpv.FogMinIntensity = minint;
lpv.FogIntensity = intensity;
lpv.ForceFog = force;
if (lpv.Clouds && clouds)
lpv.Clouds = clouds;
}
function AddFog(add)
{
var lpv = document.getElementById("Lpv");
var force;
var intensity;
var minint;
force = lpv.ForceFog;
intensity = lpv.FogIntensity;
minint = lpv.FogMinIntensity;
force = 1;
if ( (intensity < 100)
|| ((add < 0) && (minint <= 0))) {
intensity += add;
if (intensity > 100)
intensity = 100;
else if (intensity <= 0)
intensity = 0;
} else {
minint += add;
if (minint > 100)
minint = 100;
else if (minint <= 0)
minint = 0;
}
SetFog(force,intensity,minint);
}
function SetLineWidth(width)
{
var lpv = document.getElementById("Lpv");
lpv.LineWidth = width;
}
function AddLineWidth(add)
{
var lpv = document.getElementById("Lpv");
lpv.LineWidth += add;
}
function SetBps(bps)
{
var lpv = document.getElementById("Lpv");
lpv.BitsPerSecond = bps;
}
function SetMuted(muted)
{
var lpv = document.getElementById("Lpv");
lpv.Muted = muted;
}
function GetPlaying()
{
var lpv = document.getElementById("Lpv");
return (lpv.Playing);
}
function SetPlaying(play)
{
var lpv = document.getElementById("Lpv");
lpv.Playing = play;
}
function TogglePlaying()
{
if (GetPlaying ())
SetPlaying (0);
else
SetPlaying (1);
}
function SetStop(stop)
{
var lpv = document.getElementById("Lpv");
lpv.Stop = stop;
}
function GetPositionF()
{
var lpv = document.getElementById("Lpv");
return (lpv.PositionF / 100.0);
}
function SetPositionF(pos)
{
var pos = parseInt(Math.floor (pos * 100 + 0.5));
var lpv = document.getElementById("Lpv");
lpv.PositionF = pos;
}
function GetLoaded()
{
var lpv = document.getElementById("Lpv");
return (lpv.Loaded / 100.0);
}
function LoadLpv(name)
{
var lpv = document.getElementById("Lpv");
lpv.Url = name;
}
function LoadLpvB(name)
{
Reset ();
LoadLpv (name);
}
function LoadLpvG(name)
{
Reset ();
SetFog (1, 20, 0, 70);
LoadLpv (name);
}
function Download(name)
{
window.location.href = name;
}
function SetFrame(frame)
{
var lpv = document.getElementById("Lpv");
lpv.Frame = frame;
}
function GetLpvFullScreen()
{
var lpv = document.getElementById("Lpv");
return (lpv.FullScreen);
}
function SetLpvFullScreen(full)
{
var lpv = document.getElementById("Lpv");
if (typeof (lpv.FullScreen) != "undefined") {
lpv.FullScreen = full;
return;
}
ConditionalLpvPlayerActiveXUpdate ("Enable Full Screen failed!");
}
function OpenLpvWindow (name, language, html_prefix, lpv_prefix, features)
{
var html = name;
var lpv = name;
if (language)
html = html + "_" + language;
html = html + ".html";
lpv = lpv + ".lpv";
if (html_prefix) html = html_prefix + html;
if (lpv_prefix) lpv = lpv_prefix + lpv;
if (! BrowserInfo.SupportsLpv()) {
window.location.href = lpv;
return (false);
}
if (! features) {
features = "";
features += "width=640,height=480";
features += ",left=16,top=16";
features += ",resizable=yes";
features += ",scrollbars=yes";
features += ",status=yes";
}
var popwin = window.open ("", "Lpv", features);
popwin.focus ();
popwin.location.href = html;
return false;
}
function OpenLpvWindowFiles (lpv, language, prefix, features)
{
var lpv_prefix = "files/";
if (prefix)
lpv_prefix = prefix + lpv_prefix;
return (OpenLpvWindow (lpv, language, prefix, lpv_prefix, features));
}
