var title;
var activeSub;

function popVideo(url,w,h) {
	var ww, hh;
	if(!w)w=336;
	if(!h)h=275;
	ww = w + 16;
	hh = h + 10;
	window.open('video.html?mov='+url+'&w='+w+'&h='+h,url,"scrollbars=no,status=no,width="+ww+",height="+hh+",resizable=no");
}

$(document).ready(function() {
	$('div.content>div').hide();
	
	title = document.title;	
	
	$('div.sub>a').click(function(){if(activeSub!=this){
		if(activeSub)$(activeSub).removeClass('sel');
		$(this).removeClass('over').addClass('sel');
		activeSub = this;
		document.title = "Company - " + $(this).html();
		$('div.content>div').hide();
		$('div.content>div#'+$(this).attr('href').substr(1)).show();
		$('div.content').scrollTo(0);
	}}).mouseover(function(){if(activeSub!=this){
		$(this).addClass('over');
	}}).mouseout(function(){if(activeSub!=this){
		$(this).removeClass('over');
	}});

 	var str=window.location.href;
	str = str.substring(str.lastIndexOf("/")+1);
	arr = str.split("#");
	$("a[@href="+str+"]").addClass("menu_title").css('color','#666666').attr('href','#');
	$("li>a[@href!=#]").mouseover(function(){$(this).css('color','#666666');}).mouseout(function(){$(this).css('color','');});
	
	if(arr.length>1)$('div.sub>a[href=#'+arr[1]+']').click();
	else $('div.sub>a:eq(0)').click();

});