function modalGo(catEgArticle)
{
    $('#basicModalContent').ready(function()
    {
        $('#basicModalContent').modal();

        $("#basicModalContent").html('<div id="LoadingModal" style="padding:10px; height:30px; background: url(/img/layout/loading.gif) no-repeat;"></div>');
        
       jQuery.ajax(
            {
                url: '/catexample.aspx?id='+ catEgArticle +'&dontformat=true',
                datatype: 'html',
                type: 'GET',
                error: function()
                {
                    alert("AJAX error");
                },
                success: function(result) 
                {
                    $("#basicModalContent").html(result); 


// remove the 'by' from the 'm_a_author' field
	if ($("#m_a_author").text().indexOf('By') != -1)
    {
        $("#m_a_author").text($("#m_a_author").text().substring(3));
    }
    
    // prepend the from, to and subject texts
    $("#m_a_title").prepend('<span id="email_from">From: </span>')
    $("#m_a_abstract").prepend('<span id="email_to">To... </span>')
    $("#m_a_author").prepend('<span id="email_subject">Subject: </span>')
    
    // create an empty div an to create a border bottom for the toolbar pic
    $('<div id="iconsBar"></div>').prependTo($("#messengerArticle"));

// check if the screen width is less than 1500px and adject the modal
if (screen.width < 1100)
{
$("#modalContainer").css("height",  "400px");
$("#m_a_body").css("height",  "185px");
}

                }
            }
        );
    });
}

function scrollToForm()
{       
    $(document).ready(function()
    {  
        $.scrollTo($('#entry_form'), 1500, {onAfter:function(){
            $('#ozConfirmBox').css("display", "inline");
            $('#ozConfirmMsg').fadeIn("slow").css("display", "block");
            }}); 
    });
}

function TrackInt(uname)
{
    try 
    { 
        //alert(uname);
        OCLTracking(true,uname);
    }
    catch (err) {
    }
}

function TrackLiveLogo() 
{
    var uname = "EMAIL_OZ_LIVE";
    TrackInt(uname);
}

function TrackPHLogo()
{
    var uname = "EMAIL_OZ_PH";
    TrackInt(uname);
}

function TrackMail() 
{
    var uname = "EMAIL_OZ_ABOUT_MAIL";
    TrackInt(uname);
}

function TrackWinImg() 
{
    var uname = "EMAIL_OZ_WIN_IMAGE";
    TrackInt(uname);
}

function TrackCat(val) 
{
    var uname = "EMAIL_OZ_CAT_"+val;
    TrackInt(uname);
}

function TrackForm() 
{
    var uname = "EMAIL_OZ_SUBMIT_FORM";
    TrackInt(uname);
}

function TrackEntry(val) 
{
    var uname = "EMAIL_OZ_ENTRY_"+val;
    TrackInt(uname);
}

$(document).ready(function()
{   
    switch (JS_SECTION)
    {
        case('home'):
            $("#cat_hl_89444 *").filter(".orderedItem1").css("color",  "#74d3f7");
            $("#cat_hl_89444 a").bind("mouseover",  function(){ $(this).css("color", "#74d3f7");});
$("#cat_hl_89444 a").not(".orderedItem1").bind("mouseout",  function(){ $(this).css("color", "#FFFFFF");});
            $('#ozWinImgTop').bind("click", function(){window.location.href = '/Win/'; TrackWinImg(); });

$('#ozWinImgBot').bind("click", function(){window.location.href = '/Win/'; TrackWinImg(); });
            break;
        case('about'):
            $("#cat_hl_89444 *").filter(".orderedItem2").css("color",  "#e05b9a");
            $("#cat_hl_89444 a").bind("mouseover",  function(){ $(this).css("color", "#e05b9a");});
$("#cat_hl_89444 a").not(".orderedItem2").bind("mouseout",  function(){ $(this).css("color", "#FFFFFF");});
            break;
        case('howto'):
            $("#entry_form").css("display", "inline");
            $("#cat_hl_89444 *").filter(".orderedItem3").css("color",  "#ff971e");
     $("#cat_hl_89444 a").bind("mouseover",  function(){ $(this).css("color", "#ff971e");});
$("#cat_hl_89444 a").not(".orderedItem3").bind("mouseout",  function(){ $(this).css("color", "#FFFFFF");});

            if ($('#hplEmailAddressToUse').text() !== '')
            {
               // call omniture form submission
               TrackForm();  
               scrollToForm();
            }
            break;
        case('entries'):
            $("#ozBestEntryArticle").show();
            $("#cat_hl_89444 *").filter(".orderedItem4").css("color",  "#6eb551");
$("#cat_hl_89444 a").bind("mouseover",  function(){ $(this).css("color", "#6eb551");});
$("#cat_hl_89444 a").not(".orderedItem4").bind("mouseout",  function(){ $(this).css("color", "#FFFFFF");});

            
            // S: customisation for entries page only

            // remove the 'by' from the 'm_a_author' field
            if ($("#m_a_author").text().indexOf('By') != -1)
            {
                $("#m_a_author").text($("#m_a_author").text().substring(3));
            }

            // prepend the from, to and subject texts
            $("#m_a_title").prepend('<span id="email_from_local">From: </span>')
            $("#m_a_abstract").prepend('<span id="email_to_local">To... </span>')
            $("#m_a_author").prepend('<span id="email_subject_local">Subject: </span>')

            // create an empty div an to create a border bottom for the toolbar pic
            $('<div id="iconsBar_local"></div>').prependTo($("#messengerArticle"));


            // change the ids so it wont conflict with the modal pop up
            $('#messengerArticle').attr({id:"messengerArticle_local"})
            $('#iconsBar').attr({id:"iconsBar_local"})
            $('#m_a_title').attr({id:"m_a_title_local"})
            $('#m_a_abstract').attr({id:"m_a_abstract_local"})
            $('#m_a_byandwhen').attr({id:"m_a_byandwhen_local"})
            $('#m_a_author').attr({id:"m_a_author_local"})
            $('#m_a_body').attr({id:"m_a_body_local"})
            $('#m_a_link_back').attr({id:"m_a_link_back_local"})
            document.title = "Email Australia";
            // E: customisation for entries page only
            
            break;
        case('win'):
            $("#cat_hl_89444 *").filter(".orderedItem5").css("color",  "#c9df1b");
$("#cat_hl_89444 a").bind("mouseover",  function(){ $(this).css("color", "#c9df1b");});
$("#cat_hl_89444 a").not(".orderedItem5").bind("mouseout",  function(){ $(this).css("color", "#FFFFFF");});
          
            break;
        default:
            break;
}

if (document.getElementById("ozBody").clientHeight <= 570){
     $("#ozRightGraphic").hide();
}

$('#ozLiveImg').bind("click", function(){window.open('http://get.live.com/mail/overview'); TrackLiveLogo(); return false; });

$('#ozPowImg').bind("click", function(){window.open('http://www.powerhousemuseum.com/'); TrackPHLogo(); return false; });

$('#ozLiveHorzImg').bind("click", function(){window.open('http://get.live.com/mail/overview'); TrackLiveLogo() ; return false; });

$('#ozPowHorzImg').bind("click", function(){window.open('http://www.powerhousemuseum.com/'); TrackPHLogo(); return false; });

//IE6 hack for displaying nav menu
$('#ozHeaderMenu').css("float", "left");

});





