// JavaScript Document
//photo_url_header="http://img.hkheadline.com/headline/instantnews/photos/";
			    var prevID=0;
				var nextID=0;
				
				
                c_p=getQueryVariable("c_p");
                 
				total_row=2;
				colum_per_row=4;
                total_page=Math.ceil(pid.length / (total_row * colum_per_row) );

                //hl_large_photo_popup="";
                if(c_p!="")
                {
                  if( parseInt(c_p)>total_page)
                  {
                    c_p=total_page;
                  }else if( parseInt(c_p)<=0)
                  {
                    c_p=1 ; 
                  }
                }else
                {
                  c_p=1;
                }
				 
				photo_index_start=(c_p-1) * total_row * colum_per_row
				
				//alert("total_page is:"+total_page);
				//alert("photo_index_start is:"+photo_index_start);
			    document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
                document.write(' <tr>');
                document.write('  <td>');
				document.write('   <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">');
                document.write('    <tr>');
                document.write('     <td width="1%"><img src="images/instant_frame_01.gif" width="10" height="15"></td>');
                document.write('     <td width="65%"><img src="images/instant_frame_02.gif" width="674" height="15"></td>');
                document.write('     <td width="34%"><img src="images/instant_frame_03.gif" width="8" height="15"></td>');
                document.write('    </tr>');
                document.write('    <tr>');
                document.write('     <td background="images/instant_frame_05.gif"><img src="images/instant_frame_05.gif" width="10" height="20"></td>');
                document.write('     <td>');
				document.write('      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">');
                document.write('       <tr>');
                document.write('        <td>');
				document.write('         <table width="100%" border="0" cellspacing="0" cellpadding="0">');
                document.write('          <tr>');
                document.write('           <td width="100%" valign="top" bgcolor="#f6f6f6">');
				document.write('            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">');
                document.write('             <tr>');
                document.write('              <td>');
				
				document.write('               <table width="100%" border="0" cellspacing="3" cellpadding="0">');
                document.write('                <tr>');
                document.write('                 <td align="center"><img src="/image/shim.gif" height="5"></td>');
                document.write('                </tr>');
                document.write('                <tr>');
                document.write('                 <td align="center"><span class="headlinetitle">' + hl_title + '</span></td>');
                document.write('                </tr>');
                document.write('                <tr>');
                document.write('                 <td align="center"><img src="/image/shim.gif" height="5"></td>');
                document.write('                </tr>');
				//alert("hl_large_photo_popup is:"+ hl_large_photo_popup );
				if( c_p=="1" )
				{
                  document.write('              <tr>');
                  document.write('               <td align="center"><a href="' + hl_large_photo_popup + '">' + hl_large_photo_image + '</a></td>');
                  document.write('              </tr>');
                  document.write('              <tr>');
                  document.write('               <td align="center"><span class="bodytext1">' + hl_caption + '</span></td>');
                  document.write('              </tr>');
                  document.write('              <tr>');
                  document.write('               <td>');
				  document.write('                <table width="100%" border="0" cellspacing="0" cellpadding="0">');
                  document.write('                 <tr>');
                  document.write('                  <td width="100%" align="right" valign="top"><a href="' + hl_large_photo_popup + '"><img src="images/enlarge.gif" width="66" height="27" border="0"></a></td>');
                  document.write('                 </tr>');
                  document.write('                </table>');
				  document.write('               </td>');
                  document.write('              </tr>');
				}
				
                document.write('               </table>');
				
				
				
                document.write('              </td>');
                document.write('             </tr>');
				
				if( c_p=="1" )
				{
                  document.write('           <tr>');
                  document.write('            <td>');
				  document.write('             <table width="100%" border="0" cellspacing="0" cellpadding="0">');
                  document.write('              <tr>');
                  document.write('               <td bgcolor="#CCCCCC"><img src="images/shim.gif" width="1" height="1"></td>');
                  document.write('              </tr>');
                  document.write('             </table>');
				  document.write('            </td>');
                  document.write('           </tr>');
				}
				
                document.write('             <tr>');
                document.write('              <td align="center">');
				
				
				
				document.write('               <table width="95%" border="0" cellspacing="5" cellpadding="0">');
				//alert("photo_news_id.length is:" + photo_news_id.length );
				for( i=0 ;i<total_row;i++)
				{
				  if (photo_index_start<pid.length)
				  {
                    document.write('            <tr>');
				
				    for( j=0 ;j<colum_per_row;j++)
					{
					  if (photo_index_start<small_photo_image.length)
					  {
                        document.write('         <td width="25%" valign="top" align="center">');
                        document.write('          <table width="84%" border="0" cellspacing="3" cellpadding="0">');
                        document.write('           <tr>');
                        document.write('            <td><a href="javascript:photo_popup_pnews(\'photo__popup.asp?imagepath=' + large_photo_popup[photo_index_start] + '\')"><img src="' + small_photo[photo_index_start] + '" width="150" border="0" class="imgtop"></a></td>');
                        document.write('           </tr>');
                        document.write('           <tr>');
                        document.write('            <td class="news_line02">' + caption[photo_index_start] + '</td>');
                        document.write('           </tr>');
                        document.write('          </table>');
				        document.write('         </td>');
					  }
					  else
					  {	
                        document.write('         <td width="25%" valign="top" align="center">&nbsp;</td>');
					  }
					  photo_index_start=photo_index_start+1;
					}
                    document.write('            </tr>');
				  }
				}
                
				document.write('                <tr>');
                document.write('                 <td colspan="' + colum_per_row +' " align="right">');
                document.write('                  <table width="100%" border="0" cellspacing="3" cellpadding="0">');
                document.write('                   <tr>');
                document.write('                    <td>');
                document.write('                    </td>');
				//alert("pid.length is:" +pid.length);
				if( ( parseInt(pid.length) > (  parseInt(total_row) * parseInt(colum_per_row) ) )  )
				{
				  if( c_p=="1" )
				  {
                    document.write('                <td align="right"><a href="?y='+include_year+'&m='+include_month+'&d='+include_day+'&id='+include_id+'&c_p=2"><img src="/instantnews/images/instant_photo_next.gif"  border="0" ></a>');
                    document.write('                </td>');
				  }else 
				  {
                  document.write('                  <td align="left"><a href="?y='+include_year+'&m='+include_month+'&d='+include_day+'&id='+include_id+'&c_p=1"><img src="/instantnews/images/instant_photo_pre.gif"  border="0" ></a>');
                  document.write('                  </td>');
				  }
				}else
				{
                  document.write('                  <td align="right">');
                  document.write('                  </td>');
                }
				
                document.write('                   </tr>');
                document.write('                  </table>');
                document.write('                 </td>');
                document.write('                </tr>');
                document.write('               </table>');
				
				
				document.write('              </td>');
                document.write('             </tr>');
                document.write('            </table>');
				document.write('           </td>');
                document.write('          </tr>');
                document.write('         </table>');
				document.write('        </td>');
                document.write('       </tr>');
				
				
				document.write('       <tr>');
				document.write('        <td align="right" >');
				document.write('         <table>');
				
				
				
                document.write('         <tr> ');
                document.write('         <td height="10"></td> ');
                document.write('         <td ></td> ');
                document.write('         </tr> ');
                document.write('         <tr> ');
                document.write('         <td height="10"></td> ');
                document.write('         <td style="padding-left: 8px;" align="right"> ');
			    document.write('         <table id="Table_01" width="263" height="21" border="0" cellpadding="0" cellspacing="0">');

				document.write('         <tr>');
				document.write('         	<td>');
				document.write('         		<img src="/dailynews/images/icon1_01.gif" width="4" height="21" alt=""></td>');
				document.write('         	<td>');
				document.write('         		<a href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank"><img src="/dailynews/images/icon1_02.gif" alt="" width="100" height="21" border="0"></a></td>');
				document.write('         	<td>');
				document.write('         		<img src="/dailynews/images/icon1_03.gif" width="14" height="21" alt=""></td>');
				document.write('         	<td>');
				document.write('         		<img src="/dailynews/images/icon1_04.gif" alt="" width="84" height="21" border="0" onClick="javascript: window.open(\'/email_friend.asp?headline=\' + escape(\''+hl_title+'\'), \'email_friend\', \'height=665,width=675,toolbar=no\'); void(0);" style="cursor: pointer;"></td>');

				document.write('         	<td>');
				document.write('         		<img src="/dailynews/images/icon1_05.gif" width="14" height="21" alt=""></td>');
				document.write('         	<td>');
				document.write('         		<img src="/dailynews/images/icon1_06.gif" alt="" width="43" height="21" border="0" onClick="javascript: window.print();" style="cursor: pointer;"></td>');
				document.write('         	<td>');
				document.write('         		<img src="/dailynews/images/icon1_07.gif" width="4" height="21" alt=""></td>');
				document.write('         </tr>');
			    document.write('         </table>');
                document.write('         </td>');

                document.write('         </tr> ');
                document.write('         <tr> ');
                document.write('         <td height="10"></td> ');
                document.write('         <td ></td> ');
                document.write('         </tr> 	');
							   
							   
							   
				document.write('         </table>');
				document.write('        </td>');
				document.write('       </tr>');
				
				
                document.write('       <tr>');
                document.write('        <td>');
                document.write('         <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">');
				
				
				
                document.write('          <tr>');
                document.write('           <td width="30%" align="left">');
                if( previou_id != "" )
				{
                  document.write('          <a href="?y='+previou_year+'&m='+previou_month+'&d='+previou_day+'&id='+previou_id+'"><img src="/image/white_back2.gif" border="0"></a>');
                }
                document.write('           </td>');
                document.write('           <td align="center">');
                document.write('            <p align="center"><a href="#" class="expnewtop"><img src="/image/white_front.gif" border="0" ></a>');
				//document.write('            <a href="javascript:;" onClick="javascript: window.open(\'/email_friend.asp?headline=\' + escape(\'¹Ï¤ù·s»D\'), \'email_friend\', \'height=665,width=675,toolbar=no\'); void(0);" class="expnewtop"><img src="/image/white_mail.gif" border="0"></a>');
				document.write('            </p>    ');                            
                document.write('           </td>');
                document.write('           <td width="25%" align="right">');
                if( next_id != "" )
				{
                  document.write('          <a href="?y='+next_year+'&m='+next_month+'&d='+next_day+'&id='+next_id+'"><img src="/image/white_next2.gif" border="0"></a>');
                }
                document.write('           </td>');
                document.write('          </tr>');
				
				
				
                document.write('         </table>');
                document.write('        </td>');
				
				
				
				
                document.write('       </tr>');
                document.write('      </table>');
				document.write('     </td>');
                document.write('     <td background="images/instant_frame_07.gif"><img src="images/instant_frame_07.gif" width="8" height="20"></td>');
                document.write('    </tr>');
                document.write('    <tr>');
                document.write('     <td><img src="images/instant_frame_08.gif" width="10" height="13"></td>');
                document.write('     <td><img src="images/instant_frame_09.gif" width="674" height="13"></td>');
                document.write('     <td><img src="images/instant_frame_10.gif" width="8" height="13"></td>');
                document.write('    </tr>');
                document.write('   </table>');
				document.write('  </td>');
                document.write(' </tr>');
                document.write('</table>   ');
