﻿
jQuery(function($) {


    var oldsrc = "";
    function swapmenu(im, postfix, on) {
        if (Image) {

        }

        var name = im.src.substr(0, im.src.lastIndexOf('.'))
        var ext = im.src.substr(im.src.lastIndexOf('.'), im.src.length)
        if (on == 1) {
            if (im.src.lastIndexOf(postfix) > 0) { return; }
            im.src = name + postfix + ext; return;
        }
        if (on == 0 && oldsrc) {
            //if (im.src.lastIndexOf(postfix) < 0) { return; }
            im.src = oldsrc; // name.substr(0, name.lastIndexOf(postfix)) + ext; return;
        }



    }

    $(".menuimg").mouseover(function(event) {
    event.preventDefault();
    oldsrc = this.src;
        swapmenu(this, 'act', 1)
    });
    $(".menuimg").mouseout(function(event) {
        event.preventDefault();
        swapmenu(this, 'act', 0)
    });



});

var newwin = null

function openwindow(url) {
    newwin = window.open(url, "mynewwin",
    "location=1,status=1,scrollbars=1,width=800,height=600, top=200, left=100, resizable=1");
    newwin.focus();
}

function closewindow() {
    if(newwin) {newwin.close(); newwin = null; }
   
}

