/*

Version Detection v3.0

Language: JavaScript 1.0

studiocai.com

*/



isIE = isNS = isNS4 = isNS6 = isNS7 = isNS8 = isFlash5 = isFlashMX = false;



// Browser Detection

if(navigator.appName.indexOf('Netscape') == 0) isNS = true;

if(navigator.appName.indexOf('Microsoft') == 0) isIE = true;

isUNIX = (window.navigator.appVersion.indexOf("X11") != -1) ||

         (window.navigator.appVersion.indexOf("Linux") != -1) ||

         (window.navigator.appVersion.indexOf("SunOS") != -1) ||

         (window.navigator.appVersion.indexOf("IRIX") != -1) ||

         (window.navigator.appVersion.indexOf("HP-UX") != -1);

isMac = (window.navigator.appVersion.indexOf("Mac") != -1);

isWindows = navigator.userAgent.indexOf("Windows 95") != -1 ||

            navigator.userAgent.indexOf("Windows 98") != -1 ||

            navigator.userAgent.indexOf("Windows NT") != -1;

isMacIE = (isMac && isIE);



// Netscape Version

if(isNS) {

  v = parseInt(navigator.appVersion);

  if(v == 4) {

    isNS4 = true;

  } else if(v == 5) {

    p = navigator.userAgent.lastIndexOf('/');

    v = parseInt(navigator.userAgent.substr(p+1));

    eval("isNS" + v + " = true");

  }

}



// Flash Version

if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]  && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {

  if (navigator.plugins && navigator.plugins["Shockwave Flash"] && (versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".")) != - 1) {

    var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-1, versionIndex);

    versionIndex = parseInt( versionString );

    if ( versionIndex >= 5 ) {

      isFlash5 = true;

    }

    if ( versionIndex >= 6 ) {

      isFlashMX = true;

    }

  }

} else if (isIE && isWindows) {

  document.write('<script language="VBScript">\n');

  document.write('on error resume next\n');

  document.write('isFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');

  document.write('isFlashMX = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');

  document.write('</script>\n');

}


var isNS4 = false;
if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) <= 4) {
	isNS4 = true;
}

isNS6 = false;
if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
  isNS6 = true;
}

isMacIE = false;
if ((navigator.appVersion.indexOf("Mac") != -1) && (navigator.userAgent.indexOf("MSIE") != -1)) {
  isMacIE = true;
}
