var requiredVersion = 7; var useRedirect = false;var flash2Installed = false;var flash3Installed = false;var flash4Installed = false;var flash5Installed = false;var flash6Installed = false;var flash7Installed = false;var flash8Installed = false;var flash9Installed = false;var maxVersion = 9;var actualVersion = 0;var hasRightVersion = false;var jsVersion = 1.0;var isAOL = (navigator.appVersion.indexOf("AOL") != -1) ? true : false;var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;jsVersion = 1.1;if(isIE && isWin){  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');  document.write('on error resume next \n');  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');    document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');    document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');  document.write('<\/SCR' + 'IPT\> \n');}var hasFlash;function detectFlash() {  if (navigator.plugins) {   if (navigator.plugins["Shockwave Flash 2.0"]        || navigator.plugins["Shockwave Flash"]) {	 var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;	  var flashVersion = parseInt(flashDescription.substring(16));	  flash2Installed = (flashVersion == 2 ? true : false);          flash3Installed = (flashVersion == 3 ? true : false);      flash4Installed = (flashVersion == 4 ? true : false);      flash5Installed = (flashVersion == 5 ? true : false);      flash6Installed = (flashVersion == 6 ? true : false);      flash7Installed = (flashVersion == 7 ? true : false);      flash8Installed = (flashVersion == 8 ? true : false);      flash9Installed = (flashVersion >= 9 ? true : false);    }  }  for (var i = 2; i <= 9; i++) {      if (eval("flash" + i + "Installed") == true){ actualVersion = i;}  }  if (requiredVersion <= actualVersion) {  	hasFlash=1;  }   else {    	hasFlash=0;  }}detectFlash();

if (!hasFlash) {document.location = "needflash.html";}

isIeWin = (navigator.userAgent.indexOf("IE") > -1 && navigator.userAgent.indexOf("Win") > -1) ? true : false;
isIeMac = (navigator.userAgent.indexOf("IE") > -1 && navigator.userAgent.indexOf("Mac") > -1) ? true : false;

function popFullWin(url)  {
    newWin = window.open(url,"newWin","scrollbars=no,menubar=no,resizable=no,status=no,titlebar=no");
    //newWin = window.open(url,"newWin","scrollbars=no,menubar=no,resizable=no,status=no,titlebar=no,fullscreen=yes,channelmode=yes");
  //if (!isIeWin)  {
    window.newWin.moveTo(0,0);
    window.newWin.resizeTo(screen.availWidth,screen.availHeight);
  //}
}

var days = 500;
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();

if (document.cookie.indexOf("clientId") < 0) {
    var clientId = new String();
    for (var i=0; i<=20; i++) {
        var code = Math.floor(Math.random()*36);
        clientId += (code > 9) ? String.fromCharCode((code-10)+65) : code;
    }
    document.cookie = "clientId="+clientId+";path=/;"+expires;
}

function getParams() {
    var params = new Object();
    if (document.location.search) {
        var qString = document.location.search.substring(document.location.search.indexOf("?")+1, document.location.search.length);
        var a = qString.split("&");
        for (var i in a) {
            var b = a[i].split("=");
            params[b[0]] = b[1];
        }
    }
    return params;
}

var searchParams = new Object(getParams());

function getCookieParams() {
    var params = new Object();
    if (document.cookie) {
        var qString = document.cookie;
        var a = qString.split("; ");
        for (var i in a) {
            var b = a[i].split("=");
            params[b[0]] = b[1];
        }
    }
    return params
}

var cookieParams = new Object(getCookieParams());

function setLang(swfLang,swfCharType,swfRegion) {
    var getString = "";
    document.cookie = "lang="+swfLang+";path=/;"+expires;
    document.cookie = "charType="+swfCharType+";path=/;"+expires;
    document.cookie = "region="+swfRegion+";path=/;"+expires;
    if (!document.cookie) {
        getString = "?lang="+swfLang+"&region="+swfRegion+"&charType="+swfCharType;
    }
    popFullWin("home.html"+getString);
    //document.location = "home.html"+getString;
}

function validateCharType(str) {
    if (str == "latin" || str == "korean" || str == "japanese" || str == "chinese") {
        return str;
    } else {document.location = "index.html";}
}

function validateLang(str) {
    if (str == "null" || str == "en-us" || str == "en-ca" || str == "fr-ca" || str == "en-gb" || str == "en-ie" || str == "fr-fr" || str == "fr-be" || str == "nl-be" || str == "da-dk" || str == "de-de" || str == "es-es" || str == "it-it" || str == "nl-nl" || str == "nb-no" || str == "de-at" || str == "pt-pt" || str == "de-ch" || str == "fi-fi" || str == "sv-se" || str == "ja-jp" || str == "ko-kr" || str == "zh-hk" || str == "zh-tw" || str == "zh-sg" || str == "en-au" || str == "en-nz" || str == "es-co" || str == "es-mx") {
        return str;
    } else {document.location = "index.html";}
}

