Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6
System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64
User : User ( 0)
PHP Version : 7.4.6
Disable Function : NONE
Directory :  C:/Program Files/CyberLink/PowerDirector/web/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : C:/Program Files/CyberLink/PowerDirector/web/contracts.htm
<html>
	<STYLE> DIV.title { PADDING-LEFT: 1px; FONT-SIZE: 12px; MARGIN-BOTTOM: 1px; COLOR: #000066; LINE-HEIGHT: 9px; FONT-FAMILY: monospace; LETTER-SPACING: 2px; HEIGHT: 9px }
	DIV.main { BORDER-RIGHT: #000066 1px solid; BORDER-TOP: #000066 1px solid; BORDER-LEFT: #000066 1px solid; BORDER-BOTTOM: #000066 1px solid }
	DIV.domTT { BORDER-RIGHT: #333333 1px solid; BORDER-TOP: #333333 1px solid; BORDER-LEFT: #333333 1px solid; BORDER-BOTTOM: #333333 1px solid; BACKGROUND-COLOR: #333333 }
	DIV.domTT .caption { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 12px; PADDING-BOTTOM: 1px; COLOR: #ffffff; PADDING-TOP: 1px; FONT-FAMILY: serif }
	DIV.domTT .contents { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 12px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px; FONT-FAMILY: sans-serif; BACKGROUND-COLOR: #f1f1ff }
	DIV.domTTClassic { BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: infobackground }
	DIV.domTTClassic .caption { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 12px; PADDING-BOTTOM: 1px; PADDING-TOP: 1px; FONT-STYLE: italic; FONT-FAMILY: serif }
	DIV.domTTClassic .contents { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; COLOR: infotext; PADDING-TOP: 1px; FONT-FAMILY: Arial, sans-serif }
	DIV.domTTWin { BORDER-RIGHT: #bfbfbf 2px outset; BORDER-TOP: #bfbfbf 2px outset; BORDER-LEFT: #bfbfbf 2px outset; BORDER-BOTTOM: #bfbfbf 2px outset; BACKGROUND-COLOR: #808080 }
	DIV.domTTWin .caption { BORDER-RIGHT: #bfbfbf 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #bfbfbf 1px solid; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; BORDER-LEFT: #bfbfbf 1px solid; COLOR: white; PADDING-TOP: 2px; BORDER-BOTTOM: #bfbfbf 0px solid; FONT-FAMILY: sans-serif; BACKGROUND-COLOR: #00007f }
	DIV.domTTWin .contents { BORDER-RIGHT: #bfbfbf 1px solid; BORDER-TOP: #bfbfbf 1px solid; BORDER-LEFT: #bfbfbf 1px solid; BORDER-BOTTOM: #bfbfbf 1px solid }
	DIV.domTTOverlib { BORDER-RIGHT: #333366 1px solid; BORDER-TOP: #333366 1px solid; BORDER-LEFT: #333366 1px solid; BORDER-BOTTOM: #333366 1px solid; BACKGROUND-COLOR: #333366 }
	DIV.domTTOverlib .caption { FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #ffffff; FONT-FAMILY: Verdana, Helvetica }
	DIV.domTTOverlib .contents { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 10px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Verdana, Helvetica; BACKGROUND-COLOR: #f1f1ff }
	DIV.niceTitle { PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-WEIGHT: bold; FONT-SIZE: 13px; Z-INDEX: 20; FILTER: progid:DXImageTransform.Microsoft.Alpha(opacity=87); LEFT: 0px; PADDING-BOTTOM: 4px; WIDTH: 250px; COLOR: #ffffff; PADDING-TOP: 4px; FONT-FAMILY: "Trebuchet MS", sans-serif; POSITION: absolute; TOP: 0px; BACKGROUND-COLOR: #333333; TEXT-ALIGN: left; moz-border-radius: 0 10px 10px 10px; moz-opacity: .87; khtml-opacity: .87; opacity: .87 }
	DIV.niceTitle .contents { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; FILTER: progid:DXImageTransform.Microsoft.Alpha(opacity=100); PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; moz-opacity: 1; khtml-opacity: 1; opacity: 1 }
	DIV.niceTitle P { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 9px; PADDING-BOTTOM: 0px; MARGIN: 0px; COLOR: #d17e62; PADDING-TOP: 3px; TEXT-ALIGN: left; moz-opacity: 1 }
	DIV.domTTMenu { BORDER-RIGHT: #e6e6e6 2px outset; BORDER-TOP: #e6e6e6 2px outset; BORDER-LEFT: #e6e6e6 2px outset; WIDTH: 150px; BORDER-BOTTOM: #e6e6e6 2px outset }
	DIV.domTTMenu .caption { FONT-SIZE: 12px; FONT-FAMILY: sans-serif; BACKGROUND-COLOR: #e6e6e6 }
	DIV.domTTMenu .contents { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 1px; PADDING-TOP: 1px; BACKGROUND-COLOR: #e6e6e6 }
	</STYLE>
	

	<SCRIPT language="javascript" src="domLib.js" type="text/javascript"></SCRIPT>
	<SCRIPT language="javascript" src="domTT.js" type="text/javascript"></SCRIPT>
	<SCRIPT language="javascript" src="MD5.js" type="text/javascript"></SCRIPT>
	<SCRIPT language="javascript" src="FlickrAction.js" type="text/javascript"></SCRIPT>
	<SCRIPT language="javascript" src="hashtable.js" type="text/javascript"></SCRIPT>
	<script type="text/javascript">
	
	var strPhotoUrl;
	var strFrob;
	var nPhotoNum = 0;
	var nContract_id;
	var m_strCurrent_person_id;
	var m_StrPhotoset_id = "";
	var m_htPhotoID = new Hashtable;
	var m_htPhotoTitle = new Hashtable;
	var m_htPhotoUser = new Hashtable;
	
	var m_bShowPhotoSet = false;
	var m_bShowContract = false;
	var m_nCurrentPhotoSetPage = 1;
	var m_nPhotosPrePage = 0;
	var m_nContractPage = 1;
	
	//for InfoArea use
	var m_CurrentContractInfo_ImageURL;
	var m_CurrentContractInfo_Name;
	
	var m_CurrentPhotoSetInfo_ImageURL;
	var m_CurrentPhotoSetInfo_PhotosetID;
	var m_CurrentPhotoSetInfo_Description;
	var m_CurrentPhotoSetInfo_PhotosCount;
	var m_CurrentPhotoSetInfo_Title;
	var m_nAvoidDownloadLicensesID =[0,3,6];
	
	var m_nConstractID;
	
	var m_nWindowWidth = 480;
	var m_nWindowHeight = 290;
	
	var m_nPhotosInWidth = 10;
	var m_nPhotosInHeight = 10;
	
	var m_nContractGetCount = 0;
	
	
	function UpdateSelectAllButtonStatus()
	{
		var bEnable = true;
		if(m_bShowPhotoSet)
			bEnable = false;
		if(nPhotoNum == 0)
			bEnable = false;
		var strEnableSelectAllButton;
		if(bEnable == true)
			strEnableSelectAllButton = "EnableSelectAllButton:1";
		else
			strEnableSelectAllButton = "EnableSelectAllButton:0";
		location = strEnableSelectAllButton;
	}
	
	function GetPhotoUser(photo_td)
	{
		//var strUser = "";
		var strUser = m_htPhotoUser.items(photo_td);
		//alert(strTitle);
		var strPhoto_Title = "GetPhotoUser:"+decodeURI(strUser);
		location = strPhoto_Title;
	}
	
	function UpdateUpLevelButtonStatus(bEnable)
	{
		var strEnableUpLevelButton;
		if(bEnable == true)
			strEnableUpLevelButton = "EnableUpLevelButton:1";
		else
			strEnableUpLevelButton = "EnableUpLevelButton:0";
		location = strEnableUpLevelButton;
	}
	
	function GoUpLevel()
	{
		if(m_bShowPhotoSet)
		{
			GetContactList(m_nContractPage,m_nPhotosPrePage);
		}
		else
		{
			GetPhotoSetList(m_strCurrent_person_id);
		}
	}
	
	
	function GoToPage(nPageIndex)
	{
		if(m_bShowContract)
		{
			m_nContractPage = nPageIndex;
			if(m_nContractPage >m_nTotalPageNum)
				m_nContractPage = m_nTotalPageNum;
			GetContactList(m_nContractPage,m_nPhotosPrePage);
		}
		else if(m_bShowPhotoSet)
		{
			m_nCurrentPhotoSetPage = nPageIndex;
			if(m_nCurrentPhotoSetPage >m_nTotalPageNum)
				m_nCurrentPhotoSetPage = m_nTotalPageNum;
			GetPhotoSetList(m_strCurrent_person_id);
		}
		else
		{
			m_nCurrentPageIndex = nPageIndex;
			if(m_nCurrentPageIndex >m_nTotalPageNum)
			{
				m_nCurrentPageIndex = m_nTotalPageNum;
			}
			GetPhotosBySetID(m_StrPhotoset_id,m_nCurrentPageIndex);
		}
			
		UpdateCurPageInfo();
		UpdateTotalPageInfo();
	}
	
	function ShowPersonsInfoArea()
	{
		var infoArea = document.getElementById("Info_Area1");
		infoArea.innerHTML = "";
		
		var Info_Area2 = document.getElementById("Info_Area2");
		Info_Area2.innerHTML = "";

		var tbl     = document.createElement("table");
		var tblBody = document.createElement("tbody");
		
		var row1 = document.createElement("tr");
		var cell1 = document.createElement("td");	
		cell1.setAttribute('align', "center");
		
		var tbl_new     = document.createElement("table");
		tbl_new.setAttribute('cellspacing','0');
		tbl_new.setAttribute('cellpadding','0');
		var tblBody_new = document.createElement("tbody");
		tbl_new.setAttribute('border','0');
		
		
		var rowIcon = document.createElement("tr");
		var cellIcon = document.createElement("td");	
		cellIcon.setAttribute('width', "62");
		cellIcon.setAttribute('height', "58");
		cellIcon.setAttribute('align', "center");
		cellIcon.setAttribute('vAlign', "top");
		cellIcon.setAttribute('align', "center");
		var strBKImageFile;
		strBKImageFile = m_strSkinPath+"thumb_bg_user.png";
		cellIcon.setAttribute('background',strBKImageFile);
		var link = document.createElement('a');
		link.setAttribute('target', "_top");
		link.onclick = function()
		{
			m_nCurrentPhotoSetPage = 1;
			GetPhotoSetList(m_strCurrent_person_id);
			var infoArea = document.getElementById("Info_Area2");
			infoArea.innerHTML = "";
		}
		
		link.onmouseover = function()
		{
			this.style.cursor= 'hand';
		}
		
		link.onmouseout=function()
		{
			this.style.cursor= 'default';
		}
		
		var div = document.createElement('img');
		div.setAttribute('width', "49");
		div.setAttribute('height', "48");
		div.setAttribute('vspace', 7);
	
		var url = m_CurrentContractInfo_ImageURL;
		div.setAttribute('src', url);
		div.setAttribute('border', 0);
		
		var textNode = document.createTextNode(m_CurrentContractInfo_Name);
		var textChangeLine = document.createElement("p");

		link.appendChild(div);
		
		cellIcon.appendChild(link);
		rowIcon.appendChild(cellIcon);
		
		tblBody_new.appendChild(rowIcon);
		tbl_new.appendChild(tblBody_new);
		
		cell1.appendChild(tbl_new);
		row1.appendChild(cell1);
		
		
		var row2 = document.createElement("tr");
		var cell2 = document.createElement("td");	
		cell2.setAttribute('align', "center");
		cell2.appendChild(textNode);
		row2.appendChild(cell2);
		
		tblBody.appendChild(row1);
		tblBody.appendChild(row2);
		tbl.appendChild(tblBody);
		infoArea.appendChild(tbl);
		tbl.setAttribute("border", "0");
	}
	
	function UpdateSetInfoArea()
	{
		var infoArea = document.getElementById("Info_Area2");	
		infoArea.innerHTML = "";
		var tbl     = document.createElement("table");
		var tblBody = document.createElement("tbody");
		
		
				
		
		var row1 = document.createElement("tr");
		var cell1 = document.createElement("td");	
		cell1.setAttribute('align', "center");
		var strTextPhotos = "Set photos:"+m_CurrentPhotoSetInfo_PhotosCount;
		var textNode = document.createTextNode(strTextPhotos);
		cell1.appendChild(textNode);
		row1.appendChild(cell1);
		
		
		var row2 = document.createElement("tr");
		var cell2 = document.createElement("td");	
		cell2.setAttribute('align', "center");
		
		//For PhotoSet Icon
		var tbl_new     = document.createElement("table");
		tbl_new.setAttribute('cellspacing','0');
		tbl_new.setAttribute('cellpadding','0');
		var tblBody_new = document.createElement("tbody");
	
		tbl_new.setAttribute('border','0');
		
		var rowIcon = document.createElement("tr");
		var cellIcon = document.createElement("td");	
		
		cellIcon.setAttribute('align', "center");
		cellIcon.setAttribute('width', "84");
		cellIcon.setAttribute('height', "90");
		cellIcon.setAttribute('vAlign', "top");
		var strBKImageFile;
		strBKImageFile = m_strSkinPath+"thumb_bg_set.png";
		cellIcon.setAttribute('background',strBKImageFile);
		
		var link = document.createElement('a');
		link.setAttribute('target', "_top");	
		link.setAttribute('photoset_id', m_CurrentPhotoSetInfo_PhotosetID);	
		link.setAttribute('description', m_CurrentPhotoSetInfo_Description);
		var Descript = m_CurrentPhotoSetInfo_Description;
		link.setAttribute('title', Descript);
		
		link.onclick = function()
		{
			m_CurrentPhotoSetInfo_ImageURL = this.image_src;
			m_CurrentPhotoSetInfo_PhotosetID = this.photoset_id;
			GetPhotosBySetID(this.photoset_id,1);
		}

		var div = document.createElement('img');
		div.setAttribute('src', m_CurrentPhotoSetInfo_ImageURL);
		div.setAttribute('border', 0);
		div.setAttribute('description', m_CurrentPhotoSetInfo_Description);
		div.setAttribute('vspace', 6);
		div.setAttribute('align', "center");
		div.setAttribute('border', 0);
		div.setAttribute('height', "72");
		div.setAttribute('width', "72");
	
		link.appendChild(div);
		
		cellIcon.appendChild(link);
		rowIcon.appendChild(cellIcon);
		
		tblBody_new.appendChild(rowIcon);
		tbl_new.appendChild(tblBody_new);
		
		cell2.appendChild(tbl_new);
		row2.appendChild(cell2);
		
		
		var row3 = document.createElement("tr");
		var cell3 = document.createElement("td");	
		cell3.setAttribute('align', "center");
		var textNodeNobr = document.createTextNode(m_CurrentPhotoSetInfo_Title);
		//var divCell = document.createElement('div');
		//var textNodeNobr = "<div style='width: 80px; text-overflow: ellipsis; overflow: hidden'><font size = 2><nobr>"+m_CurrentPhotoSetInfo_Title+"</nobr></font></div>";
		//divCell.innerHTML=textNodeNobr;
		//cell3.appendChild(divCell);
		cell3.appendChild(textNodeNobr);
		row3.appendChild(cell3);
		
		tblBody.appendChild(row1);
		tblBody.appendChild(row2);
		tblBody.appendChild(row3);
		
		tbl.appendChild(tblBody);
		infoArea.appendChild(tbl);
		tbl.setAttribute("border", "0");
	}
	
	function GetPhotoUrl(photo_id)
	{
		//alert("GetPhotoUrl");
		//alert(photo_id);
		GetPhotoSizes(photo_id);
	}
	
	function GetPhotoTitle(photo_td)
	{
		var strTitle = m_htPhotoTitle.items(photo_td);
		//alert(strTitle);
		var strPhoto_Title = "GetTitle:"+decodeURI(strTitle);
		location = strPhoto_Title;
	}
	
	function updateBKImage()
	{
		var body = document.getElementById("bkArea");
		body.background = m_strSkinPath+"flickr_user_bg.png";
	}
	
	function updateTableWH()
	{
		//alert("updateTableWH");
		m_nWindowHeight = document.body.clientHeight;
		m_nWindowWidth = document.body.clientWidth*0.65;
		
		for(var i = 0;i<200;i++)
		{
			if(i>m_nWindowWidth/85)
			{
				
				m_nPhotosInWidth = i;
				//alert(m_nPhotosInWidth)
				break;
			}
		}
		
		for(var i = 0;i<200;i++)
		{
			if(i>(m_nWindowHeight-60)/130)
			{
				m_nPhotosInHeight = i;
				break;
			}
		}
		m_nPhotosPrePage = m_nPhotosInWidth*m_nPhotosInHeight;
		
		for(var i = 0;i<200;i++)
		{
			if(i>m_nWindowWidth/120)
			{
				m_nPhotoSetsInWidth = i;
				break;
			}
		}
		
		for(var i = 0;i<200;i++)
		{
			if(i>(m_nWindowHeight-60)/130)
			{
				m_nPhotoSetsInHeight = i;
				break;
			}
		}
		m_nPhotoSetsPrePage = m_nPhotoSetsInWidth*m_nPhotoSetsInHeight;
	}
	
	function OnCheckBox(photo_id,photo_title,bCheck,photo_user)
	{
		if(bCheck)
		{
			m_htPhotoTitle.add(photo_id,photo_title);
			m_htPhotoID.add(photo_id,photo_title);
			m_htPhotoUser.add(photo_id,photo_user)
		}
		else
		{
			m_htPhotoTitle.remove(photo_id,photo_title);
			m_htPhotoID.remove(photo_id,photo_title);
			m_htPhotoUser.remove(photo_id,photo_user)
		}
		var strSelectCount = "UpdateCurSelectCount:"+m_htPhotoTitle.count();
		//alert(strSelectCount);
		location = strSelectCount;
	}
	
	function DownloadSelectedPhoto() 
	{
		for(var k in m_htPhotoID._hash)
	    {
			var strGetID = "add:"+k;
			location = strGetID;
		}
		m_htPhotoID.clear();
		//start download
		var ref = "download:test";
		location = ref; 
		return; 
	}
	
	function SelectedAllPhoto() 
	{
		for (var i=0; i<nPhotoNum; i++)
		{
			var strID = "image"+ i;
			if(!document.getElementById(strID).disabled)
			{
				document.getElementById(strID).checked = true;
				OnCheckBox(document.getElementById(strID).photo_id,document.getElementById(strID).photo_title,true,document.getElementById(strID).photo_user);
			}
		}
	}
	
	function UnSelectedAllPhoto() 
	{
		for (var i=0; i<nPhotoNum; i++)
		{
			var strID = "image"+ i;
			document.getElementById(strID).checked = false;
			OnCheckBox(document.getElementById(strID).photo_id,document.getElementById(strID).photo_title,false,document.getElementById(strID).photo_user);
		}
	}
	
	
	
	function OnButtonPrev()
	{
		//alert("OnButtonPrev");
		//m_StrPhotoset_id = photoset_id;
		
		if(m_bShowContract)
		{
			m_nContractPage--;
			if(m_nContractPage <=0)
				m_nContractPage = 1;
			GoToPage(m_nContractPage);
		}
		else if(m_bShowPhotoSet)
		{
			m_nCurrentPhotoSetPage--;
			if(m_nCurrentPhotoSetPage<=0)
				m_nCurrentPhotoSetPage = 1;
			GetPhotoSetList(m_strCurrent_person_id);
			UpdateCurPhotoSetPageInfo();
		}
		else
		{
			m_nCurrentPageIndex--;
			if(m_nCurrentPageIndex<=0)
			{
				m_nCurrentPageIndex = 1;	
			}
			GetPhotosBySetID(m_StrPhotoset_id,m_nCurrentPageIndex);
		}
	}
	
	function OnButtonNext()
	{
		//alert("OnButtonNext");
		if(m_bShowContract)
		{
			m_nContractPage++;
			if(m_nContractPage >m_nTotalPageNum)
				m_nContractPage = m_nTotalPageNum;
			GoToPage(m_nContractPage);
		}
		else if(m_bShowPhotoSet)
		{
			m_nCurrentPhotoSetPage++;
			if(m_nCurrentPhotoSetPage >m_nTotalPageNum)
				m_nCurrentPhotoSetPage = m_nTotalPageNum;
				
			GetPhotoSetList(m_strCurrent_person_id);
			UpdateCurPhotoSetPageInfo();
		}
		else
		{
			m_nCurrentPageIndex++;
			if(m_nCurrentPageIndex >m_nTotalPageNum)
			{
				m_nCurrentPageIndex = m_nTotalPageNum;
			}
			GetPhotosBySetID(m_StrPhotoset_id,m_nCurrentPageIndex);
		}
	}
	
	function ShowToolTips(strText)
	{
		//alert(strText);
		domTT_activate(this, event, 'content',strText , 'grid', 20, 'fade', 'out', 'trail', true);
	}
	function ShowPhotoSets(photosets)
	{
		m_bShowContract = false;
		UpdateUpLevelButtonStatus(true);
		nPhotoNum = 0;
		UpdateSelectAllButtonStatus();
		if(photosets.photoset)
		{
			var body = document.getElementById("resultArea");
			body.innerHTML = "";
			
			var tbl     = document.createElement("table");
			tbl.setAttribute('cellspacing','0');
			tbl.setAttribute('cellpadding','0');
			tbl.setAttribute('VALIGN', "top");
			var tblBody = document.createElement("tbody");

			var nCount = 0;
			var row = document.createElement("tr");
			
			m_nTotalPageNum = photosets.photoset.length/m_nPhotoSetsPrePage + 1;
			m_nTotalPageNum = parseInt(m_nTotalPageNum);
			
			var nStartIndex = (m_nCurrentPhotoSetPage-1)*m_nPhotoSetsPrePage;
			var nEndIndex = nStartIndex+m_nPhotoSetsPrePage;
			if(nEndIndex>photosets.photoset.length)
				nEndIndex = photosets.photoset.length;
				
			
			for(var i = nStartIndex;i<nEndIndex;i++)
			{
				if(nCount>m_nPhotoSetsInWidth-1)
				{
					nCount = 0;
					row = document.createElement("tr");
				}
				nCount++;
				
				
				var cell = document.createElement("td");
				
				var nCellWidth = 450/4;
				cell.setAttribute('width', nCellWidth);
				cell.setAttribute('height', 90);
				cell.setAttribute('align', "center");
				
				//new table
				var tbl_new     = document.createElement("table");
				tbl_new.setAttribute('cellspacing','0');
				tbl_new.setAttribute('cellpadding','0');
				var tblBody_new = document.createElement("tbody");
				tbl_new.setAttribute('border','0');
			
				
				//cell.setAttribute('height', "110");
	
				var row1 = document.createElement("tr");
				row1.setAttribute('align', "center");
				row1.setAttribute('align', "top");
				var cell1 = document.createElement("td");	
				cell1.setAttribute('width', "84");
				cell1.setAttribute('height', "90");
				cell1.setAttribute('vAlign', "top");
				var strBKImageFile;
				strBKImageFile = m_strSkinPath+"thumb_bg_set.png";
				cell1.setAttribute('background',strBKImageFile);
				
				var link = document.createElement('a');
				link.setAttribute('target', "_top");
				//var strHref = "GetPhotos:"+photosets.photoset[i].id;
				//link.setAttribute('href', strHref);			
				var url = "http://farm" + photosets.photoset[i].farm + ".static.flickr.com/" + photosets.photoset[i].server + "/"+ photosets.photoset[i].primary+"_" + photosets.photoset[i].secret+"_s.jpg";
				link.setAttribute('photoset_id', photosets.photoset[i].id);	
				link.setAttribute('image_src', url);
				link.setAttribute('description', photosets.photoset[i].description._content);
				link.setAttribute('photos', photosets.photoset[i].photos);
				link.setAttribute('title', photosets.photoset[i].title._content);
				link.setAttribute('title1', photosets.photoset[i].title._content);
				
				link.onclick = function()
				{
					m_bShowPhotoSet = false;
					m_nCurrentPhotoSetPage = 1;
					m_CurrentPhotoSetInfo_ImageURL = this.image_src;
					m_CurrentPhotoSetInfo_PhotosetID = this.photoset_id;
					m_CurrentPhotoSetInfo_Description = this.description;
					m_CurrentPhotoSetInfo_PhotosCount = this.photos;
					m_CurrentPhotoSetInfo_Title = this.title1;
					domTT_closeAll();
					domTT_deactivate(this, event);
					GetPhotosBySetID(this.photoset_id,1);
					UpdateSetInfoArea();
				}
				
				
				var div = document.createElement('img');
				div.setAttribute('src', url);
				//div.setAttribute('hspace', 28);
				div.setAttribute('vspace', 6);
				div.setAttribute('align', "center");
				div.setAttribute('border', 0);
				div.setAttribute('height', "72");
				div.setAttribute('width', "72");
				div.setAttribute('description', photosets.photoset[i].description._content);
				div.setAttribute('title', photosets.photoset[i].title._content);
				//div.setAttribute('hspace', 10);
				//div.setAttribute('width', 85);
				//div.setAttribute('height', 85);
			
				div.onmouseover = function()
				{
					//domTT_activate(this, event, 'content',this.title , 'grid', 20, 'fade', 'out', 'trail', false);
					this.style.cursor= 'hand';
				}
			
				div.onmouseout=function()
				{
					//domTT_closeAll();domTT_deactivate(this, event);
					this.style.cursor= 'default';
				}
								
				link.appendChild(div);
				
				 

				cell1.appendChild(link);
				cell1.setAttribute('align', "center");
				
				row1.appendChild(cell1);
				
				
				var row2 = document.createElement("tr");
				row2.setAttribute('align', "center");
				var cell2 = document.createElement("td");	
				cell2.setAttribute('align', "center");
				
				
				var link2 = document.createElement('a');
				link2.setAttribute('target', "_top");
				//var strHref = "GetPhotos:"+photosets.photoset[i].id;
				//link.setAttribute('href', strHref);			
				var url = "http://farm" + photosets.photoset[i].farm + ".static.flickr.com/" + photosets.photoset[i].server + "/"+ photosets.photoset[i].primary+"_" + photosets.photoset[i].secret+"_s.jpg";
				link2.setAttribute('photoset_id', photosets.photoset[i].id);	
				link2.setAttribute('image_src', url);
				link2.setAttribute('description', photosets.photoset[i].description._content);
				link2.setAttribute('photos', photosets.photoset[i].photos);
				link2.setAttribute('title', photosets.photoset[i].title._content);
				link2.setAttribute('title1', photosets.photoset[i].title._content);
				
				link2.onclick = function()
				{
					m_bShowPhotoSet = false;
					m_nCurrentPhotoSetPage = 1;
					m_CurrentPhotoSetInfo_ImageURL = this.image_src;
					m_CurrentPhotoSetInfo_PhotosetID = this.photoset_id;
					m_CurrentPhotoSetInfo_Description = this.description;
					m_CurrentPhotoSetInfo_PhotosCount = this.photos;
					m_CurrentPhotoSetInfo_Title = this.title1;
					domTT_closeAll();
					domTT_deactivate(this, event);
					GetPhotosBySetID(this.photoset_id,1);
					UpdateSetInfoArea();
				}
				
				link2.onmouseover = function()
				{
					this.style.cursor= 'hand';
				}
				
				link2.onmouseout=function()
				{
					this.style.cursor= 'default';
				}
				
				var divCell = document.createElement('div');
				var textNodeNobr = "<div style='width: "+84+"px; text-overflow: ellipsis; overflow: hidden'><font size = 2 face =Segoe UI><nobr>"+photosets.photoset[i].title._content+"</nobr></font></div>";
				divCell.innerHTML=textNodeNobr;
				
				link2.appendChild(divCell);
		
				cell2.appendChild(link2);
				row2.appendChild(cell2);
				
				//cell.appendChild(cell1);
				
				tblBody_new.appendChild(row1);
				tblBody_new.appendChild(row2);
				tbl_new.appendChild(tblBody_new);
				tbl_new.setAttribute("border", "0");
				cell.appendChild(tbl_new);
				
				row.appendChild(cell);
				//cell.appendChild(cell2);
				//row.appendChild(cell);
				tblBody.appendChild(row);
			}
			
			// put the <tbody> in the <table>
			tbl.appendChild(tblBody);
			// appends <table> into <body>
			body.appendChild(tbl);
			// sets the border attribute of tbl to 2;
			tbl.setAttribute("border", "0");
		}
		
		m_bShowPhotoSet = true;
		UpdateCurPhotoSetPageInfo();
		UpdateTotalPageInfo();
	}
	
	function ShowContracts(contacts)
	{
		m_nTotalPageNum = contacts.pages;
		UpdateUpLevelButtonStatus(false);
		nPhotoNum = 0;
		UpdateSelectAllButtonStatus();
		var picList = document.getElementById("Info_Area1");
		picList.innerHTML = "";
		
		var Info_Area2 = document.getElementById("Info_Area2");
		Info_Area2.innerHTML = "";
		
		m_bShowPhotoSet = false;
		var picList = document.getElementById("resultArea");
		picList.innerHTML = ""
		m_nContractGetCount = 0;
		//Create Cell for user icons
		var tbl     = document.createElement("table");
		var tblBody = document.createElement("tbody");
		var nCount = 0;
		var row = document.createElement("tr");
		for (var i=0; i<contacts.contact.length; i++)
		{
			if(nCount>m_nPhotosInWidth-1)
			{
				nCount = 0;
				row = document.createElement("tr");
			}
			
			var strCellID = contacts.contact[i].nsid;
			nCount++;
			var cell = document.createElement("td");
			cell.setAttribute('width', "90");
			cell.setAttribute('height', "100");
			cell.setAttribute('id', strCellID);
			cell.setAttribute('align', "center");
			
			var link = document.createElement('a');
			
			cell.onmouseover = function()
			{
				//domTT_activate(this, event, 'content',this.title , 'grid', 20, 'fade', 'out', 'trail', false);
				this.style.cursor= 'hand';
			}
			cell.onmouseout=function()
			{
				//domTT_closeAll();domTT_deactivate(this, event);
				this.style.cursor= 'default';
			}
			
			row.appendChild(cell);
			tblBody.appendChild(row);	
		}
		// put the <tbody> in the <table>
		tbl.appendChild(tblBody);
		// appends <table> into <body>
		picList.appendChild(tbl);
		//Create cell end
		for (var i=0; i<contacts.contact.length; i++)
		{
			//alert(rsp.contacts.contact[i].nsid);
			getPeopleInfo(contacts.contact[i].nsid);
		}
		
		m_bShowContract = true;
		UpdateCurPageInfo();
		UpdateTotalPageInfo();
	}
	
	function ShowPersons(person)
	{
		var strCellID = person.nsid;
		//alert("Get PeopleInfo Success!");
		var picList = document.getElementById("resultArea");
		var UserCell = document.getElementById(strCellID);
		if(!UserCell)
			return;
			
			
		var tbl_new     = document.createElement("table");
		tbl_new.setAttribute('cellspacing','0');
		tbl_new.setAttribute('cellpadding','0');
		var tblBody_new = document.createElement("tbody");
		tbl_new.setAttribute('border','0');
				
		var row1 = document.createElement("tr");
		var cell1 = document.createElement("td");	
		cell1.setAttribute('width', "62");
		cell1.setAttribute('height', "58");
		cell1.setAttribute('align', "center");
		cell1.setAttribute('vAlign', "top");
		cell1.setAttribute('align', "center");
		var strBKImageFile;
		strBKImageFile = m_strSkinPath+"thumb_bg_user.png";
		cell1.setAttribute('background',strBKImageFile);	
		

		var link = document.createElement('a');
		link.setAttribute('target', "_top");
		link.setAttribute('person_id', person.nsid);
		
		var url;
		url = "http://farm" + person.iconfarm + ".static.flickr.com/" + person.iconserver + "/buddyicons/" + person.nsid + ".jpg";
		
		if(person.iconfarm == 0 && person.iconserver == 0)
			url = "http://www.flickr.com/images/buddyicon.jpg"
		
		link.setAttribute('person_image', url);
		link.setAttribute('person_name', person.username._content);
		link.setAttribute('title', person.username._content);
		
		//var strHref = "GetPhotoSets:"+person.nsid;
		
		//link.setAttribute('href', strHref);
		link.onclick = function()
		{
			m_nCurrentPhotoSetPage = 1;
			m_strCurrent_person_id = this.person_id;
			GetPhotoSetList(this.person_id);
			m_nConstractID = this.person_id;
			
			m_CurrentContractInfo_ImageURL = this.person_image;
			m_CurrentContractInfo_Name = this.person_name;
			ShowPersonsInfoArea();
		}
		link.onmouseover = function()
		{
			this.style.cursor= 'hand';
		}
		
		link.onmouseout=function()
		{
			this.style.cursor= 'default';
		}
		
		var div = document.createElement('img');
		//var url = "http://farm" + person.iconfarm + ".static.flickr.com/" + person.iconserver + "/buddyicons/" + person.nsid + ".jpg";
		div.setAttribute('src', url);
		div.setAttribute('border', 0);
		div.setAttribute('width', "49");
		div.setAttribute('height', "48");
		div.setAttribute('vspace', 7);
		link.appendChild(div);
		
		cell1.appendChild(link);
		row1.appendChild(cell1);
		
		tblBody_new.appendChild(row1);
		tbl_new.appendChild(tblBody_new);
		
		
		
		//var row2 = document.createElement("tr");
		var cell2 = document.createElement("td");	
		cell2.setAttribute('align', "center");
		
		
		var link2 = document.createElement('a');
		link2.setAttribute('target', "_top");
		link2.setAttribute('person_id', person.nsid);
		
		var url;
		url = "http://farm" + person.iconfarm + ".static.flickr.com/" + person.iconserver + "/buddyicons/" + person.nsid + ".jpg";
		
		if(person.iconfarm == 0 && person.iconserver == 0)
			url = "http://www.flickr.com/images/buddyicon.jpg"
		
		link2.setAttribute('person_image', url);
		link2.setAttribute('person_name', person.username._content);
		link2.setAttribute('title', person.username._content);
		
		//var strHref = "GetPhotoSets:"+person.nsid;
		
		//link.setAttribute('href', strHref);
		link2.onclick = function()
		{
			m_nCurrentPhotoSetPage = 1;
			m_strCurrent_person_id = this.person_id;
			GetPhotoSetList(this.person_id);
			m_nConstractID = this.person_id;
			
			m_CurrentContractInfo_ImageURL = this.person_image;
			m_CurrentContractInfo_Name = this.person_name;
			ShowPersonsInfoArea();
		}
		link2.onmouseover = function()
		{
			this.style.cursor= 'hand';
		}
		
		link2.onmouseout=function()
		{
			this.style.cursor= 'default';
		}
		
		var divCell = document.createElement('div');
		var textNodeNobr = "<div style='width: 80px; text-overflow: ellipsis; overflow: hidden'><font size = 2><nobr>"+person.username._content+"</nobr></font></div>";
		divCell.innerHTML=textNodeNobr;
				
		//var textNode = document.createTextNode(person.username._content);		
		link2.appendChild(divCell);
		cell2.appendChild(link2);
		//row2.appendChild(cell2);
		
		
		UserCell.appendChild(tbl_new);
		UserCell.appendChild(cell2);
		
		//UserCell.appendChild(link);
		
		
		
		m_nContractGetCount = m_nContractGetCount+1;
	}
	
	function UpdateTotalPageInfo() 
	{
		var ref = "UpdateTotalPageInfo:"+m_nTotalPageNum;
		location = ref; 
		return;
	}
	
	function UpdateCurPageInfo() 
	{
		var ref;
		if(m_bShowContract)
		{
			ref = "UpdateCurPageInfo:"+m_nContractPage;
		}
		else if(m_bShowPhotoSet)
		{
			ref = "UpdateCurPageInfo:"+m_nCurrentPhotoSetPage;
		}
		else
		{
			ref = "UpdateCurPageInfo:"+m_nCurrentPageIndex;
		}
		location = ref; 
		return;
	}
	
	function UpdateCurPhotoSetPageInfo() 
	{
		var ref = "UpdateCurPageInfo:"+m_nCurrentPhotoSetPage;
		location = ref; 
		return;
	}
	
	function ShowPhotos(photos)
	{
		m_bShowContract = false;
		UpdateUpLevelButtonStatus(true);
		
		UpdateTotalPageInfo();
		UpdateCurPageInfo();
		nPhotoNum = photos.photo.length;
		
		UpdateSelectAllButtonStatus();
		
		// insert newly found pictures
		var body = document.getElementById("resultArea");
		body.innerHTML = "";
			
		// creates a <table> element and a <tbody> element
		var tbl     = document.createElement("table");
		//tbl.setAttribute('border','1');
		//tbl.setAttribute('align','center');
		var tblBody = document.createElement("tbody");
		var nCount = 0;
		var row = document.createElement("tr");
		for (var i=0; i<photos.photo.length; i++)
		{
			if(nCount>m_nPhotosInWidth-1)
			{
				nCount = 0;
				row = document.createElement("tr");
			}
			nCount++;
			var cell = document.createElement("td");
			cell.setAttribute("width","100");
			//cell.setAttribute('align', "center");

			//UNIT CELL.
			var tbl_new     = document.createElement("table");
			tbl_new.setAttribute('cellspacing','0');
			tbl_new.setAttribute('cellpadding','0');
			var tblBody_new = document.createElement("tbody");
			tbl_new.setAttribute('border','0');
			
			
			var rowIcon = document.createElement("tr");
			var cellIcon = document.createElement("td");
			cellIcon.setAttribute('align','center');
			cellIcon.colSpan = 2;
		
			var photo = photos.photo[i];
			var strOwnerName = photo.ownername;
			var link = document.createElement('a');
			//var urlLarge = "add:farm" + photo.farm + ".static.flickr.com/" + photo.server + "/" + photo.id + "_" + photo.secret + ".jpg";
			var urlLarge = "add:"+photo.id;
			
			var strOwner = m_strCurrent_person_id;
			var urlLink = "http://www.flickr.com/photos/"+strOwner+"/"+photo.id+"/";
			
			link.setAttribute('target', "_BLANK");
			link.setAttribute('href', urlLink);
			
			var div = document.createElement('img');
			var url = "http://farm" + photo.farm + ".static.flickr.com/" + photo.server + "/" + photo.id + "_" + photo.secret + "_s.jpg";
			
			strPhotoUrl = urlLarge;
			var SpaceID = "image"+photo.id;
			
			div.setAttribute('src', url);
			div.setAttribute('border', 0);
			div.setAttribute('id', SpaceID);
			div.setAttribute('photo_id',photo.id);
			div.setAttribute('title',"");
			
			div.onmouseover = function()
			{
				this.style.cursor= 'hand';
				if(this.title=="")
					GetPhotoInfo(this.photo_id);
			}
			
			div.onmouseout=function()
			{
				this.style.cursor= 'default';
			}
			
			
			link.appendChild(div);
			cellIcon.appendChild(link);
			rowIcon.appendChild(cellIcon);

			
			var rowButton = document.createElement("tr");
			var cellButton1 = document.createElement("td");
			cellButton1.setAttribute('align', "left");
			cellButton1.setAttribute('width', "20");
			

			var checkBox_select = document.createElement('input');
			checkBox_select.setAttribute('type', "checkbox");
			
			var strID = "image"+ i;
			checkBox_select.setAttribute('id', strID);
			checkBox_select.setAttribute('photo_id', photo.id);
			checkBox_select.setAttribute('href', urlLarge);
			checkBox_select.setAttribute('photo_title', photo.title);
			checkBox_select.setAttribute('photo_user', strOwnerName);
			
			for(var k = 0;k<m_nAvoidDownloadLicensesID.length;k++)
			{
				if(m_nAvoidDownloadLicensesID[k]==photo.license)
					checkBox_select.disabled=true;
			}
			
			if(m_htPhotoID.contains(photo.id))
			{
				if(!checkBox_select.disabled)
					checkBox_select.defaultChecked = true;
			}
			checkBox_select.onclick = function()
			{
				OnCheckBox(this.photo_id,this.photo_title,this.checked,this.photo_user);
			}
			
			
			
			cellButton1.appendChild(checkBox_select);
			
			var cellButton2 = document.createElement("td");
			cellButton2.setAttribute('align', "right");
			var button_License = document.createElement('img');
			
			
			var strLogoPath = "";
			if(photo.license == 0)
				strLogoPath = m_strSkinPath+ "btn_c_n.png";
			else
				strLogoPath = m_strSkinPath+ "btn_copyright_n.png";
			button_License.setAttribute('src', strLogoPath);
			
			button_License.setAttribute('licenseID', photo.license);
			
			button_License.setAttribute('title',GetLicenseDescription(photo.license));
			button_License.onclick = function()
			{
				var strLogoPath = "";
				if(this.licenseID == 0)
					strLogoPath = m_strSkinPath+ "btn_c_n.png";
				else
				{
					strLogoPath = m_strSkinPath+ "btn_copyright_p.png";
				}
				this.src = strLogoPath;
				
			}
			
			button_License.onmouseover = function()
			{
				var strLogoPath = "";
				if(this.licenseID == 0)
					strLogoPath = m_strSkinPath+ "btn_c_n.png";
				else
				{
					strLogoPath = m_strSkinPath+ "btn_copyright_h.png";
					this.style.cursor= 'hand';
				}

				this.src = strLogoPath;
				
			}
			
			button_License.onmouseout = function()
			{
				var strLogoPath = "";
				if(this.licenseID == 0)
					strLogoPath = m_strSkinPath+ "btn_c_n.png";
				else
					strLogoPath = m_strSkinPath+ "btn_copyright_n.png";
				this.src = strLogoPath;
				this.style.cursor= 'default';
			}
			
			cellButton2.appendChild(button_License);
			
			rowButton.appendChild(cellButton1);
			rowButton.appendChild(cellButton2);
			
			
			
			tblBody_new.appendChild(rowIcon);
			tblBody_new.appendChild(rowButton);
			
			tbl_new.appendChild(tblBody_new);
			//tbl_new.setAttribute("border","1");
			
			cell.appendChild(tbl_new);
			
			
			row.appendChild(cell);
			tblBody.appendChild(row);	
		}
		// put the <tbody> in the <table>
		tbl.appendChild(tblBody);
		// appends <table> into <body>
		body.appendChild(tbl);
		// sets the border attribute of tbl to 2;
		tbl.setAttribute("border", "0");
		return;
	}
	
	function GetContactListEx()
	{
		GetContactList(m_nContractPage,m_nPhotosPrePage);
	}
	
	function jsonFlickrApi(rsp)
	{
		//alert("jsonFlickrApi");
		if (rsp.stat != "ok")
		{
			//alert("fail!");
			return;
		}
		
		if(rsp.photosets)
		{
			ShowPhotoSets(rsp.photosets);
			return;
		}
		
		if(rsp.sizes)
		{
			var strURL = "";
			var bFind = false;
			for(var i = 0;i<rsp.sizes.size.length;i++)
			{
				//alert(rsp.sizes.size[i].label);
				strURL = rsp.sizes.size[i].source;
				bFind = true;
				//alert(m_nDownloadSizeName);
				if(rsp.sizes.size[i].label == m_nDownloadSizeName)
				{
					//alert(rsp.sizes.size[i].label);
					break;
				}
			}
			if(bFind)
			{
				var strPhotoURL = "GetPhotoURL:"+strURL;
				location = strPhotoURL;
				//alert("find");
				//alert(rsp.sizes.size[i].url);
				//window.open(strURL);
			}
			return;
		}
		
		if(rsp.person)
		{
		
			if(rsp.person.nsid == m_nConstractID)
			{
				ShowPersonsInfoArea(rsp.person);
			}
			else
			{
				ShowPersons(rsp.person);	
			}
			return;
		}
		
		if(rsp.frob)
		{
			//document.write(rsp.frob._content);
			//alert("Get Frob Success!");
			//alert(rsp.frob._content);
			var strReturn = "frob:"+rsp.frob._content;
			strFrob = rsp.frob._content;
			
			m_strFrob = strFrob;
			var ref = "Frob:"+m_strFrob;
			location = ref;
			
			var strSrc = m_strSecret+"api_key"+m_strApiKey+"frob"+strFrob+"permsread";
			var strMd5 = MD5(strSrc);
			//alert(strMd5);
			var strRequest = "http://www.flickr.com/services/auth/?api_key="+m_strApiKey+"&perms=read&frob="+strFrob+"&api_sig="+strMd5;

			window.open( strRequest);
			return;
		}
		
		if(rsp.auth)
		{
			if(rsp.auth.token)
			{
				//alert("get token ok");
				//alert(rsp.auth.token._content);
				m_strToken = rsp.auth.token._content;
				var ref = "Token:"+m_strToken;
				location = ref;
				GetContactList(m_nContractPage,m_nPhotosPrePage);
				return;
			}
		}
		
		if(rsp.contacts)
		{
			m_nConstractID = 0;
			//alert("get contacts ok");
			if(!rsp.contacts.contact)
			{
				return;
			}
			ShowContracts(rsp.contacts);
			return;
		}
		
		if(rsp.photos)
		{
			ShowPhotos(rsp.photos);
			return;
		}
		if(rsp.licenses)
		{
			for(var j = 0;i<10;j++)
			{
				m_nLicenseID[j] = -1;
			}	
			for(var i = 0;i<rsp.licenses.license.length;i++)
			{
				strURL = rsp.licenses.license[i].url;
				m_nLicenseName[i] = rsp.licenses.license[i].name; 
				m_nLicenseURL[i] = rsp.licenses.license[i].url;
				m_nLicenseID[i] = rsp.licenses.license[i].id;				
			}
			return;
		}
		
		if(rsp.photoset!=null)
		{
			m_nTotalPageNum = rsp.photoset.pages;
			ShowPhotos(rsp.photoset);
			return;
		}
		
		if(rsp.user)
		{
			m_nUserID = rsp.user.nsid;
			getPersonInfo(rsp.user.nsid);
			return;
		}
		
		if(rsp.photo)
		{
			ShowPhotoInfo(rsp.photo);
			return;
		}
	}
	
	
	</script>
	
	<style type="text/css">
	<!--
	body {
		margin: 0px;
		padding: 0px;
	}
	-->
	</style>
	
	<head>
		<style>
			body {color:white;}
		</style>
	</head>
	
	<body scroll="no" id="bkArea">
		<font face ="Segoe UI">
		<table width="490" height="100%" align="left" VALIGN="top" ID="Table2" border="0">
			<tr>
				<td VALIGN="top">
					<div id="resultArea" style="OVERFLOW-Y: scroll; SCROLLBAR-FACE-COLOR: #e7e7e7; SCROLLBAR-3DLIGHT-COLOR: #e7e7e7">
					</div>
				</td>
			</tr>
		</table>
		<table width="161" height="100%" align="right" ID="Table1" border="0">
			<tr>
				<td VALIGN="middle" height="100" align="center">
					<div id="Info_Area1" style="OVERFLOW-Y: scroll; SCROLLBAR-FACE-COLOR: #e7e7e7; SCROLLBAR-3DLIGHT-COLOR: #e7e7e7">
					</div>
				</td>
			</tr>
			<tr>
				<td VALIGN="middle" height="100" align="center">
					<div id="Info_Area2" style="OVERFLOW-Y: scroll; SCROLLBAR-FACE-COLOR: #e7e7e7; SCROLLBAR-3DLIGHT-COLOR: #e7e7e7">
					</div>
				</td>
			</tr>
		</table>
		</font>
	</body>
</html>