/*
 Detect Browser & OS for Opera/firefox/Chrome/Safari/IE /Android Browser

 ------------------------------------------------------------------------------
 Copyright (c) 2012 A Man Walking Company ( unregested) email: kwangkia@gmail.com
  Sole-proprietorship : Toh Jiunn Kwang
 Info/Docs http://www.luck99.info
 If you are copying or using my script please donate to my website 1 USD only.

  Purchased License  : Ban Leong Bros Pte LTD
 Purchaser                 : Toh Jiunn Kwang
 ------------------------------------------------------------------------------
*/

var isfirefox=false;
var isOpera=false;
var isChrome=false;
var isSafari=false;
var systemok=true;
var stringit= new String();
var isMac=false;
var isWin=false;
var isOther=false;

	stringit= navigator.userAgent;

	if (stringit.indexOf("Opera") != -1)
	{
	 systemok=false;
	 isOpera=true;	
	}
	if (stringit.indexOf("Firefox") != -1)
	{
		 systemok=false;
  		  isfirefox=true;
		 //window.location="op.htm"; // due to product[array] firefox do not have variable thus errors
	}
	if (stringit.indexOf("Safari") != -1) 
	{	
		systemok=false;
		isSafari=true;
	}
	if ((stringit.indexOf("Chrome") != -1) && (stringit.indexOf("Safari") != -1))
	{ 
		systemok=false; 
		isChrome=true;
	}
	if (stringit.indexOf("MSIE") != -1)
	{
	 systemok=true;
	}
	
	
//due to smartphone varies,  now need to detect handphone platform
	
	
		// is the operating system Windows?
	if(navigator.appVersion.indexOf("Win") != -1) 
		{
		isWin=true;
		}
			// Or is it Macintosh?
	else if(navigator.appVersion.indexOf("Mac") != -1) 
		{
		isMac=true;
		}
		// Or is it something else?
	else {
		isOther=true;
		}



//In the function above, with the first conditional statement we check if the navigator object contains the string "Win." If it does, that will indicate the platform is Windows. If, however, the navigator object contains the string "Mac," the platform is Macintosh. If the navigator object does not contain the string "Win", or "Mac", the platform must be something else (i.e., UNIX, Linux, etc.).
//Step 2: Call the above function (DetectPlatform()) from your web page:
// calling the function


// becuase of audio  now have to put detect Quick TIme for embeded and windows auto will have media play so 
	var qotQuickTime = false;

	if (navigator.plugins && navigator.plugins.length) 
	{
			for (var i=0; i < navigator.plugins.length; i++ ) 
			{
	         var plugin = navigator.plugins[i];
	         if (plugin.name.indexOf("QuickTime") > -1) 
	         {
			 qotQuickTime =true;				
	         }
	         else
	         {}
		}
	} 

