
/*有效期日期生成*/
function writeCardExpMM() {
    var cardExpMM = "";
    var mm = "";
    for(var i=1; i<=12; i++) {
        if(i<10) {
            mm = "0"+i;
        }else{
            mm= i;
        }
        cardExpMM += '<a href="###" value="' + mm +'">' + mm + '</a>';
    }
   document.write(cardExpMM);
}

/*有效期年份生成*/
function writeCardExpYY(year) {
    var cardExpYY = "";
    for(var i=0; i<7; i++) {
    	cardExpYY += '<a href="###" value="' + year +'">' + year++ + '</a>';
    }
    document.write(cardExpYY); 
}

$(document).ready( function (){
		  
 /*--------------下拉选择框↓----------------------*/
    //select begins
	var mouseover_tid ;
	var parent1;
	var parent2;

	$(".drop_inpt").click(
			  function(){
			  	  try{pushs();}catch(e){}
				  if(mouseover_tid){
					parent2.hide();	
					parent1.css("z-index","");	
					  }
				  parent1 = $(this).parent().css("z-index","10");							 
				  parent2 = $(this).next().show();	
				  mouseover_tid = setTimeout(function() {
				  parent2.hide();	
				  parent1.css("z-index","");	
								   }, 5000)
			   }
							 );
	$(".drop_btn").click(
		  function(){
			  if(mouseover_tid){
				parent2.hide();	
				parent1.css("z-index","");	
				  }			  
			  parent1 = $(this).parent().parent().css("z-index","10");							 
			  parent2 = $(this).parent().next().show();	
			  mouseover_tid = setTimeout(function() {
			  parent2.hide();	
			  parent1.css("z-index","");	
							   }, 5000)
		   }
						 );						 	 
						 
	  $(".drop_list").hover(
	       
		  function(){		            
					clearTimeout(mouseover_tid);
					mouseover_tid = null;
									  },
		  function(){	
			  $(this).hide();	
			  parent1.css("z-index","");
									  });
									  
	//点击下拉列表内容select文本框显示其内容
    $(".drop_list a").click(function(){
	     $(this).parent().parent().find(".drop_box span").text($(this).text());
	     $(this).parent().parent().find("input").attr("value", $(this).attr("value"));
	     $(this).parent().hide();
	 });
	 
 
	 
  //select end	  
 /*----------------------------------------------*/			
});