var Imovenum = 0;
var AccoCache = new Array();
function AccoInit(str) {
   accomax = str.match(/[;]/g).length;
   for (var i = 0; i < accomax; i++) {
      pos = str.indexOf(";");
      AccoCache.push(str.substring(0, pos));
      str = str.substring(pos + 1, str.length);
      }
   }
//弹出式菜单
function accopush(accobjnum,obj) {	
	newObj_id = jQuery(obj).attr("id");	
	jQuery("#menu_title li").each(function(){
										   	jQuery(this).removeAttr("class");
											jQuery(this).addClass('nothis');
										   });
   for (var i = 0; i < AccoCache.length; i++) {
		var p= posi(obj);
		var thisObj = jQuery("#"+AccoCache[i]).get(0);
		var thisjQuery = jQuery("#"+AccoCache[i]);
		
		if(!document.all){
			thisObj.style.top=p.t+p.h-23+"px";
			thisObj.style.left=p.l+145+"px";
		}else{
			thisObj.style.top=p.t+p.h-23+"px";
			thisObj.style.left=p.l+145+"px";
		}
			
		if (i != accobjnum) {	
			
			jQuery("#"+AccoCache[i]).hide("fast");
		 }
		else {		
			jQuery("#"+AccoCache[i]).slideToggle("fast",function(){
																if(jQuery(this).css('display') == 'block'){																
																	jQuery(obj).removeAttr('class');	
																	jQuery(obj).addClass('this');																			
																}else{																
																	jQuery(obj).removeAttr('class');	
																	jQuery(obj).addClass('nothis');
																}
															}
												);
		 }			
      }		
}

var oldObj_id="";
 //抽屉式菜单
function accopush_t(accobjnum,obj) {	
	if(oldObj_id != "" && jQuery(obj).attr("id") != oldObj_id){		
		jQuery("#"+oldObj_id).removeAttr('class');
	}
   for (var i = 0; i < AccoCache.length; i++) {					
		if (i != accobjnum) {			  				  		
			jQuery("#"+AccoCache[i]).hide("fast");
		 }
		else {				  								
			jQuery("#"+AccoCache[i]).slideToggle("fast",function(){
																		 if(jQuery(this).css('display') == 'block'){																
																			jQuery(obj).removeAttr('class');	
																			jQuery(obj).addClass('this');																			
																		}else{																
																			jQuery(obj).removeAttr('class');																				
																		}																
																 });
		 }
      }
	  oldObj_id = jQuery(obj).attr("id");
}

   
   
//定位
function posi(obj){
	var width=obj.offsetWidth;
	var height=obj.offsetHeight;
	var top=0,left=0;
	while(obj.offsetParent){
		top+=obj.offsetTop; 
		left+=obj.offsetLeft; 
		obj=obj.offsetParent;
	}
	return {"w":width,"h":height,"t":top,"l":left}
}
