﻿$(function(){
    InitTab();    
    InitImage();
	Sheva();
});

function InitShowTab(){
    if($('#hiddenLoadTab').val() == "2"){        
        $('#divSchool').hide();
        $('#tab02 a').addClass('tabmenu_select');
    }else{
        $('#divUniversity').hide();
        $('#tab01 a').addClass('tabmenu_select');
    }
}

function InitImage(){
    $(window).load(function() {
        // weave your magic here.
        var images = $('.pic_team img');
        $.each(images, function() {
            //$(this).removeAttr("width").removeAttr("height");
           // console.log($(this).attr("width") +"###"+ $(this).attr("height"));
            if($(this).width() > $(this).height()){
                $(this).width(99);
            }
            else{
                $(this).height(99 );
            }
        });
        images.show();
        
        InitShowTab();
    });
}

function Sheva() {
	$('table.pic_team2 a.pic_team').hover(
		function() {
			$(this).parents('table.pic_team2').addClass("active");
		},
		function() {
			$(this).parents('table.pic_team2').removeClass("active");
		})	;
}

function InitTab(){
    $('#tab01, #lnkSchool').click(function(){
        $('#divSchool').show();
        $('#divUniversity').hide();
        $('#tab02 a').removeClass("tabmenu_select");
        $('#tab01 a').addClass("tabmenu_select");
        return false;
    });
    $('#tab02, #lnkUniversity').click(function(){
        $('#divSchool').hide();
        $('#divUniversity').show();
        $('#tab01 a').removeClass("tabmenu_select");
        $('#tab02 a').addClass("tabmenu_select");
        return false;    
    });
}
