var pageW=document.documentElement.clientWidth-(document.documentElement.clientWidth-980);
var pageH=620;/*document.documentElement.clientHeight*/

function page_re(){output('<script>top.location.href=top.location.href</script>')}

function output(str){document.write(str);}

function veil(){output('<div id="veil" style="width:'+pageW+'px; height:auto"></div>')}

function veil_div(idname,tit){output('<div class="veil_div" id="'+idname+'" style="height:auto;"><div class="tit"><div class="titword">'+tit+'</div></div><img onclick="page_re();" class="close" src="\/images\/close.gif" \/></div>');}



/*function write_weil(){getid('veil').innerHTML='<iframe width="'+pageW+'" height="'+pageH+'" frameborder="0" scrolling="no" src="\/veil.html"></iframe>'}*/

function write_inner(idname,src,W,H){getid(idname).innerHTML=getid(idname).innerHTML+'<iframe width="'+W+'" height="'+H+'" frameborder="0" scrolling="no" src="'+src+'"></iframe>'}

function veil_run(){
window.scrollBy(-999,-999);write_inner('veil','/veil.html',pageW,(pageH+1000));getid('veil').style.display='block';
}

function iisInfo(){var pos;
if(screen.width>=1024){pos="right:10px;"}else{pos="left:625px;"}
output('<img onclick="veil_run();write_inner(\'iisInfo\',\'/userManage.asp\',750,(pageH+120));getid(\'iisInfo\').style.display=\'block\';" style="position:absolute;cursor:pointer;'+pos+'top:7px;" src="/images/iisInfo.gif" \/>')
}

function checkCode(){var checkCodes=parseInt(Math.random()*(9999));document.write('<input size="8" type="text" value="" name="checkCode2" /> <input name=checkCode1 type=text readonly value='+checkCodes+' style="border:0; color:#F00; font-weight:bold;" size=5 onmousedown=alert("请输入验证码") />');}

function ptPage(){/*run*/
output(' first '.link(url+'&page=1'))
if(page==1){output(' Prev '.link('javascript:no()'));}
else{output(' Prev '.link(url+'&page='+(page-1)));}
for(var z=0;z<zys;z++){document.write((z+1).toString().link(url+'&page='+(z+1)));}
if(page==zys)
{output(' Next '.link('javascript:no()'));}
else
{output(' Next '.link(url+'&page='+(page+1)));}
output(' last '.link(url+'&page='+zys))
output('　Showing:'+page+' of '+zys+'　')

//output('<select onchange=location.href="'+url+"page="+3+'">')
//for(var i=0;i<zys;i++){output('<option value='+i+'>of'+i+'</option>')}
//output('</select>')
/*close*/}

function no(){alert('No more Page...');}

function getid(value){
value=document.getElementById(value);
return value;
}

function show_flash(flash_url,width,height){
document.write("<script type=text/javascript>AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','"+width+"','height','"+height+"','src','"+flash_url.replace(".swf","")+"','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','"+flash_url.replace(".swf","")+"' );</script><noscript><object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0 width=800 height=575><param name=movie value="+flash_url+" /><param name=quality value=high />  <embed AllowScriptAccess=never src="+flash_url+" quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width="+width+" height="+height+"></embed></object></noscript>")
}

function ajaxFunction(url,divid)
 {
 var xmlHttp;
 
 try
    {
   // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
 catch (e)
    {

  // Internet Explorer
   try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
   catch (e)
      {

      try
         {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         }
      catch (e)
         {
         alert("您的浏览器不支持AJAX！");
         return false;
         }
      }
    }
	
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		var ajaxhtml=xmlHttp.responseText;
		  if(ajaxhtml!="无"){
			if(divid=="无"){output(ajaxhtml);}else{getid(divid).innerHTML=ajaxhtml;}
		  }
         //document.myForm.time.value=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
	
 }


var flag=false; 


function setImgSize(ImgD,w,h){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= w/h){ 
   if(image.width>h){
    ImgD.width=w; 
    ImgD.height=(image.height*h)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   /*ImgD.alt="bigpic" */
} 
else{ 
   if(image.height>h){
    ImgD.height=h; 
    ImgD.width=(image.width*h)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
    /*ImgD.alt="bigpic" */ 
} 
}
}

/*表单文字输入控制*/
function form_ctrl(table,inputlen,limit)
{
if(limit!=0){getid(limit).innerHTML=getid(table).innerHTML.length;}

if(getid(table).value.length>=inputlen){

if(event.keyCode<48&&event.keyCode!=32&&event.keyCode!=13||event.keyCode>111&&event.keyCode<136)
{return true;}
else
{alert('此表单输入内容达到上限，只限'+inputlen+'字以内！');return false;}

}
}/*表单文字输入控制*/


function idexist(id){var s=getid(id);if(s){return true}else{return false}}

function NumToCity(br){
if(br=="br"){br="<br \>"}else{br="→"}
for(i=1;i<30;i++){

if(idexist('city'+i)){
	var ctid=getid('city'+i).innerHTML;
	if(idexist('ct'+ctid)&&ctid!='0')
	{getid('city'+i).innerHTML=getid('ct'+ctid).getAttribute('B')+br+getid('ct'+ctid).innerHTML;
	}
	else if(ctid=='0')
	{getid('city'+i).innerHTML='所有地区'}
	else
	{getid('city'+i).innerHTML=getid('BCT'+ctid).innerHTML;}
}

}
}/*NumToCity*/



function alter(id){
getid('tr'+id).style.color='#F00';
getid('infotit'+id).style.backgroundColor='#FFEEEB'
if(idexist('city'+id)){getid('city'+id).style.backgroundColor='#FFEEEB'}
}
function renew(id){
getid('tr'+id).style.color='';
getid('infotit'+id).style.backgroundColor=''
if(idexist('city'+id)){getid('city'+id).style.backgroundColor=''}
}


function showSmallCity(v){
if(v!=""){
var citySplit=city[v].split("|");
var makeSmallCity="";
	for(i=0;i<citySplit.length;i++)
	{
	makeSmallCity="—"+makeSmallCity+'<option value="'+citySplit[i]+'">'+citySplit[i]+'<\/option>';
	makeSmallCity=makeSmallCity.replace(/—/g,"");
	}
getid('SmallCity').innerHTML='<select name="SmallCity" id="SmallCitys"><option value="">不限地区</option>'+makeSmallCity+'<\/select> ';
}
else
{getid('SmallCity').innerHTML='<select name="SmallCity" id="SmallCitys"><option value="">不限地区</option></select> '}
}


function chkText(chk){
var errInfo="";
if(chk=="login")
	{
if(getid('username').value.length<4){errInfo+='登陆用户名不能少于4字!\n\n';}
if(getid('password').value.length<4){errInfo+='请认真填写密码!\n\n';}
	}
else if(chk=="search")
	{
if(getid('searchSort').value==""){errInfo+='没有选择搜索类别!\n\n';}
if(getid('keyword').value.length<2){errInfo+='搜索关键字最少2个!\n\n';}
	}
else if(chk=="commend")
	{
if(getid('commend_text').value.length<7){errInfo+='评论内容最少7字!\n\n';}
	}
else
	{
if(idexist('trueName')){if(getid('trueName').value.length<2){errInfo+='发布人(您的称呼)必填!\n\n';}}
//if(idexist('tel')){if(getid('tel').value.length<5){errInfo+='电话号码必填!\n\n';}}
//if(idexist('qq')){if(getid('qq').value.length<5){errInfo+='qq号不能少于5个字!\n\n';}}
//if(idexist('email')){if(getid('email').value.length<5){errInfo+='电子邮箱必填!\n\n';}}

if(idexist('tel')==true&&idexist('qq')==true&&idexist('email')==true)
{
if(getid('tel').value.length<5&&getid('qq').value.length<5&&getid('email').value.length<5){errInfo+='联系电话，联系QQ，电子邮箱三种联系方式至少填写其中一种！且必须正确填写！\n\n';}
}
else
{
}

//if(idexist('BIGcity')){if(getid('BIGcity').value==""){errInfo+='一级地区必选!\n\n';}}
//if(idexist('SmallCitys')){if(getid('SmallCitys').value==""){errInfo+='二级地区必选!\n\n';}}
if(idexist('title')){if(getid('title').value.length<5){errInfo+='标题不能少于5个字!\n\n';}}
	}
if(errInfo!=""){alert('发现以下错误：\n\n'+errInfo);return false;}
}

function TextLimit(id,len){
if(getid(id).value.length>len){
alert('评论字数超出限制!最多只能输入'+len+'字!');
getid(id).value=getid(id).value.substr(0,len);
getid('limit').innerHTML=getid(id).value.length+1;
}
}

function externallinks() {    
 if (!document.getElementsByTagName) return;    
 var anchors = document.getElementsByTagName("a");    
 for (var i=0; i<anchors.length; i++) {    
   var anchor = anchors[i];    
   if (anchor.getAttribute("href") &&    
       anchor.getAttribute("rel") == "external")    
     anchor.target = "_blank";    
 }    
}    
window.onload = externallinks;
//if(top.location.href.indexOf('97xinxi.com')<1){top.location.href='http://www.97xinxi.com/';}

function AddToFavorite()   
{   
    if (document.all){   
       window.external.addFavorite(document.URL,document.title);   
    }else if (window.sidebar){   
       window.sidebar.addPanel(document.title, document.URL, "");   
    }   
}   



//-----

