// Ver 1.0.0 25/07/2008
//////////////////////////////////////////////////////////////
//
//	Copyright 2008 VTTV
//	Free for public non-commercial use and modification
//	as long as this header is kept intact and unmodified.
//	Please see http://vttv.com.my for more information
//	or email with questions/suggestions.
//
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
//////////	 VTTV DIB Player 	 //////////////////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////

		var noinstallerr=0;

    function OnPlay(channelUrl, channelName)
		{
    var noinstallerr=0;
		var pVersion;
    try
    {
    pVersion = document.getElementById('SopPlayer').GetVersion(); 
		document.getElementById('SopPlayer').SetSopAddress(channelUrl);
		document.getElementById('SopPlayer').SetChannelName(channelName);
		document.getElementById('SopPlayer').Play();
	  return true;
    }
    catch (e)
    {
	  if (noinstallerr==0) {
	   var cfm = confirm("You haven't installed VTTV DIB Player, please download and install the player first."); 
		if (cfm == true) { 
		location='http://www.vttv.tv/download/VTTV3.0.1_setup.exe'; 
		}		
    }
	  noinstallerr=1;
        return false;
    }		
		}
		
		function OnPause()
		{
		
			document.getElementById('SopPlayer').Pause();
		}
		
		function OnRestart()
		{
		
			document.getElementById('SopPlayer').RestartPlayer();
		}
						
		function OnStop()
		{
			
			document.getElementById('SopPlayer').Stop();
			
		}




function detectPlugin()
{
    var pVersion;
    try
    {
        pVersion = document.getElementById('SopPlayer').GetVersion();  
	return true;
    }
    catch (e)
    {
	if (noinstallerr==0) {
	var cfm = confirm("You haven't installed VTTV DIB Player, please download and install the player first."); 
		if (cfm == true) { 
		location='http://www.vttv.tv/download/VTTV3.0.1_setup.exe'; 
		}
        }
	noinstallerr=1;
        return false;
    }
}


function detectVersion()
{
  var pVersion;
	try
    {
	
  pVersion = document.getElementById('SopPlayer').GetVersion(); 
	
	 if(pVersion<'3.0.1')
       {
              alert("Recommend you uninstall VTTV DIB player older version and install the latest VTTV DIB Player version 3.0.1! \nPlease download from http://www.vttv.com.my");
		
	}
	return true;
		}
		catch(e)
		{
		if (noinstallerr==0) {
		var cfm = confirm("You haven't installed VTTV DIB Player, please download and install the player first."); 
		if (cfm == true) { 
		location='http://www.vttv.tv/download/VTTV3.0.1_setup.exe'; 
		}
        }
	noinstallerr=1;
        return false;
	}	
}



