﻿
function removeHover() {
	$('img.rollover').each(function () {
		$(this).attr("src", $(this).attr("src").split("-over.j").join(".j"));
	});
}

$(window).unload(function () { removeHover(); });

$(document).ready(function () {

    $("a.gallery").fancybox({
        'width': 573,
        'height': 570,
        'autoScale': false,
        'scrolling': 'no'
    });

    $("a.map").fancybox({
        'width': 450,
        'height': 400,
        'autoScale': false
    });

    $("a#video").fancybox({
        'width': 450,
        'height': 400,
        'autoScale': false
    });

    $("a.apple").fancybox({
        'width': 945,
        'height': 435,
        'autoScale': false
    });

    $("a.ipad").fancybox({
        'width': 965,
        'height': 470,
        'autoScale': false
    });

    $("a.question").fancybox({
        'width': 820,
        'height': 510,
        'autoDimensions': false,
        'scrolling': 'no',
        'autoScale': false
    });

    $("body.not-i img.rollover").hover(function () {
        $(this).attr("src", $(this).attr("src").split(".j").join("-over.j"));
        $(this).addClass('over')
    }, function () {
        $(this).attr("src", $(this).attr("src").split("-over.j").join(".j"));
        $(this).removeClass('over')
    });

    $("body.not-i input.rollover").hover(function () {
        $(this).attr("src", $(this).attr("src").split(".j").join("-over.j"));
        $(this).addClass('over')
    }, function () {
        $(this).attr("src", $(this).attr("src").split("-over.j").join(".j"));
        $(this).removeClass('over')
    });

    // Set height for tablet spec
    var $specLeft = $(".spec-left")
    if ($specLeft.length > 0) {
        var $specRight = $(".spec-right");
        if ($specLeft.height() < $specRight.height()) {
            $specLeft.height($specRight.height());
        }
    }


});
