            /*
            function getHost() {var url = window.location;var urlparts = url.split('/'); var host = urlparts[0]; alert(host); }
            getHost();
            */            
            var iTime=-1;
            var iStart=-2;                       
            var iTimeID;           
            function setLoading(divUpdate)
		    {		        
			    document.getElementById(divUpdate).innerHTML=("<br><br><br><center><strong><img src=\"images/loading.gif\"></strong></center>");				
		    }	
            function startService()
            {  
              
                if (document.getElementById("contentCtrl_PlayerCtrl1_divBufferTime").innerHTML!=""){                                                                
                    iTime++;                                                                    
                    var arr=document.getElementById("contentCtrl_PlayerCtrl1_divBufferTime").innerHTML.split(";");                    
                    if (arr.length>0)
                    {
                        var timeStart=arr[0].split("-")[0];// can lay
	                    var totalTime=arr[0].split("-")[1];// can lay
	                    var fileVideo=arr[0].split("-")[3];// can lay	            
    	                    	            
		                iTimeID=setTimeout('serviceTime()',totalTime);
		            }
		        } 		        
		    }	    
		    function startWaitService()
            {                                                                            
                if (document.getElementById("contentCtrl_PlayerCtrl1_divBufferTime").innerHTML!=""){                                                                
                
                    iTime++; 
                    var arr=document.getElementById("contentCtrl_PlayerCtrl1_divBufferTime").innerHTML.split(";");                    
                    var timeStart=arr[0].split("-")[0];// can lay
	                var totalTime=arr[0].split("-")[1];// can lay
	                var fileVideo=arr[0].split("-")[3];// can lay	
	                var fileTitle=arr[0].split("-")[2];// can lay
	                var fileIsSplit=arr[0].split("-")[4];// can lay            	                    	            
                    
		            
		            iTimeID=setTimeout('serviceTime()',totalTime); 		    
		            //alert(totalTime);
		        } 		       
		        //iTime++; 
		    }	            
            function serviceTime()
            {  	        
                iTime++;                
                var arr= new Array();
                arr=document.getElementById("contentCtrl_PlayerCtrl1_divBufferTime").innerHTML.split(";");                    
                
                if (arr.length==0) return ;
                if(!arr[iTime]) return;
                
                if(arr==undefined) return;
                
                var timeStart=arr[iTime].split("-")[0];// can lay
	            var totalTime=arr[iTime].split("-")[1];// can lay
	            var fileVideo=arr[iTime].split("-")[3];// can lay
	            var fileTitle=arr[iTime].split("-")[2];// can lay
	            var fileIsSplit=arr[iTime].split("-")[4];// can lay
	            var fileTimes=arr[iTime].split("-")[5];// can lay
	            var fileUrlRoots=arr[iTime].split("-")[6];// can lay
	            	
                //alert(iTime+"-"+fileVideo+"-"+fileIsSplit);
                if (iTime <= (arr.length-1)){	
                    
                    //fileVideo='http://'+window.location.host+'/upload/Video/VideoOnline/'+fileVideo;   
                    fileVideo=fileVideo;                         
                    fileVideo=rep(fileVideo," ~ ","~");
                    
                    //fileVideo=repute(fileVideo);
                    //fileUrlRoots=repute(fileUrlRoots);
                    if(false)// (fileIsSplit=="true")
                    {
                        //width, height, Url,urlTimeFile,urlFile,pos                        
                        //setPlayer(getPlayerCodeMulti(500,300,fileVideo,fileTimes,fileUrlRoots,0),fileTitle,iTime,timeStart,totalTime,fileIsSplit);// can lay
                        setPlayer(getPlayerCodeByPosition(500,300,fileVideo,fileTimes,fileUrlRoots,0),fileTitle,iTime,timeStart,totalTime,fileIsSplit);// can lay
                    }
                    else setPlayer(getPlayerCodeByPosition(500,300,fileVideo,fileTimes,fileUrlRoots,0),fileTitle,iTime,timeStart,totalTime,fileIsSplit);// can lay
                    
                    iTimeID=setTimeout('serviceTime()',totalTime);                     
                    
                }			   		                		        
		        else clearTimeout(iTimeID);		        
		    }		
		    function setPlayer(val,fileTitle,iTime,timeStart,totalTime,fileIsSplit)
		    {   
		       var timeStart1=timeStart.split(" ")[1]+" "+timeStart.split(" ")[2];		        
		       document.getElementById("contentCtrl_PlayerCtrl1_divTitle").innerHTML="<b>"+timeStart1+" : "+fileTitle+"</b>";
		       if (iTime >=1)
		        {   
		            /*
		            //set style before move content
		            document.getElementById("divPlayerTD1_"+(iTime)).style.padding="1px";
		            document.getElementById("divPlayerTD1_"+(iTime)).style.width='30%';
		            document.getElementById("imgPlayerH_"+(iTime)).style.width='80px';
		            document.getElementById("imgPlayerH_"+(iTime)).style.height='80px';
		            
		            document.getElementById("divPlayerTD2Infor_"+(iTime)).style.padding="2px";
		            document.getElementById("divPlayerTD2_"+(iTime)).style.padding="1px";
		            
		            //start move content to played programs div
		            document.getElementById("divPlayedProgram").innerHTML = document.getElementById("divPlayedProgram").innerHTML + document.getElementById("divPlayer"+(iTime)).innerHTML;
		            */
		            document.getElementById("divPlayer"+(iTime)).innerHTML="";
		        }		        		        
		        document.getElementById("frmPlayer").innerHTML=(val);		        
		        //document.getElementById("contentCtrl_PlayerCtrl1_divMain").style.display="block";		        
		    }		    
		    function getPlayerCodeMulti(width, height, Url,urlTimeFile,urlFile,urlSizeFile)
		     {              
			      Url=rep(Url," ~ ","~");
			      urlTimeFile=repute(urlTimeFile);
                  urlFile=repute(urlFile);			  			  
                  urlSizeFile=repute(urlSizeFile);					                
			      var playerCode = "";	
		             playerCode= '<object  id="objPlayer"  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                     +' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" '
                     +' width="'+width+'"'
                     +' height="'+height+'"'
                     +' bgcolor="transparent"> '
                     +'<param name="movie" '
                     +' value="/Control/Viewer/playerCutFileOffline.swf?file='+Url+'&urlTimeFile='+urlTimeFile+'&urlSizeFile='+urlSizeFile+'&urlFile='+urlFile+'&bufferTime=5&autoStart=true" />'
                     +' <param name="quality" '
                     +'   value="high" />'
                     +' <embed name="embed" src="/Control/Viewer/playerCutFileOffline.swf?file='+Url+'&urlTimeFile='+urlTimeFile+'&urlSizeFile='+urlSizeFile+'&urlFile='+urlFile+'&bufferTime=5&autoStart=true'  
                     +'  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"'
                     +' type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" bgcolor="#transparent" allowFullScreen="true" /> '   
                     +'</object>';                
                    return playerCode;
		}		
		/*	Function: getPlayerCode 
		   	Parameters: width, height, url
			Description: Generates the html code to display the Windows media video player
		*/
		function getPlayerCodeByPosition(width, height, Url,urlTimeFile,urlFile,pos)
		{            
             width="100%";
             height="100%";
             Url=rep(Url," ~ ","~");
             //Url=repute(Url);
             //alert(urlTimeFile);
             //urlTimeFile=repute(urlTimeFile);
             //alert(urlFile);
             //urlFile=repute(urlFile);			  
			 var playerCode = "";	
		         playerCode= '<object  id="objPlayer"  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                 +' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" '
                 +' width="'+width+'"'
                 +' height="'+height+'"'
                 +' bgcolor="transparent"> '
                 +'<param name="movie" '                 
                 +'  value="/Control/Viewer/playerCutFileOnline.swf?file='+Url+'&urlTimeFile='+urlTimeFile+'&urlFile='+urlFile+'&bufferTime=5&autoStart=true&startTime='+pos+'" />'
                 +' <param name="quality" '
                 +'   value="high" />'                 
                 +' <embed src="/Control/Viewer/playerCutFileOnline.swf?file='+Url+'&urlTimeFile='+urlTimeFile+'&urlFile='+urlFile+'&bufferTime=5&autoStart=true&startTime='+pos +'"'
                 +'  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"'
                 +' type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" bgcolor="transparent" allowFullScreen="true" /> '   
                 +'</object>';
              //alert(playerCode);   
              return playerCode;
		}   
	    function rep(inputString,str1,str2) 
        {
            while (inputString.indexOf(str1)!=-1) return rep(inputString.replace(str1,str2),str1,str2); 
            return inputString;
        }		    
        function openWindow(url,title,w,h,X,Y)
        {
            //mywindow=window.open(url,title,'width='+w+',height='+h+',status=no,resizable=0,address=1');
            mywindow=window.open(url,title,'width='+w+',height='+h);
            if (X != "") mywindow.moveTo(X,Y);
        }