AC_FL_RunContent = 0;
document.write("<script src=\"/mmtv/js/AC_RunActiveContent.js\" language=\"javascript\"></script>");
//alert(AC_FL_RunContent );
function play(args){
	//alert( args );
	if(document.frmPlay){
		document.frmPlay.filename.value =args ;
		document.frmPlay.submit();
	}
}
/*
New Function
*/
function setImgVideoXML(imageName , videoFile, preposXml, overlayXml){
	if(window.document.manoramaplayer ) {
		//alert( imageName +","+ args );
		if( imageName != null && imageName.length > 0 ) window.document.manoramaplayer.SetVariable("imageFile", imageName );
		else window.document.manoramaplayer.SetVariable("imageFile", "" );
		setVideoXML( videoFile, preposXml, overlayXml );
	}
}
function setVideoXML(  videoFile, preposXml, overlayXml  ){
  if(window.document.manoramaplayer ) {
	  //alert( "setVideo="+ args );
	//  window.document.manoramaplayer.SetVariable("imageFile", "" );
	//window.document.manoramaplayer.SetVariable("imageFile", "http://192.168.1.55/advt/Specials/MMTV_Election09/Vottuvandi/images/vottuvandi320x240.jpg" );
     if( videoFile!= null && (trim(videoFile)).length ) videoFile = trim(videoFile);  else videoFile="";
	 if( preposXml!= null && (trim(preposXml)).length )   preposXml = trim(preposXml);   else preposXml="";
	 if( overlayXml!= null && (trim(overlayXml)).length )   overlayXml = trim(overlayXml);  else overlayXml="";
	 window.document.manoramaplayer.SetVariable("newFileName", videoFile);
	 window.document.manoramaplayer.SetVariable("prePostAdFile", preposXml);
	 window.document.manoramaplayer.SetVariable("overlayAdFile", overlayXml);
	 //alert("videoFile: "+videoFile);
	 //alert("preposXml: "+preposXml);
	 //alert("overlayXml: "+overlayXml);
  }
}
////function currentPlayXML( videoFile, preposXml, overlayXml ){
function currentPlayXML(imageName , videoFile, preposXml, overlayXml ){
	//alert( window.document.manoramaplayer + " will play "+args );
	try {
		var adObj = window.document.getElementById("ADDIV");
		if (adObj) {
			adObj.style.display = "none";
			window.document.getElementById("VIDEODIV").style.display="block";
		}
	}catch(error) {}

	if(window.document.manoramaplayer ) {
		stopPlay();
		//window.document.manoramaplayer.SetVariable("newFileName", "");
		//window.document.manoramaplayer.SetVariable("prePostAdFile", "");
		//window.document.manoramaplayer.SetVariable("overlayAdFile", "");
		setImgVideoXML(imageName , videoFile, preposXml, overlayXml );
		////setVideoXML( videoFile, preposXml, overlayXml );
		//window.document.manoramaplayer.SetVariable("newFileName", args);
		window.setTimeout('startPlay()',3000);
	}
}
function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}
function trim( value ) {
	return LTrim(RTrim(value));
}

/*
New Function
*/
function setImgVideo(imageName , args){
	 window.setTimeout( "setImgVideoTimer('"+imageName+"','"+args+"')",3000);
}

function setImgVideoTimer(imageName , args){
	if(window.document.manoramaplayer ) {
//		alert( imageName +","+ args );
		if( imageName != null && imageName.length > 0 ) window.document.manoramaplayer.SetVariable("imageFile", imageName );
		setVideo( args );
	}
}

function setVideo( args ){
  if(window.document.manoramaplayer ) {
	 //alert( "setVideo="+ args );
	  if( args != null && args.length > 0 ) {
		window.document.manoramaplayer.SetVariable("newFileName", args);
//		window.document.manoramaplayer.SetVariable("prePostAdFile", "");
//		window.document.manoramaplayer.SetVariable("overlayAdFile", "");
		//window.setTimeout('startPlay()',3000);
	  }
  }
}

function currentPlay(args){
	//alert( window.document.manoramaplayer + " will play "+args );
	try {
		var adObj = window.document.getElementById("ADDIV");
		if (adObj) {
			adObj.style.display = "none";
			window.document.getElementById("VIDEODIV").style.display="block";
		}
	}catch(error) {}
	if(window.document.manoramaplayer ) {
		stopPlay();
		clearAll();
		setVideo( args );
		//window.document.manoramaplayer.SetVariable("newFileName", args);
		startPlay();
	}
}

function startPlay(){
	if(window.document.manoramaplayer )	{
		//window.document.manoramaplayer.SetVariable("imageFile", "" );
		window.document.manoramaplayer.SetVariable("playerStatus", "play");
	}
}
function stopPlay(){
	if(window.document.manoramaplayer ) window.document.manoramaplayer.SetVariable("playerStatus", "stop");
}

function clearAll(){
	if(window.document.manoramaplayer )	{
		window.document.manoramaplayer.SetVariable("imageFile", "" );
		window.document.manoramaplayer.SetVariable("newFileName", "");
		window.document.manoramaplayer.SetVariable("prePostAdFile", "");
		window.document.manoramaplayer.SetVariable("overlayAdFile", "");
	}
}
function placePlayer( args ){
//	alert(AC_FL_RunContent);
if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width','320','height','276','id','manoramaplayer','align','middle','src','/mmtv/manoramaplayer','quality','high','bgcolor','#000000','name','manoramaplayer','allowscriptaccess','always','allowfullscreen','true','pluginspage','http://www.macromedia.com/go/getflashplayer','swliveconnect','true','movie','/mmtv/manoramaplayer' ); //end AC code
		if( args != null && args.length > 0 ) { currentPlay( args); }
	}
}


/* Vdopia  6Sep09*/
function placePlayerV( args ){
//	alert(AC_FL_RunContent);
if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		 AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width','320','height','276','id','manoramaplayerv','align','middle','src','/mmtv/vdopia/manoramaplayer','quality','high','bgcolor','#000000','name','manoramaplayerv','allowscriptaccess','always','allowfullscreen','true','pluginspage','http://www.macromedia.com/go/getflashplayer','swliveconnect','true','movie','/mmtv/vdopia/manoramaplayer' ); //end AC code
		//if( args != null && args.length > 0 ) { currentPlay( args); }
	}
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}
var autoPlay = true ;
function initPlayer(filename,image,api,test,category,formats,title,midDuration,midNo, playAuto) {
	
	//alert("playAuto==="+playAuto);
    //thisMovie("manoramaplayer").setFiles(filename,image,api,test,category,formats,title,midDuration,midNo);
	if(window.document.manoramaplayerv )	{
	//	alert("setting");
	   var testFlag = false ; //test
	   window.document.manoramaplayerv.setFiles(filename,image,api,testFlag,category,formats,title,midDuration,midNo);
	   //if(playAuto) alert("playAuto"+playAuto);
	  
	   try{
		   if( playAuto=='undefined' || playAuto == null ){
			   autoPlay = true ;			
		   }else{
			autoPlay = playAuto;
		   }
	   }catch(error){autoPlay=true;}
	   
	   if( autoPlay == 'true' || autoPlay == true ){ startPlayV(); }
	  // alert("set");
	}
	
}
function startPlayV(){
	if(window.document.manoramaplayerv )  { window.document.manoramaplayerv.playStart();}
}

/* Vdopia  6Sep09*/

var windowmsg = "Play this video";