﻿
    function IMItNow( id){
    
        var url;
    
        if( id == 99995232){ 

            url = 'http://ent.msn.com.tw/im/trailer_watch.aspx';
            
            if( location.search.length != 0) url += location.search;

            document.cookie = 'MovieIM=' + escape( url) + ';expires=' + TimeOut() + ';domain=msn.com.tw;path=/';
            
            LaunchItNow( 99995233);
        
        }

        else if( id == 99995233){

            url = 'http://ent.msn.com.tw/im/movie_playtime.aspx';
            
            if( location.search.length != 0) url += location.search;

            document.cookie = 'MovieIM=' + escape( url) + ';expires=' + TimeOut() + ';domain=msn.com.tw;path=/';
            
            LaunchItNow( 99995233);
        
        }

        else if( id == 10281488){
            
            LaunchItNow( 10281488);
            
        }

        else if( id == 10281489){
            
            LaunchItNow( 10281489);
            
        }

        else if( id == 99995419){

            url = location.href;

            document.cookie = 'TVIM=' + escape( url) + ';expires=' + TimeOut() + ';domain=msn.com.tw;path=/';
            
            LaunchItNow( 99995419);
            
        }

        else if( id == 10281491){
            
            LaunchItNow( 10281491);
            
        }
    
        else{
        
            alert( 'IMItNow Failure.');
        
        }
    
    }
    
    function IMTVTimeNow(){
        
        LaunchItNow( 10281490);
        
    }
    
    function TimeOut(){
    
        var now;
    
        now = new Date();
        
        now.setTime( now.getTime() + 1000 * 60 * 30);
    
        return now.toGMTString();
    
    }
