
function LoadContent(name,callback) {

    $f().loadPlugin(name,   
           'http://www.cinecomcast.com/flw/flowplayer.content-3.1.0.swf',
           {
               //stylesheet: 'http://kiwi.cinema.ch/scripts/css/trailers.css',
               borderRadius:4,
               borderColor:'#dddddd',
               //closeButton:true,
               onMouseOver: function() { this.hide() },
               onClick: function() {  this.hide(); },
               
               backgroundColor: '#7d35a1',
               backgroundGradient: [0.5,0.1,0], 
               height:'0',width:'0',
               top:10,opacity:'1',display:'none',
               //html:'xx',
               //zIndex:1,
               style: {'p': { color:'#FFFFFF', textAlign: 'center', fontFamily:'Arial', fontSize:'16px', fontStyle:'italic', letterSpacing:'1px' } }
           },
           callback   
    );
    
    //var plugin = $f().getPlugin(name); 
    //plugin.onClick = function() { alert(4); this.backgroundColor="#FF0000" }

};
                            
flowplayer("player", {src: "http://www.cinecomcast.com/flw/flowplayer.commercial-3.1.2.swf", bgcolor:"#04216B", wmode: 'opaque'},{
		   key: '@5cec56855449d841e10', 
           
           // common clip
		   clip:{
					scaling:'scale',
                    fadeInSpeed:6000,
                    autoPlay: false,
                    playlist: [
                        {url: 'http://www.cinecomcast.com/c_cinecomcast/jingle.flv', scaling: 'scale', autoBuffering: true, autoPlay: false, position:0,  onFinish:null}
                    ]
		   },
		    
		   onLoad: function(){ 
                    $f().getPlugin("hello").fadeTo(0.5, 1000);  
                    
                    $f().loadPlugin("MyContent",
                       'http://www.cinecomcast.com/flw/flowplayer.content-3.1.0.swf',
                       {
                           //stylesheet: 'http://kiwi.cinema.ch/scripts/css/trailers.css',
                           //borderRadius:4,
                           //borderColor:'#dddddd',
                           backgroundColor: 'transparent',
                           backgroundGradient: [0,0.4], 
                           height:'0',width:'0',
                           top:10,opacity:'0.8',display:'none',
                           html:'',
                           zIndex:1,
                           style: {'p': { color:'#ffffff', textAlign: 'center', fontFamily:'Arial', fontSize:'16px', fontStyle:'italic', letterSpacing:'1px' } }
                       }    
                    );
                   
    	   },   
		   
    	//when playback is finished we are performing unload. 
   		
        onFinish: function(clip) {
        
            if(this.getClip().isInStream==false)
            {
                window.setTimeout(function() {
		            var uri = 'http://anetch.tradedoubler.com/anet?type(iframe)loc(9233)' + new String (Math.random()).substring (2, 11);
                    document.getElementById('myOverlay').clonePosition($('player'), {setHeight:false});
                    document.getElementById('myOverlay').innerHTML = '<div id="internaloverlay"><img src="http://www.cinecomcast.com/flw/uperlogo.png" alt="" onclick="hideads()" /><iframe src="'+uri +'" width="300px" height="100%" frameborder="0" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></div>';
                    document.getElementById('myOverlay').style.visibility = 'visible';
					//document.getElementById('myOverlay').style.height = '80%';
                    //registerads(); 
                    
                    $f().getPlugin("MyContent").setHtml("");
            
                }, 500);
                
                
            }
            
        },
			
		canvas: {backgroundColor: "#000000",backgroundGradient:"none"},

		plugins: {
   			controls: {
                height:27,
                playlist:false, 
				bufferColor: '#00357d',
				progressColor: '#7d35a1',
				backgroundColor: '#c6d3e3',
				buttonOverColor: '#7d35a1',
				buttonColor: '#00357d',
				timeBgColor: '#FFFFFF',
				timeColor: '#7d35a1',
				durationColor: '#00357d',
                tooltipColor: '#7d35a1'
			   },
            
			   hello: { url: 'http://www.cinecomcast.com/c_cinecomcast/logo.swf',top: '10%',right:0,zIndex:2 }

               /*, MyContent: { 
                    url:'flowplayer.content-3.1.0.swf',
                   //stylesheet: 'http://kiwi.cinema.ch/scripts/css/trailers.css',
                   //borderRadius:4,
                   //borderColor:'#dddddd',
                   //onMouseOver: function() { this.setHtml("TEST") },
                   //onClick: function() {  this.hide(); },
                   closeButton:true,
                   html: 'TEST MY CONTENT',
                   /*backgroundColor: 'transparent',
                   backgroundGradient: [0,0.4], 
                   height:'0',width:'0',
                   top:10,opacity:'0.8',
                   zIndex:1,
                   style: {'p': { color:'#ffffff', textAlign: 'center', fontFamily:'Arial', fontSize:'16px', fontStyle:'italic', letterSpacing:'1px' } }  
                   
                   },*/
               
                    /*
                        '#trailer-menu a': { float:'left', display:'block', width:'150px', margin:'0 1px 5px 1px', border:'1px solid #ff0000', textAlign:'center', textDecoration:'none', color:'#fff' },
                        '#trailer-menu a, #trailer-menu a img': { color:'#fff', borderColor:'#fff' },
                        '#trailer-menu a span.infos': { background:'#0080FF' },
                        '#trailer-menu a:hover, #trailer-menu div:hover a, #trailer-menu a:hover img, #trailer-menu a.hover, #trailer-menu div.hover a, #trailer-menu a.hover img': { color:'#fff', borderColor:'#8000FF' },
                        '#trailer-menu a:hover span.infos, #trailer-menu a.hover span.infos': { backgroundColor:'#8000FF'},

                        '#trailer-menu img': { margin:'0 auto', border:0, borderBottom:'1px solid #fff', height:'100px', width:'148px', float:'none' },
                        '#trailer-menu h3': { clear:'none', fontSize:'12px', whiteSpace:'nowrap', display:'inline' },
                        '#trailer-menu span.length': { marginLeft:'3px', fontWeight:'normal' },
                        '#trailer-menu span.infos': { padding:'0 2px', fontSize:'10px', height:'16px', overflow:'hidden', clear:'left', display:'block'  }
                   */

			}		
});
  
function hideads(){ document.getElementById('myOverlay').style.visibility='hidden'; Effect.Appear("trailer-menu", {duration: 1.0}); }
  
function registerads(){
	var ajaxRequest2;  // The variable that makes Ajax possible!
	try{
	// Opera 8.0+, Firefox, Safari
	ajaxRequest2 = new XMLHttpRequest();
	}catch (e){
	// Internet Explorer Browsers
	try{
	ajaxRequest2 = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	try{
	ajaxRequest2 = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e){
	// Something went wrong
	alert("Your browser broke!");
	return false;
	}
	}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest2.onreadystatechange = function(){
		if(ajaxRequest2.readyState == 4){
	
		}
	}
	var vidID = document.getElementById('player').name;
	ajaxRequest2.open("GET", "http://www.cinecomcast.com/registerads.php?vidID="+vidID+"&media=2", true);
	ajaxRequest2.send(null); 	
}