
function CWEB( oWeb, oMedia,i_myJSONObject )
{
	this.Media = oMedia;
	this.cbFunction = null;
	this.PlayerState = null;
	
	
	
	//this.Photo.src = this.Media.URL;
	
	
	/*
	CWEB.prototype.Stop = WEB_Stop;
	CWEB.prototype.Play = WEB_Play;
	CWEB.prototype.CB = WEB_CB;
	CWEB.prototype.Exec = WEB_Exec;
	CWEB.prototype.PlayStateChange = WEB_PlayStateChange;
	*/
	
	this.currentcontent=i_myJSONObject["currentcontent"];
	var 	t_NumberContent=this.currentcontent;		
	this.Player=i_myJSONObject["jsondata"][t_NumberContent]["player"];
	this.URL=i_myJSONObject["jsondata"][t_NumberContent]["url"];
	this.LayerDIVName=i_myJSONObject["divname"]; 	
	
						
	var t_UniplayDivName=this.LayerDIVName+this.Player;	
    //this.objUniplayDivName=JSFUN_getElementByIdCompatible(t_UniplayDivName);	
	
	//	if (t_website!=""){ t_TagHTML='<a href="'+t_website+'">'+t_TagHTML+'</a>';  }
	
	/*
	 var t_HTMLCode='<IFRAME id="WEBIframe"  onFocus="this.blur()"   src="'+this.Media.URL+'" frameBorder="0" scrolling="no" application="yes" height="100%" width="100%"></IFRAME>';						              			
	 document.getElementById(t_UniplayDivName).innerHTML=t_HTMLCode; //"123123123123123";
	*/
	
	
	
	
	
	this.LayerDIVName=i_myJSONObject["UniplayDivName"];		
	CWEB.prototype.Duration = WEB_Duration;
	CWEB.prototype.TimeOut = WEB_TimeOut;	
	CWEB.prototype.Inital = WEB_Inital;
	// Inital
	this.Inital(i_myJSONObject);               		
}



function WEB_Inital(i_myJSONObject)
{
	////////////////////////////////////////
	// for Duration time
			
		YAHOO.log(t_duration);
	    var t_UniplayDivName=this.LayerDIVName+"CWEB"; //this.Player;	

		YAHOO.log(t_duration);	    
		var  EventArray = {"action":"event","actiondetail":"PlayStateChange","player":"CWEB","data":0};		
             EventArray["UniplayDivName"]=t_UniplayDivName;			 
             EventArray["jsondata"]=i_myJSONObject;		
		var t_currentcontent=i_myJSONObject["currentcontent"];	
	    var t_duration=0;
		try
	    {
		    t_duration=i_myJSONObject["jsondata"][t_currentcontent]["parameter"]["duration"];				
		}catch(err)
		{
			t_duration=g_GlobeValue["default"]["duration"];			
		}	
		if (t_duration!=-1 )
		{		 	 							
			this.Duration(EventArray,t_duration);
		}			
			
}
function WEB_TimeOut(i_EventArray)
{
	YAHOO.log(i_EventArray);	
	var myObject = i_EventArray.parseJSON();

	YAHOO.log(myObject);
	 
 	JS_JSONStringProcess(myObject);

}

function WEB_Duration(i_EventArray,t_duration)
{
	var t_divname=i_EventArray["jsondata"]["divname"];	
	i_EventArray["TimeIDField"]= t_divname;
	this.EventArray=i_EventArray;
	var t_EventArrayString=i_EventArray.toJSONString();
	var t_CallBackFunction="WEB_TimeOut('"+t_EventArrayString+"')";	
	var timerID=setTimeout(t_CallBackFunction,t_duration);
	return timerID;
}

function WEB_CB(obj)
{
	/*
	if(this.cbFunction == null ) return;
	
	this.cbFunction(obj);
	*/
}

function WEB_Stop()
{
	
	return;
}

function WEB_Play()
{
	/*
	var unisplash = document.getElementById('unisplash');
	
	if(unisplash != null) {
		unisplash.removeNode(true);
	}
	this.PlayStateChange(oUniPlayer, 'play');
	parent.runWeb(this.Media.URL);
	*/
}

function WEB_Exec()
{

}

// EVENTS
function WEB_PlayStateChange(oUni, NewState )
{
	/*
	try {
		var WEB = oUni.CoPlayer;
		var o = new Object();
				o.oUni = oUni;
				
		WEB.PlayerState = NewState;
		WEB.CB(o);
	}
	catch(er) {
	}
	*/
}
	