﻿// JScript 文件

// JavaScript Document



function  LC()
{
	this.Name	= new String("");
	this.Url	= new String(""); 
}

  

function chg_txt( title , Text , lleft )
{
	in_txt = new String(Text);
	
	MM_findObj("moresel").style.display =  "block"     ;
	
	Input_Array = new Array();
	
	
	
	while (in_txt.indexOf("<Name>")!=-1)
	{
	
		in_a = new LC();
		in_a.Name = in_txt.substring( in_txt.indexOf("<Name>")+6,in_txt.indexOf("</Name>") ) ;
		in_a.Url =  "";
		Input_Array.push ( in_a ); 
		
		in_txt = in_txt.substring( in_txt.indexOf("</Name>")+6,in_txt.length ) ;;
		
		
	}
	
	
	out_txt =  "<table width=390 onmouseover='CS_MouseOverFlag=0' onmouseout='CS_MouseOverFlag=2;' border=0 cellspacing=0 cellpadding=0 style='border:black 1px solid' bgcolor=#FFFFFF>\r\n";
	
	out_txt += "<tr><td height=25 colspan=5 class=popuptitle  >&nbsp;&nbsp;"+ title +"</td>";
	out_txt += "<td height=25 colspan=1 class=popuptitle  align=right>";
	out_txt += "<img src='/skins/LK_Pic/Close_Button.jpg' onclick=\"MM_findObj('moresel').style.display ='none'  \"  style=cursor:pointer>&nbsp;&nbsp;</td>";
	
	out_txt += "</tr>\r\n";
	
	td_blank = 0;

    for (loop=0;loop<Input_Array.length;loop++)
	{
		if (loop%6==0)
			out_txt += "<tr>";
			
		out_txt += "<td width=65 class=Fav_TD onmouseover=\"this.style.backgroundColor='#EEEEEE'\" ";
		out_txt += " onmouseout=\"this.style.backgroundColor='#FFFFFF'\"  onclick=\"Ajax_City_Chg('"+Input_Array[loop].Name+"')\"" ;
		out_txt += " style='border-bottom:gray 1px solid;border-right:gray 1px solid;cursor:pointer' >";
		out_txt += "<a >"+ Input_Array[loop].Name +"</a></td> ";	 
		
		td_blank = loop % 6	;
			
		if ( td_blank==5 )
			out_txt += "</tr>";
	
	}  
  
   
 // CS_MouseOverFlag = 2;
 
  	out_txt += " </table>\r\n";

	MM_findObj("moresel").innerHTML = out_txt;

}

function   getTop(e)
{   
  var   t=e.offsetTop   
  while(e=e.offsetParent)t+=e.offsetTop;   
  return   t;   
}
function   getLeft(e)
{   
  var   t=e.offsetLeft   
  while(e=e.offsetParent)t+=e.offsetLeft;   
  return   t;   
}


function MouseDown()
{
	 
	 
	if ( CS_MouseOverFlag==2 )
	{   
		 
		MM_findObj("moresel").style.display =  "none"     ;
	}
	 
	 
	 
	
} 

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

 var flag=false;
 

function DrawImage3(ImgD){
 
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
        if(image.width/image.height>= 1){
                if(image.width>190){ 
                ImgD.width=190;
                ImgD.height=(image.height*190)/image.width;
                }else{
                ImgD.width=190;
                ImgD.height=(image.height*190)/image.width;
                }
        }
       else{
                if(image.height>220){ 
                ImgD.height=220;
                ImgD.width=(image.width*220)/image.height; 
                }else{
                ImgD.height=220;
                ImgD.width=(image.width*220)/image.height;
                  
                }
        }
}
}  


function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 1){
if(image.width>105){ 
ImgD.width=105;
ImgD.height=(image.height*105)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>105){ 
ImgD.height=105;
ImgD.width=(image.width*105)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
}  
function DrawImage22(ImgD){
 
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
        if(image.width/image.height>= 1){
                if(image.width>160){ 
      
                ImgD.width=105;
                ImgD.height=(image.height*160)/image.width;
                }else{
                    
                ImgD.width=image.width; 
                ImgD.height=image.height;
                }
        }
       else{
                if(image.height>160){ 
                ImgD.height=160;
                ImgD.width=(image.width*160)/image.height; 
                }else{
                  ImgD.width=image.width; 
                  ImgD.height=image.height;
                }
        }
}
}  

function DrawImage2(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 1){
if(image.width>105){ 
ImgD.width=105;
ImgD.height=(image.height*105)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>105){ 
ImgD.height=105;
ImgD.width=(image.width*105)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
} 

 