function initBackground()
{
	return;
	/*var _bgBox=$('bgBox');
	if (_bgBox)
	{
		items=_bgBox.getElements("li");
		
		items.each(function(item,i)
		{
			item.addEvent('click',function(event)
			{
				$(document.body).set('class','page'+item.id.substring(1));
				Cookie.write('BackgroundId',item.id.substring(1),{duration:10});
			});
		});
	}
	
	if(Cookie.read('BackgroundId'))
		$(document.body).set('class','page'+Cookie.read('BackgroundId'));
	else
		$(document.body).set('class','page0');*/
}

function initSlideUp(obj,num,boxId,imgId,ement) {
	
	//if(obj == "twtablist"){
	
	 actstr = "mouseover";
	//}else{
	// actstr = "mouseover";
	//}
	
	
	var _conli = $(obj);
	if (_conli && !_conli._inited){
		var normal = num, small  = 28;
		var items = _conli.getElements("li");
		var fx = new Fx.Elements(items, {wait: false, duration: 500, transition: Fx.Transitions.Quad.easeInOut});
			items.each(function(item, i){
				item.getElements('[class=updownTabtn]').addEvent(actstr, function(event){
					var o = {};
					
					if(obj == 'twtablist'){
						
						o[i] = {height: [item.getStyle("height").toInt(), event.target.getParent().getParent().getLast().offsetHeight+28]};
						setTimeout(resetH,500);
						
					}
					else{
						o[i] = {height: [item.getStyle("height").toInt(), normal]};
					}
					
					
					//alert(event.target.parentNode.parentNode.lastChild.offsetHeight);
					items.each(function(other, j) {
						if(i != j) {
							var h = other.getStyle("height").toInt();
							if(h != small) o[j] = {height: [h, small]};
						}
					});				
					fx.start(o);
					if($('con3') !=null){ setTimeout(con3pos,1000); }
				});
				var currentItem=0;
				
				var countItem=item.getElements(ement).length;	
				var scroll = new Fx.Scroll(boxId+i, {wait: false,duration: 500,offset: {'x': 0, 'y': 0},transition: Fx.Transitions.Quad.easeInOut});
				item.getElements('[class=nextTabtn]').addEvent("click",function(event){
			        
					event = new Event(event).stop();
					if(currentItem<countItem-1)
						currentItem++;
					else
						currentItem=0;		
					scroll.toElement(imgId+i+currentItem);
				});	
				item.getElements('[class=tabname]').addEvent("click",function(event){
//					event = new Event(event).stop();
//					if(currentItem>0)
//						currentItem--;
//					else
//						currentItem=0;		
//					scroll.toElement(imgId+i+currentItem);
                    var o = {};
					
					if(obj == 'twtablist'){
						
						o[i] = {height: [item.getStyle("height").toInt(), event.target.getParent().getParent().getLast().offsetHeight+28]};
						setTimeout(resetH,500);
						
					}
					else{
						o[i] = {height: [item.getStyle("height").toInt(), normal]};
					}
					
					
					//alert(event.target.parentNode.parentNode.lastChild.offsetHeight);
					items.each(function(other, j) {
						if(i != j) {
							var h = other.getStyle("height").toInt();
							if(h != small) o[j] = {height: [h, small]};
						}
					});				
					fx.start(o);

				});		
			});
		_conli._inited = true;
	}
}

function afterh(_objbox,_itemId,_currentItem){

if($(_itemId+_currentItem) !=null){
      var tmp = $(_itemId+_currentItem).getStyle('height');
	


 $(_objbox).setStyles({height:cutpx(tmp)});
 if($('con3') !=null){ con3pos(); }
}
}

function cutpx(tmm){
var rel = (Number(tmm.substr(0,tmm.length-2))+40)+"px";
return rel;

}

function setV(){
   if($('conmid') !=null){
	$('conmid').setStyle('visibility','visible');
   }
}



/**//*
    功能：修改 window.setTimeout，使之可以传递参数和对象参数
    使用方法： setTimeout(回调函数,时间,参数1,,参数n)
*/
//var __sto = setTimeout;
//window.setTimeout = function(callback,timeout,param)
//{
//    var args = Array.prototype.slice.call(arguments,2);
//    var _cb = function()
//    {
//        callback.apply(null,args);
//    }
//    
//    __sto(_cb,timeout);
//}

///测试代码


var a = new Object();


function initSlideLeftAndRight(obj,objbox,itemId,prev_btn,next_btn,cnum,showmsg)
{    
 
    if(cnum){
	var currentItem=cnum;
	}else{
		var currentItem =0;
	}
	var countItem=$$(obj).length;
	var scroll = new Fx.Scroll(objbox, {wait: false,duration: 500,offset: {'x': 0, 'y': 0},transition: Fx.Transitions.Quad.easeInOut});
	
	
	//scroll.toElement(itemId+currentItem);
	window.setTimeout(setV,1000);
	if(itemId !=null && currentItem != null){
	    //window.setTimeout(afterh,500,objbox,itemId,currentItem);
	    afterh(objbox,itemId,currentItem);
	} 
	$(prev_btn).addEvent('click', function(event)
    { 
	     
		event = new Event(event).stop();
		if(currentItem>0)
			currentItem--;
		else
			currentItem=countItem-1;
		scroll.toElement(itemId+currentItem);
		 if(showmsg !=null){
		 $(showmsg).innerHTML = $(itemId+currentItem).getFirst().getNext().getElement('.tit0').innerHTML;
		  }
		  
		  $(objbox).setStyles({height: cutpx($(itemId+currentItem).getStyle('height'))});
		  if($('con3') !=null){ con3pos(); }
	});
	
	$(next_btn).addEvent('click', function(event)
    {
		   
		event = new Event(event).stop();	
		if(currentItem<countItem-1)
			currentItem++;
		else
			currentItem=0;
		scroll.toElement(itemId+currentItem);
	    if(showmsg !=null){
		 $(showmsg).innerHTML = $(itemId+currentItem).getFirst().getNext().getElement('.tit0').innerHTML;
		  }
		 
		  $(objbox).setStyles({height: cutpx($(itemId+currentItem).getStyle('height'))});
		 if($('con3') !=null){ con3pos(); }
		
		/*if('wallBox'==objbox)
			$(prev_btn).setStyle('visibility','visible');*/
	});
	
	if('wallBox'==objbox&&countItem<=1)
	{
		$(prev_btn).setStyle('visibility','hidden');
		$(next_btn).setStyle('visibility','hidden');
	}
}

function con3pos(){
	
	 $('con3').setStyles({position:'static'});
	 $('con3').setStyles({position:'relative'});
	}
function inittooltips(cssName){
 var myTips = new Tips($$('.'+cssName), {maxTitleChars: 50,className:'tool-tip',fixed:false,offsets: {x: -30, y: 16}});
}

   
var s1;
s1 = new SWFObject("flash/mediaplayer.swf","mediaplayer","320","261","8");
s1.addParam("allowfullscreen","true");



function hide(obj){
  if(obj.id == "user_txt"){
	      if( obj.value =="") obj.style.backgroundImage = "url(images/username.gif)";
  }else if(obj.id =="pass_txt"){
          if( obj.value =="") obj.style.backgroundImage = "url(images/password.gif)";
  }else if(obj.id =="search_txt"){
          if( obj.value =="") obj.style.backgroundImage = "url(images/search.gif)";
  }else if(obj.id =="name_txt"){
          if( obj.value =="") obj.style.backgroundImage = "url(images/name.gif)";
  }else if(obj.id =="comp_txt"){
          if( obj.value =="") obj.style.backgroundImage = "url(images/company.gif)";
  }else if(obj.id =="phone_txt"){
          if( obj.value =="") obj.style.backgroundImage = "url(images/phone.gif)";
  }else if(obj.id =="email_txt"){
          if( obj.value =="") obj.style.backgroundImage = "url(images/email.gif)";
  }else if(obj.id =="con_txt"){
          if( obj.value =="") obj.value ="HOW CAN WE HELP YOU?";
  }else if(obj.id =="emailAd_txt"){
          if( obj.value =="") obj.style.backgroundImage = "url(images/emailaddress.gif)";
  }
}
function show(obj){
   obj.style.backgroundImage = "none";
   if(obj.id == "con_txt"){
    if(obj.value == "HOW CAN WE HELP YOU?"){
     obj.value ="";
	 }
   }
}


function initrightPadTop(objright,objbigimg,topnum){
   if( $$(objright) !="" && $$(objbigimg) !="" && trim_Version !="MSIE6.0"){
    //$$(objright).each(function(item,index){
        
//        if($$(objbigimg)[index] != null)
//        {
//            item.style.cssText = "padding-top:"+ ($$(objbigimg)[index].offsetTop-topnum)+"px;*padding-top:"+ ($$(objbigimg)[index].offsetTop-topnum)+"px";
//        }
 //   });
       
        var _objright=$$(objright);
        var _objbigimg=$$(objbigimg);

        _objright.each(function(item,index)
        {
                if(_objbigimg[index])
                {
                     var h=_objbigimg[index].offsetTop-topnum;
                     
                     item.style.cssText = "padding-top:"+h +"px;*padding-top:"+ h+"px";
                 }
        }); 
 
	}
	
}
function initblogcon3H(){

var oblogh = document.getElementById('blogh');
var oblogcon = document.getElementById('blhcon');
oblogh.style.cssText = 'height:'+(oblogcon.offsetHeight-250)+'px';
con5pos();
}

function con5pos(){
	
	 $('con5').setStyles({position:'static'});
	 $('con5').setStyles({position:'relative'});
	 
	 
	 $('featers').setStyles({position:'static'});
	 $('featers').setStyles({position:'relative'});
	}


function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
MM_preloadImages('images/sidetab_close2.png','images/stab_11.png','images/stab_22.png','images/stab_33.png','images/stab_44.png','images/stab_55.png','images/nav_22.gif','images/nav_33.gif','images/nav_44.gif','images/nav_55.gif','images/nav_66.gif','images/nav_77.gif','images/lastpost2.png','images/nextpost2.png','images/lastcase2.png','images/nextcase2.png','images/lightbox-btn-prev2.png','images/lightbox-btn-next2.png','images/lastpost2bl.png','images/nextpost2bl.png','images/submit_btn2.png','images/submit_reply2.png','images/live_btn2.png','images/more_btn2.png','images/last_btn2.png','images/next_btn2.png','images/img3bg2.png','images/lightbox-btn-close2.png');




function initWrapbg(){
var qq = $('wrap').getStyle('height').toInt();
//$('wrap2').setStyles({height:qq-1712,top:1418}); 
$('wrap2').style.cssText = "top:1418px;height:"+(qq-1418)+"px!important;height:"+(qq-1439)+"px;";
}



