function mod_switch(type,id,count)
	{
 	 
	 //var contentList=document.getElementById(type);
 	 var span=[];
	 var list=[];
	 
 
	 for(i=0;i<count;i++){ 		
 		if(i==id){
 		    span[i]=document.getElementById(type+'_tit_'+i);
		    list[i]=document.getElementById(type+'_con_'+i);
 		    span[i].className="current";
		    list[i].style.display="";
 		}
 		else{
 		   span[i]=document.getElementById(type+'_tit_'+i);		 
 		   span[i].className="";
		   list[i]=document.getElementById(type+'_con_'+i);
		   list[i].style.display="none";
 		} 		
 	}	
	
	 
 }

 /*
function showTips(event,content){
	var showMenoy=document.getElementById('tips');
	
		if(event.clientX ||event.clientY){
		    if(document.documentElement.scrollTop){
		        posx=event.clientX+document.documentElement.scrollLeft;
		        posy=event.clientY+document.documentElement.scrollTop;
		        }
		    else{
		        posx=event.clientX+document.body.scrollLeft;
		        posy=event.clientY+document.body.scrollTop;
		        }
		 }	
		 
		showMenoy.innerHTML=content;
		showMenoy.style.display = "block";	
		showMenoy.style.left = posx+"px";
		showMenoy.style.top  = posy+"px";
}
*/
function hiddenTips( tipsId ){
	var showMenoy=document.getElementById( tipsId );
	showMenoy.style.display = "none";
}


function publicSubmit(form_id){
	var thisForm=document.getElementById(form_id);
	var mobileno=thisForm.mobile.value;
	var reg0 = /^(13[0-9])\d{8}$/;
	var reg1 = /^(15[0-35-9])\d{8}$/;
	var reg2 = /^18[6,8,9]\d{8}$/;
    var my = false ;
    if (reg0.test(mobileno))my=true;
    if (reg1.test(mobileno))my=true;
    if (reg2.test(mobileno))my=true; 
	if (!my){        			   
	   	alert('请输入正确的手机号!');
	}else{
		thisForm.submit();
	}
}
var menuTimer =null;
function showTips(obj1,obj2,location){
	 	var btn=document.getElementById(obj1);
	    var obj=document.getElementById(obj2);

		obj.style.display = "block";	
//	    var h=btn.offsetHeight;
//	    var w=btn.offsetWidth;
//	    var x=btn.offsetLeft;
//	    var y=btn.offsetTop;
//	    while(btn=btn.offsetParent){y+=btn.offsetTop;x+=btn.offsetLeft;}
//	    
//	    var hh=obj.offsetHeight;
//	    var ww=obj.offsetWidth;
//	    var xx=obj.offsetLeft;//style.left;
//	    var yy=obj.offsetTop;//style.top;
//	  	
//	    var obj2location=location.toLowerCase();
//	    
//	    var showx,showy;
//	    if(obj2location=="left" || obj2location=="l" || obj2location=="top" || obj2location=="t" || obj2location=="u" || obj2location=="b" || obj2location=="r" || obj2location=="up" || obj2location=="right" || obj2location=="bottom"){
//	        if(obj2location=="left" || obj2location=="l"){showx=x-ww;showy=y;}
//	        if(obj2location=="top" || obj2location=="t" || obj2location=="u"){showx=x;showy=y-hh;}
//	        
//	        if(obj2location=="right" || obj2location=="r"){showx=x+w;showy=y;}
//	        if(obj2location=="bottom" || obj2location=="b"){showx=x;showy=y+h;}
//	    }else{ 
//	        showx=xx;showy=yy;
//	    }
//	    
//	    obj.style.left=showx+"px";
//	    obj.style.top=showy+"px";
//	    clearTimeout(menuTimer);
//	    obj.style.display ="block";
//	
}

/*function showTips(obj1,obj2,location){ 
    var btn=document.getElementById(obj1);
    var obj=document.getElementById(obj2);
    

	obj.style.display = "block";	
    var h=btn.offsetHeight;
    var w=btn.offsetWidth;
    var x=btn.offsetLeft;
    var y=btn.offsetTop;
    
   
   // obj.innerHTML=content;
    
    while(btn=btn.offsetParent){y+=btn.offsetTop;x+=btn.offsetLeft;}
    
    var hh=obj.offsetHeight;
    var ww=obj.offsetWidth;
    var xx=obj.offsetLeft;//style.left;
    var yy=obj.offsetTop;//style.top;
   
    var obj2location=location.toLowerCase();
    
    var showx,showy;

    if(obj2location=="left" || obj2location=="l" || obj2location=="top" || obj2location=="t" || obj2location=="u" || obj2location=="b" || obj2location=="r" || obj2location=="up" || obj2location=="right" || obj2location=="bottom"){
        if(obj2location=="left" || obj2location=="l"){showx=x-ww;showy=y;}
        if(obj2location=="top" || obj2location=="t" || obj2location=="u"){showx=x;showy=y-hh;}
        if(obj2location=="right" || obj2location=="r"){showx=x+w;showy=y;}
        if(obj2location=="bottom" || obj2location=="b"){showx=x;showy=y+h;}
    }else{ 
        showx=xx;showy=yy;
    }
    obj.style.left=showx+"px";
    obj.style.top=showy+"px";
    
    clearTimeout(menuTimer);
    obj.style.display ="block";
    
}*/

/*
//搜索商户
function searchMerchant(){	
	$.ajax({				  
		type: "post",
		url: "index.php?option=com_merchant&task=sortControl",
		data:"merchant_name="+$("#merchant_name").attr("value")+"&merchant_industry_kind="+$("#merchant_industry_kind").attr("value")+"&merchant_district="+$("#merchant_district").attr("value"),
		dataType: "json",
		success: function(result){
			var list=result.list;
			var merchant_str = '';
			for(i=0;i<list.length;i++){
				merchant_str+=
					'<div class="module_searchmerchant_shops_one">'
						+'<div class="module_searchmerchant_shops_one_pic">'
							+'<img src="'+list[i]['merchant_img']+'" alt="'+list[i]['merchant_name']+'" width="110" height="110" title="'+list[i]['merchant_name']+'" />'
						+'</div>'
						+'<h4>'
							+'<a target="_blank" href="http://www.guoli.com/shop/shop.php?merchantcode='+list[i]['merchant_code_wanlong']+'">'+list[i]['merchant_name']+'</a>'
						+'</h4>'
						+'<p>'
							+'<img src="images/0730home_22.png" alt="star" width="16" height="16" />'
							+'<img src="images/0730home_22.png" alt="star" width="16" height="16" />'
							+'<img src="images/0730home_22.png" alt="star" width="16" height="16" />'
							+'<img src="images/0730home_22.png" alt="star" width="16" height="16" />'
							+'<img src="images/0730home_22.png" alt="star" width="16" height="16" />'
						+'</p></div>';
			}		
			
			$("#searchmerchant_shops").html( merchant_str );
		}			
	});
}
*/


