/*----------------------------- JavaScript Document ----------------------------
 [Author]: Jasonhu  
 [Date]: 2008-8-4  
 [Contact]: www.maesinfo.com  
/*------------------------------------------------------------------------------*/
$(document).ready(function(){
	
	//---------------------clear search input---------------------
	$("#inputSearch").focus(function(){
		if($(this).val()=="Key words"){
			$(this).val("");
		}
	}).blur(function(){
		if($(this).val()==''){
			$(this).val("Key words");
		}
	});
	
	//------------------------png tranperrance--------------------
	//$('a.bannMore').pngFix( );
	
	//-----------------------site map------------------------------
	$("#mapBar").click(function(){
		$("#map").slideToggle("slow");
	})
	
	//---------------------swich home content box---------------------
	var slidDiv=$("div[id*='slidList']");
	slidDiv.eq(0).bind("mouseover",function(){
		slidDiv.eq(0).animate({height:"179px"},100);
		slidDiv.eq(1).animate({height:"34px"},100);
	});
	slidDiv.eq(1).bind("mouseover",function(){
		slidDiv.eq(0).animate({height:"64px"},100);
		slidDiv.eq(1).animate({height:"147px"},100);
	});
	slidDiv.eq(2).bind("mouseover",function(){
		slidDiv.eq(2).animate({height:"179px"},100);
		slidDiv.eq(3).animate({height:"34px"},100);
	});
	slidDiv.eq(3).bind("mouseover",function(){
		slidDiv.eq(2).animate({height:"64px"},100);
		slidDiv.eq(3).animate({height:"147px"},100);
	});
	 
	//---------------------change case list on mouse over---------------------
	var tabContainers = $("#caseH>div");
	var btn=$("#caseBox ul li a").not($('.more'));
	btn.mouseover(function(){ 
		tabContainers.hide().filter(this.hash).show();
		btn.removeClass('selected');
		$(this).addClass('selected');
		return false;
		}).filter(':first').mouseover();
	
	//---------------------caontact list -------------------------------	
	var cont =$("#contactBox a");
	var contList=$("#contact>div");
	cont.mouseover(function(){ 
		contList.hide().filter(this.hash).show();
		cont.removeClass('selected');
		$(this).addClass('selected');
		return false;
		}).filter(0).mouseover();

	//----------------------menu bar position -----------------------------
	if($("#location").text().indexOf("About")!=-1){
		$("#menubar").css("left","728px");
	}
	else if($("#location").text().indexOf("News")!=-1){
		$("#menubar").css("left","75px");
	}
	else if($("#location").text().indexOf("Industries")!=-1){
		$("#menubar").css("left","200px");
	}
	else if($("#location").text().indexOf("Solutions")!=-1){
		$("#menubar").css("left","325px");
	}
	else if($("#location").text().indexOf("Services")!=-1){
		$("#menubar").css("left","425px");
	}
	else if($("#location").text().indexOf("Technology")!=-1){
		$("#menubar").css("left","530px");
	}
	else if($("#location").text().indexOf("Career")!=-1){
		$("#menubar").css("left","635px");
	}
	else if($("#location").text().indexOf("Contact")!=-1){
		$("#menubar").css("left","820px");
	}
	else if($("#location").text().indexOf("Case Studies")!=-1){
		$("#menubar").css("display","none");
	}
	else{return true}
	
	
	//--------------------case studies list style----------------------
	var caseList=$(".list_box");
	caseList.hover(function(){ 
			$(this).css("background","#eaeff1");
		},function(){
			$(this).css("background","#fff");
		});

	
})//end
//---------------------function plugs-----------------------------------------

//menu hover style
sfHover = function() {
	var sfEls = document.getElementById("menuBox").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++){
		sfEls[i].onmouseover=function(){
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function(){
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//clear status message on error
function closeErrors(){   
    return true; 
	window.status="";
    }   
window.onerror=closeErrors;