function PopUp(URL) {
    var winw = 750;
    var winh = 520;
    var winl = (screen.width - winw) / 2;
    var wint = (screen.height - winh) / 2;
    var addprops = ", width=" + winw + ",height=" + winh + ",left=" + winl + ",top=" + wint;
    //alert(addprops);
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1" + addprops + "');");
}


function highlightParent(hideshow, id) {
    if(hideshow == 'show') {
        document.getElementById(id).style.backgroundColor = '#909eb1';
        document.getElementById(id).style.color = '#FFF';
    }
    else if (hideshow == 'hide'){
        document.getElementById(id).style.backgroundColor = '#efebda';
        document.getElementById(id).style.color = '#324465';
    }
}


function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
            if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


//Calls a link from an <option value="url"> value of a <select>
function GoToURL(select) {
    var value = select.options[select.options.selectedIndex].value;
    if (value == "") {
        select.form.reset();
        return;
    }
    else {
        window.location.href = value;
        select.form.reset();
    }
}


Shadowbox.init();

//Track PDF downloads
jQuery(function(){
    jQuery('a').each(function(e){
        href = jQuery(this).attr('href');
        if(href)
            {
            res = href.search(/.pdf/);
            if(res != -1){
                jQuery(this).attr('onclick',"_gaq.push(['_trackPageview', '"+href+"'])");                    
            }
        }
    });
}); 
