function __firefox(){
    HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style);
    window.constructor.prototype.__defineGetter__("event", __window_event);
    Event.prototype.__defineGetter__("srcElement", __event_srcElement);
}
function __element_style(){
    return this.style;
}
function __window_event(){
    return __window_event_constructor();
}
function __event_srcElement(){
    return this.target;
}
function __window_event_constructor(){
    if(document.all){
        return window.event;
    }
    var _caller = __window_event_constructor.caller;
    while(_caller!=null){
        var _argument = _caller.arguments[0];
        if(_argument){
            var _temp = _argument.constructor;
            if(_temp.toString().indexOf("Event")!=-1){
                return _argument;
            }
        }
        _caller = _caller.caller;
    }
    return null;
}
if(window.addEventListener){
    __firefox();
}
/*end firefox*/
 
var mCloseInterVal;

function mClose (){
	
	 //document.execCommand("stop");
	 mCloseInterVal=window.setInterval('doclosediv()',10);

}

function doclosediv(){

		

		var mcloseaddiv=document.getElementById('mcloseaddiv');
		if(mcloseaddiv.clientHeight<60){
			window.clearInterval(mCloseInterVal);
			var mCloseAd_b=document.getElementById('mCloseAd_b');
			var mCloseAd_a=document.getElementById('mCloseAd_a');
			
			mCloseAd_b.style.display='none';
			mCloseAd_a.style.display='block';
			mCloseAd_a.attachEvent('onmouseover',function(){
				mcloseaddiv.style.height=260;
				mCloseAd_a.style.display='none';
				mCloseAd_b.style.display='block';
			});
			mCloseAd_b.attachEvent('onmouseout',function(){
				mcloseaddiv.style.height=50;
				mCloseAd_a.style.display='block';
				mCloseAd_b.style.display='none';
			});
 
			
			return;
		}
		
		mcloseaddiv.style.height=mcloseaddiv.clientHeight-20;
		
		
		
}


 
  function swv(btns,lists,btn,c1,c2){
  	var btnsObj=document.getElementById(btns).children;
  	var listsObj=document.getElementById(lists).children;
 	var j=0;
 
	for (var i=0;i<btnsObj.length;i++){
	
		
		if (i==btn){
			btnsObj[i].className=c1;
			j=i;
		}else{
			btnsObj[i].className=c2;
		}
	
	}
	
	for (var i=0;i<listsObj.length;i++){
		if (i==j){
			listsObj[i].style.display=''
		}else{
			listsObj[i].style.display='none';
		}
	
	}
  
  }
 


 
function showselect(ClickDiv,DataDiv,tInput){

	if('search1div'==ClickDiv.attr('id')){
		$('#selectlistdiv').width(560);
 		$('#mm1').width(576);
 		$('#mm2').width(576);
 		$('#mm3').width(576);
 		$('#mm4').width(576);
		$('#selectlistdiv').width(560);
 
	}else{
		$('#selectlistdiv').width(320);
 		$('#mm1').width(336);
 		$('#mm2').width(336);
 		$('#mm3').width(336);
 		$('#mm4').width(336);
		$('#selectlistdiv').width(320);
	}

	$('#selectlistdiv').html(DataDiv.html());
	 var p = ClickDiv.offset();
	 $('#selectdiv1').css("left",p.left  );
	 $('#selectdiv1').css("top",p.top +ClickDiv.height() + 10 );
	 $('#selectdiv1').show();
	 
	 
	 
	  $('#alertSelect_btn_Default').die("click");
	  
	  $('#alertSelect_btn_Default').live("click", function(){
	  		 $('#selectdiv1').hide();
			tInput.val();
			if('search1div'==ClickDiv.attr('id')){
			ClickDiv.html('--请选择岗位大类--');
			}
			
			if('search2div'==ClickDiv.attr('id')){
					ClickDiv.html('--请选择岗位小类--');
			}
	
			if('search3div'==ClickDiv.attr('id')){
			ClickDiv.html('--请选择区域--');
			}
	
			if('search4div'==ClickDiv.attr('id')){
			ClickDiv.html('--请选择发布时间--');
			}
			
	  
	  });

	  
	 $('#selectlistdiv').die("click");
	 
	 $('#selectlistdiv').live("click", function(){
    	 
			var s=$(event.srcElement);
			if(s.attr('tagName').toLowerCase()=='li'){
				tInput.val(s.attr('values'));
				$('#selectdiv1').hide();
 				ClickDiv.html(s.html());
				 
				if('search1div'==ClickDiv.attr('id')){
						
						$('#search2div').html('--请选择岗位小类--');
						$('#subtrade').val('');
					jQuery.get("/function/jgetsearchposition.asp?positionid=" + s.attr('values'), function(data){
 						$('#data2div').html(data);
 
					});

				}
			}
	 });
	
	 
	 

}
