

function ContactData () {
    
	//alert("ContactData()");
	this.DisplayName			= null;
	this.IdentityName			= null;	
    this.OnlineStatusImgPath	= null;
	this.AvataImgPath			= null;
	this.AvataImgType			= null;
	this.MoodMsg				= null;

}


ContactData.prototype.SetData = function(SkypeName,PSTN,Display,Availablity,Gender,Avata,Mood) {

	//alert("ContactDataSetData");
		
	if(Display) {
		this.DisplayName = Display;
		
		if(SkypeName){
			this.IdentityName = SkypeName;
		}
		else if(PSTN){
			this.IdentityName = PSTN;
		}
		else{			
			alert("################################################################");
			alert("[ContactData.SetData] Setting Error When Identity");		
			alert("#################################################################");			
		}
	}
	else if(SkypeName) {
		
		this.DisplayName = SkypeName;
		this.IdentityName = SkypeName;
	}
	else if(PSTN) {
		
		this.DisplayName = PSTN;
		this.IdentityName = PSTN;
	}
	else{
		alert("################################################################");
		alert("[ContactData.SetData] Setting Error When Identity & DisplayName");		
		alert("#################################################################");
	}

	if(Mood) {
		this.MoodMsg = Mood;
	}
	else {
		this.MoodMsg = "";
	}
	
	
	if(SkypeName == "echo123") {
		this.AvataImgPath = g_Image.IMAGE_LIST_MAIN_HISTORY_LIST_ITEM_DEFAULT_AVATA_TEST_CALL;
		this.AvataImgType = ENUM_CONTACT_AVATA_TYPE.TEST_CALL;
	}		
	else if(Avata) {		
		this.AvataImgPath = Avata;
		this.AvataImgType = ENUM_CONTACT_AVATA_TYPE.ONES_IMAGE;					
	}
	else if (PSTN){
		this.AvataImgPath = g_Image.IMAGE_LIST_MAIN_HISTORY_LIST_ITEM_DEFAULT_AVATA_PSTN;
		this.AvataImgType = ENUM_CONTACT_AVATA_TYPE.PSTN;
	}
	else if (Gender == "1"){
		this.AvataImgPath = g_Image.IMAGE_LIST_MAIN_HISTORY_LIST_ITEM_DEFAULT_AVATA_MALE;
		this.AvataImgType = ENUM_CONTACT_AVATA_TYPE.MALE;
	}
	else if (Gender == "2" ) {
		this.AvataImgPath = g_Image.IMAGE_LIST_MAIN_HISTORY_LIST_ITEM_DEFAULT_AVATA_FEMALE;
		this.AvataImgType = ENUM_CONTACT_AVATA_TYPE.FEMALE;
	}
	else {
		this.AvataImgPath = g_Image.IMAGE_LIST_MAIN_HISTORY_LIST_ITEM_DEFAULT_AVATA_NO_GENDER;
		this.AvataImgType = ENUM_CONTACT_AVATA_TYPE.NO_GENDER;
	}

	alert("ContactData.SetData(IdentityName : "+this.IdentityName+") AvataImgType : " + this.AvataImgType);
	//GROUP (Never found)
/*
	if(Availablity == ENUM_CONTACT_AVAILABILITY.GROUP){
		
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_GROUP;
	}
*/
	//BLOCKED & BLOCKED_SKYPEOUT
	if (Availablity == ENUM_CONTACT_AVAILABILITY.BLOCKED ||
		Availablity == ENUM_CONTACT_AVAILABILITY.BLOCKED_SKYPEOUT) {
			
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_BLOCKED;
	}
	// PSTN
	else if(PSTN){
		
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_CALLING;
	}
	//SkYPEOUT
	else if(Availablity == ENUM_CONTACT_AVAILABILITY.SKYPEOUT){
		
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_SKYPEOUT;
	}
	//ONLINE	
	else if(Availablity == ENUM_CONTACT_AVAILABILITY.ONLINE || 
		Availablity == ENUM_CONTACT_AVAILABILITY.ONLINE_FROM_MOBILE) {
					
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_ONLINE;
	}
	//OFFLINE
	else if (Availablity == ENUM_CONTACT_AVAILABILITY.OFFLINE ||
		Availablity == ENUM_CONTACT_AVAILABILITY.NOT_AVAILABLE_FROM_MOBILE) {
			
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_OFFLINE;
	}
	//AWAY 
	else if (Availablity == ENUM_CONTACT_AVAILABILITY.AWAY ||
		Availablity == ENUM_CONTACT_AVAILABILITY.AWAY_FROM_MOBILE){
			
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_AWAY;
	}
	//DO_NOT_DISTURB	
	else if (Availablity == ENUM_CONTACT_AVAILABILITY.DO_NOT_DISTURB ||
		Availablity == ENUM_CONTACT_AVAILABILITY.DO_NOT_DISTURB_FROM_MOBILE){
			
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_DO_NOT_DISTURB;
	}
	//CALL_FORWARDING or VOICEMAIL ABLE
	else if (Availablity == ENUM_CONTACT_AVAILABILITY.OFFLINE_BUT_CF_ABLE ||
		Availablity == ENUM_CONTACT_AVAILABILITY.OFFLINE_BUT_VM_ABLE) {
			
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_AVAILABLE;
	}
	//PENDINGAUTH	
	else if (Availablity == ENUM_CONTACT_AVAILABILITY.PENDINGAUTH){
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_OFFLINE;
	}
	//UNKNOWN	
	else if(Availablity == ENUM_CONTACT_AVAILABILITY.UNKNOWN) {
		//2013 modify by minseok
		alert("Contact Data Avaliablity : "+Availablity);			
		// this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_OFFLINE;
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_NEW;
	}
	//ELSE
	else{		
		alert("Availablity is Error");
		this.OnlineStatusImgPath = g_Image.IMAGE_ONLINE_STATUS_PRESENCE_OFFLINE; 
	}	
} 


