

function CPHOTO( oPhoto, oMedia,i_myJSONObject )
{
	this.Photo = oPhoto;
	this.Media = oMedia;
	this.cbFunction = null;
	this.PlayerState = null;
	this.EventArray	= null;
     
	
	
	
	this.LayerDIVName=i_myJSONObject["UniplayDivName"];		
	CPHOTO.prototype.Duration = PHOTO_Duration;
	CPHOTO.prototype.TimeOut = PHOTO_TimeOut;	
	CPHOTO.prototype.Inital = PHOTO_Inital;

	CPHOTO.prototype.Play = PHOTO_Play;	
	// Inital
	this.Inital(i_myJSONObject);

}

  



function PHOTO_Play(i_myJSONObject)
{	
		var t_currentcontent=i_myJSONObject["currentcontent"];	
		this.Photo.src = i_myJSONObject["jsondata"][t_currentcontent]["url"];		//Show Pictures
	
	
	    var t_UniplayDivName=this.LayerDIVName+"CPHOTO"; //this.Player;	
    
		var  EventArray = {"action":"event","actiondetail":"PlayStateChange","player":"CPHOTO","data":0};		
             EventArray["UniplayDivName"]=t_UniplayDivName;			 
             EventArray["jsondata"]=i_myJSONObject;		
			 
			 
			 
	    var t_duration=0;
		try
	    {
		    t_duration=i_myJSONObject["jsondata"][t_currentcontent]["parameter"]["duration"];		
		}catch(err)
		{
			t_duration=g_GlobeValue["default"]["duration"];
		}			 	 					
		this.Duration(EventArray,t_duration);


}
function PHOTO_Inital(i_myJSONObject)
{


	this.Play(i_myJSONObject);

			
}
function PHOTO_TimeOut(i_EventArray)
{

//	  YAHOO.log(i_EventArray);	

	 var myObject = i_EventArray.parseJSON();

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

}

function PHOTO_Duration(i_EventArray,t_duration)
{
	var t_divname=i_EventArray["jsondata"]["divname"];	
	i_EventArray["TimeIDField"]= t_divname;
	// var timerID=0; 	
	
	this.EventArray=i_EventArray;
	var t_EventArrayString=i_EventArray.toJSONString();
	var t_CallBackFunction="PHOTO_TimeOut('"+t_EventArrayString+"')";	
	var timerID=setTimeout(t_CallBackFunction,t_duration);

	
	return timerID;
}
