//------------------Steraming Server --------------------------------------------------
//Set this var while using a Streaming Server. If the media server is the same
//as the http one, set this var to ''.
//StreamingMediaPath = 'mms://194.187.78.141/';
StreamingMediaPath = "rtsp://www.si-sv2565.com/qenglish/";
//StreamingMediaPath = "";

// two arrays for different media servers. The first one contains urls of the partners that need to
// get different servers, the second one - the server paths
var SpecialUrl = new Array();
SpecialUrl[0] = "elit.qgroup4u.com";
var SpecialStreamingMediaPath = new Array();
SpecialStreamingMediaPath[0] = "rtsp://79.171.23.237/qenglish/";

/******************************************************************************************
function PathForStreaming(CurrSoundPath)

    This function gets a path and change it to the streaming server path if needed and if
    this path contins "http://"
    
    streaming server is to be used ONLY on video, so other function does the change
    this one, however, returns input path with no changes
******************************************************************************************/
function GetInstallationPath(FullMediaPath,FindString,MediaSourceDial)
{

var MediaSourceDialInternet;

    try
	    {
	    // parent.parent.MediaSourceDialInternet gets from ScoLauncher and if the value 
	    // is  not "D"(Dial) return the FullMediaPath
	     if(MediaSourceDial !=null)
	        MediaSourceDialInternet=MediaSourceDial; 
	     else if(parent.parent.parent.MediaSourceDialInternet)  
	       MediaSourceDialInternet=parent.parent.parent.MediaSourceDialInternet; 
	    else if(top.opener.parent.parent.parent.MediaSourceDialInternet)
	            MediaSourceDialInternet=top.opener.parent.parent.parent.MediaSourceDialInternet; 
	  
	            
	    // if  we dont  find the MediaSourceDialInternet we return the FullMediaPath with out handle dial solution
	    else   
	       return(FullMediaPath);
	              
	   
	   if(MediaSourceDialInternet!="D")
	       return(FullMediaPath);
	    
		    
		    else return(FullMediaPath);
	    }
    catch(e)
	{	
	   return(FullMediaPath);
	}
}

function GetCDDrive(FullMediaPath)
{
    try
		{
		    var fso, d, s ="", lChar, i, fl;
		}
		catch(e)
		{	
			return
		}
		return(s);
        fso	= null;
}
function PathForStreaming(CurrSoundPath){

    var sPathType;
    if(CurrSoundPath.indexOf("SCOs")>0)
        sPathType= "SCOs";
    else if(CurrSoundPath.indexOf("Tools")>0)
        sPathType= "Tools"; 
    else return CurrSoundPath; 
    var localPath=GetInstallationPath(CurrSoundPath, sPathType);
    if(localPath.length>0)
        return localPath;
    else
        return CurrSoundPath;
}

function PathForVideoStreaming(CurrSoundPath){

    for (i=0;i<SpecialUrl.length;i++)
    {
        if (document.location.href.indexOf(SpecialUrl[i]) > -1)
            return GetMediaPath(CurrSoundPath, SpecialStreamingMediaPath[i]);
    }
    
    return GetMediaPath(CurrSoundPath, StreamingMediaPath);
}

function GetMediaPath(CurrSoundPath, StreamingPath)
{
    if (StreamingPath!=""){

    //if there is a Streaming Server

              if(CurrSoundPath.indexOf("http://")==0){

                      var templocation=CurrSoundPath.substring(7,CurrSoundPath.length);

                      templocation=templocation.substring(templocation.indexOf("/")+1,templocation.length);

                      CurrSoundPath=StreamingPath+templocation;

              }
    }

    return CurrSoundPath;
}
