function highlight(a, b) {

    try {
        var toplinks = $("#navmenu > li > a", window.frames["Header"].document);

        toplinks[a].style.backgroundColor = "#FDE07B";

        var sidelinks = $("#col1 > ul > li >a", window.frames["Sidemenu"].document);

        sidelinks[b].style.backgroundColor = "#FEB32B";
    }
    catch (e) {
        setTimeout(function() {
            highlight(a, b);
        }, 500);
    }
}



function adjustByScreenHeightProportion(height) {
    var defaultHeight = 1024;
    var screenHeight = screen.height;
    return parseInt(height * (screenHeight / defaultHeight));
}

function adjustByScreenWidthProportion(width) {
    var defaultWidth = 1280;
    var screenWidth = screen.width;
    return parseInt(width * (screenWidth / defaultWidth));
}


function openwin(srcurl,width,height) {
  window.open(
    srcurl,
    "newwindow",
    "height=" + height +
    ",width=" + width +
    ",toolbar=no" +
    ",menubar=no" +
    ",scrollbars=yes" +
    ",resizable=no" +
    ",location=no" +
    ",status=no" +
    ",left=" + adjustByScreenWidthProportion(300) +
    ",top=" + adjustByScreenHeightProportion(25) + ""
  )
}

function openwin2() {
    window.open("./NewsEvents/page2.html", "newwindow", "height=" + adjustByScreenHeightProportion(900) + ",width=" + adjustByScreenWidthProportion(660) + ",toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no,left=" + adjustByScreenWidthProportion(300) + ",top=" + adjustByScreenHeightProportion(340) + "")
}

function openwin3() {
    window.open("./NewsEvents/page3.html", "newwindow", "height=" + adjustByScreenHeightProportion(300) + ",width=" + adjustByScreenWidthProportion(660) + ",toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no,left=" + adjustByScreenWidthProportion(300) + ",top=" + adjustByScreenHeightProportion(215) + "")
}

function openwin4() {
    window.open("./NewsEvents/page4.html", "newwindow", "height=" + adjustByScreenHeightProportion(650) + ",width=" + adjustByScreenWidthProportion(660) + ",toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no,left=" + adjustByScreenWidthProportion(300) + ",top=" + adjustByScreenHeightProportion(215) + "")
}

function openwin5() {
    window.open("./NewsEvents/page5.html", "newwindow", "height=" + adjustByScreenHeightProportion(600) + ",width=" + adjustByScreenWidthProportion(660) + ",toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no,left=" + adjustByScreenWidthProportion(300) + ",top=" + adjustByScreenHeightProportion(215) + "")
}

function openwin6() {
    window.open("./NewsEvents/page6.html", "newwindow", "height=" + adjustByScreenHeightProportion(600) + ",width=" + adjustByScreenWidthProportion(660) + ",toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no,left=" + adjustByScreenWidthProportion(300) + ",top=" + adjustByScreenHeightProportion(215) + "")
}

function dispatch() {
	window.location.href="../TheParentingJourneyTrainingInstitute/Overview.html"
}