/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


$(document).ready(function() {
	//bold all http links, "here" links
	$('a[href^="http"],a:contains("here")').css({
		"font-weight":"bold"
	});
	
	//hover navi marker
	$('div.navi:has(a)').hover(
		function(){ $(this).addClass("navi-indicator"); },
		function(){ $(this).removeClass('navi-indicator'); }
	);
	
	//back to top
	$('.backToTop').click(function(){
		$(window).scrollTop(0);	
	});
	
	//add pdf icon on the right
	$('a.pdf-icon').each(function(){
		var buff = $(this).html();
		$(this).html('<div>' + buff + '</div>');
	});
	
	//disable click event
	$('.preventDefault').click(function(e){ e.preventDefault(); });
	
	
	//Courses & Departments: sub navi
	$('.CoursesAndDepartmentSubNavi-container a.subnavi').click(function(){
		//remove highlight
		$('.CoursesAndDepartmentSubNavi-container a.subnavi').removeClass('activeNavigation');
		
		$('.CoursesAndDepartmentBanner-container img.collections').hide();
		//hide content for all contents bound to sub navi
		$('.CoursesAndDepartmentWriteup-container > div').hide();
		
		
		//highlight this subnavi link
		$(this).addClass('activeNavigation');
		//show content bound to this subnavi link
		$($(this).attr('rel')).show(0);
		//alert($('#subcontent-BAHons3DDesignNewPractice').height());
	});	
	
	// css fixed for mobile browser
	var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));  
    if (mobile) {  
        // Start: css fix
		$('.FreezeTop').css({
			//remove freeze top navi
			'position':'inherit'
		});
		
        // End: css fix
    } 
});
