var detect = navigator.userAgent.toLowerCase();
var windowsIE = (checkPlatform("msie") && checkPlatform("win"));
var launchTID;
function launchApp(urlapp) {
  if (windowsIE) {
   document.write("<OBJECT codebase=\"http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=6,0,0,0\" classid=\"clsid:5852F5ED-8BF4-11D4-A245-0080C6F74284\" height=0 width=0>");
   document.write("<PARAM NAME=app VALUE="+urlapp+">");
   document.write("<PARAM NAME=back VALUE=false>");
   document.write("</OBJECT>");
  } else {
   // Spin quietly, waiting to launch the app from the original window
   launchTID = setInterval('launchJNLP("'+urlapp+'")', 100);
  }
}

function launchJNLP(app) {
 clearInterval(launchTID);
 window.location = app;
}

function checkPlatform(string) {
 place = detect.indexOf(string) + 1;
 thestring = string;
 return place;
}

