function GId(a){
	return document.getElementById(a);
};
function showad(v){
 var adli=GId('adli');
 var ad=new Array();
 ad[0]='<img src="../images/ad_1.jpg" alt=""/>';
 ad[1]='<img src="../images/ad_2.jpg" alt=""/>';
 ad[2]='<img src="../images/ad_3.jpg" alt=""/>';
 ad[3]='<img src="../images/ad_4.jpg" alt=""/>';
 ad[4]='<img src="../images/ad_5.jpg" alt=""/>';
 ad[5]='<img src="../images/ad_6.jpg" alt=""/>';
 GId('adimg').innerHTML=ad[v];
 //alert(GId('adimg').innerHTML);
 var li	= adli.getElementsByTagName("li");
 for(i=0;i<li.length;i++){li[i].className='over';};
 li[v].className='on'; 
};

function showmsg(a){
	alert(a);
	window.location.href='/';
};
function checkform(){
	var error=true;
	var msg='';
	var bgcolor='#99FFFF';
	var i=0;
	if(GId('a_c1') && GId('a_c2') && GId('a_c3')){
		if(GId('a_c1').value==''||GId('a_c2').value==''||GId('a_c3').value==''){
			i++;
			msg+=i+'.请选择区域!\n';
			GId('a_c1').style.background=bgcolor;
			GId('a_c2').style.background=bgcolor;
			GId('a_c3').style.background=bgcolor;
			error=false;
		};
	};
	if(GId('j_dkt')){
		if(GId('j_dkt').value==''){
			i++;
			msg+=i+'.请选择贷款项目!\n';
			GId('j_dkt').style.background=bgcolor;
			error=false;
		};
	};
	if(GId('j_yt')){
		if(GId('j_yt').value=='' || GId('j_yt').value==0){
			i++;
			msg+=i+'.请选择贷款用途!\n';
			GId('j_yt').style.background=bgcolor;
			error=false;
		};
	};
	if(GId('j_sr')){
		if(GId('j_sr').value==''){
			i++;
			msg+=i+'.请填写个人年收入!\n';
			GId('j_sr').style.background=bgcolor;
			error=false;
		};
	};
	if(GId('j_ae')){
		if(GId('j_ae').value==''){
			i++;
			msg+=i+'.请填写需要贷款的总额度!\n';
			GId('j_ae').style.background=bgcolor;
			error=false;
		};
	};
	if(GId('name')){
		if(GId('name').value=='' || GId('name').value=='某先生/小姐'){
			i++;
			msg+=i+'.请填写贷款人称呼!\n';
			GId('name').style.background=bgcolor;
			error=false;
		};
	};
	if(GId('tel')){
		if(GId('tel').value==''){
			i++;
			msg+=i+'.请填写贷款人联系电话!\n';
			GId('tel').style.background=bgcolor;
			error=false;
		};
	};
	if(GId('l_yx')){
		if(GId('l_yx').value==''){
			i++;
			msg+=i+'.请填写意向投入金额!\n';
			GId('l_yx').style.background=bgcolor;
			error=false;
		};
	};	
	if(msg)alert(msg);
	return error;
};

function trim(text){
	text = text.replace(/^ +/, "");//去除串首空格
	text = text.replace(/ +$/, "");//去除串尾空格
	return text;
};
function checkEmailSpecail(email) {
	var mail = trim(email);
	if (mail == "") return true;
	var myReg = /^[_\-\.a-zA-Z0-9]+@([_\-a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,3}$/;
	if (myReg.test(email) == false) {
		return false;
	}
  return true;
};

function clearNoNum(obj){
	obj.value = obj.value.replace(/[^.\d]/g,"");		//清除“数字”和“.”以外的字符
	obj.value = obj.value.replace(/\.{2,}/g,"");	  //只保留第一个. 清除多余的.
};

function vod(n){
	switch(n){
		case 1:
			window.location.href='/index.php?act=index&job=jk';
		break;
		case 2:
			window.location.href='/index.php?act=index&job=mjk';
		break;
		case 3:
			window.location.href='/index.php?act=index&job=lc';
		break;
	};
}

function showcity(){
	var c1=GId('citys');
	c1.style.display='';	
}
function hidecity(){
	var c1=GId('citys');
	c1.style.display='none';	
}

function close163news(){
	searchspe.style.visibility='hidden';searchspe2.style.visibility='hidden';
};
//取右侧
var specialcode="<DIV id=searchspe style='Z-INDEX:100;right:10px;POSITION:absolute;TOP:160px;border:1px #ccc solid;overflow:hidden;width:50px;'><div style='CURSOR:pointer;background:#f0f0f0;font-size:12px;line-height:24px;height:20px;overflow:hidden;color:#666;text-align:right;padding:0 5px;border-bottom:1px #ccc solid;' onclick='close163news();'>关闭</div><div style='font-size:12px;line-height:20px;padding:5px 0;'><a href='#' target='_blank'><img style='border:0;' src='"+ad[1][1]+"' alt=''/></a></div></DIV>";
document.write(specialcode);
lastScrollX=0;
function heartBeat0(){
	diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollX);
	if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);
	document.all.searchspe.style.pixelTop+=percent;lastScrollX=lastScrollX+percent;
};
window.setInterval("heartBeat0()",1);
//取左侧
var specialcode2="<DIV id=searchspe2 style='Z-INDEX:100;left:10px;POSITION:absolute;TOP:160px;border:1px #ccc solid;overflow:hidden;width:50px;'><div style='CURSOR:pointer;background:#f0f0f0;font-size:12px;line-height:24px;height:20px;overflow:hidden;color:#666;text-align:right;padding:0 5px;border-bottom:1px #ccc solid;' onclick='close163news();'>关闭</div><div style='font-size:12px;line-height:20px;padding:5px 0;'><a href='#' target='_blank'><img style='border:0;' src='"+ad[0][1]+"' alt=''/></a></div></DIV>";
document.write(specialcode2);
lastScrollY=0;
function heartBeat1(){
	diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollY);if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);
	document.all.searchspe2.style.pixelTop+=percent;lastScrollY=lastScrollY+percent;
};
window.setInterval("heartBeat1()",1);
