﻿$(document).ready(function(){
	$('.navSlider .slideHotspots div').hover(function(){
		var category = $(this).attr('class');
		switch(category)
		{
			case "hotEducational":
			$('.navSlider a.slideEducational').stop(true, true).animate({
				top: '-=15',
				left: '-=5'
			}, 500);	
			break;
			
			case "hotIdeas":
			$('.navSlider a.slideIdeas').stop(true, true).animate({
				top: '-=15',
				left: '-=5'
			}, 500);	
			break;
			
			case "hotStudentEvents":
			$('.navSlider a.slideStudentEvents').stop(true, true).animate({
				top: '-=15',
				left: '-=5'
			}, 500);	
			break;
			
			case "hotCulinary":
			$('.navSlider a.slideCulinary').stop(true, true).animate({
				top: '-=15',
				left: '-=5'
			}, 500);	
			break;
			
			default:
			$('.navSlider a.slideEducational').stop(true, true).animate({
				top: '-=15',
				left: '-=5'
			}, 500);
		}
		
		
	}, function(){
		var category = $(this).attr('class');

		switch(category)
		{
			case "hotEducational":
			$('.navSlider a.slideEducational').stop(true, true).animate({
				top: '+=15',
				left: '+=5'
			}, 500);	
			break;
			
			case "hotIdeas":
			$('.navSlider a.slideIdeas').stop(true, true).animate({
				top: '+=15',
				left: '+=5'
			}, 500);	
			break;
			
			case "hotStudentEvents":
			$('.navSlider a.slideStudentEvents').stop(true, true).animate({
				top: '+=15',
				left: '+=5'
			}, 500);	
			break;
			
			case "hotCulinary":
			$('.navSlider a.slideCulinary').stop(true, true).animate({
				top: '+=15',
				left: '+=5'
			}, 500);	
			break;
			
			default:
			$('.navSlider a.slideEducational').stop(true, true).animate({
				top: '+=15',
				left: '+=5'
			}, 500);
		}
	});
  
    $('li.navIdeas').hover(
    function() {
        $(this).children('a').attr('class','on');
        $('.subNavigation').show();
    },
    function() {
        $(this).children('a').attr('class','off');
        $('.subNavigation').hide();
    });
    
    //check ideas subnavigation for active state.
    var queryString = window.location.href;

    function querySt(ji) {
        hu = window.location.search.substring(1);
        gy = hu.split("&");
        for (i=0;i<gy.length;i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
        return ft[1];
        }
        }
     }
     
     var ideaType = querySt("type");
     
    
    switch(ideaType)
    {
        case "design": 
            $(".navDesign").addClass("subNavOn");
        break;
        case "fashion": 
            $(".navFashion").addClass("subNavOn");
        break;
        case "media": 
            $(".navMedia").addClass("subNavOn");
        break;
        
        default: 
            return false;
     
    }
    
    
});

/*********************************************************************************************
Popup window function
*********************************************************************************************/
function NewWindow(url, width, height) {
    var popWin = window.open(url, '_blank', 'width=' + width + ',height=' + height + ',scrollbars=1,resizable=1');
    if (popWin != null) {
        popWin.focus();
    }
}

