﻿<!--
var prog = new Array();     // program id
var title = new Array();    // full title
var stitle = new Array();   // short title
var date = new Array();     // date of program
var isPPT = new Array();    // is this is a ppt file

function registerProg(p, t, s, d, pptShortTitle) {
    if (pptShortTitle) {         // register the ppt first then, in reverse order, it will be shown later
        var curIdx = prog.length;
        prog[curIdx] = p + "_ppt";
        title[curIdx] = t;
        stitle[curIdx] = pptShortTitle + "(PPT)";
        date[curIdx] = d;
        isPPT[curIdx] = true;
    }
    var curIdx = prog.length;
    prog[curIdx] = p;
    title[curIdx] = t;
    stitle[curIdx] = s;
    date[curIdx] = d;
    isPPT[curIdx] = false;
}

//
// actually register the programs
//
registerProg("pl01", "Protection of Well-known Trademarks in the EU and the USA", "Protection of Well-known...", "14 September 2004", "Protection of Well-known...");
registerProg("pl02", "Trademark and Design Management Strategies in Europe", "Trademark and Design...", "12 November 2004", "Trademark and Design...");
registerProg("pl03", "Intellectual Property Professional Services:<br>Business Opportunities in the Pearl River Delta", "Intellectual Property Professional...", "24 November 2004", "Intellectual Property...");
registerProg("pl04", "The Current State of Play in WTO including TRIPs Negotiations", "The Current State of Play in...", "15 December 2004");
registerProg("pl05", "Evolution of EC and UK case law : relevance to HKSAR", "Evolution of EC and UK...", "4 February 2005", "Evolution of EC and...");
registerProg("pl06", "How to use an Intellectual Asset Management Approach to get the most value from Intellectual Property", "How to use...", "30 March 2005", "How to use...");
registerProg("pl07", "Intellectual Property Protection for Technology Transfer in China", "Intellectual Property Protection...", "27 April 2005", "Intellectual Property...");
registerProg("pl08", "Marketing Dietary Supplements / Traditional Medicines Globally: Legal Aspects", "Marketing Dietary Supplements...", "21 October 2005", "Marketing Dietary...");
registerProg("pl09", "Friend or Foe: Section 337 IP Infringement Investigations at the United States International Trade Commission", "Friend or Foe: Section 337...", "18 January 2006", "Friend or Foe: Section...");
registerProg("pl10", "An Update On The Development of EC and UK Case Law on Trademark Protection", "An Update On The...", "24 February 2006", "An Update On The...");
registerProg("pl11", "Making the IP System meet Users' Needs", "Making the IP System meet...", "16 March 2006");
registerProg("pl12", "Development of Business Method Patents in the United States<br>(in The American Intellectual Property Law Association (AIPLA) Far East Committee Delegation)", "Development of Business...", "12 May 2006", "Development of Business...");
registerProg("pl13", "U.S. Prosecution<br>(in The American Intellectual Property Law Association (AIPLA) Far East Committee Delegation)", "U.S. Prosecution", "12 May 2006", "U.S. Prosecution");
registerProg("pl14", "The Digital Millennium Copyright Act of 1998<br>(in The American Intellectual Property Law Association (AIPLA) Far East Committee Delegation)", "The Digital Millennium...", "12 May 2006", "The Digital Millennium...");
registerProg("pl15", "Judicial Enforcement Developments<br>(in The American Intellectual Property Law Association (AIPLA) Far East Committee Delegation)", "Judicial Enforcement...", "12 May 2006", "Judicial Enforcement...");
registerProg("pl16", "Understanding United States Patent Reform Proposals<br>(in The American Intellectual Property Law Association (AIPLA) Far East Committee Delegation)", "Understanding United States...", "12 May 2006", "Understanding United...");
registerProg("pl17", "Some Recent Developments in EU and UK Trade Mark Law", "Some Recent Developments...", "23 June 2006", "Some Recent Developments...");
registerProg("pl18", "IPR Enforcement and Global Village", "IPR Enforcement...", "20 March 2007");
registerProg("pl19", "2007 : A year of change : An update on procedures and practices in the UK", "2007 : A year of...", "30 March 2007", "2007 : A year of...");
registerProg("pl20", "Intellectual Property in the Obama Years - How It May Affect Hong Kong and China", "Intellectual Property in...", "11 March 2009", "Intellectual Property in...");
// end register

// calculate which one to display according to my page number
var pageView = 3 ;
var lastPage = Math.ceil(prog.length/pageView);

// var p = gup("p");                               // get page number
// if (p=="" || p != parseInt(p) || p<=0) p = 1;
// else if (p>lastPage) p = lastPage;              // someone give a large p

var myLoc = window.location.href;
var idx = myLoc.lastIndexOf("/");
myLoc = myLoc.substring(++idx);

var s = myLoc;
idx = s.indexOf("_cat");
if (idx>0) {                    // a cat file, must be public_lecture_cat[_X].htm
    s = s.substring(idx+4);
    if (s==".htm") p = 1;       // page 1 for root page
    else {                      // it must be _X.htm
        idx = s.indexOf(".");
        s = s.substring(1, idx);
        p = parseInt(s);
        if (isNaN(p)) p = 1;
        else if (p<=0) p = 1;
        else if (p>lastPage) p = lastPage;      // someone give a large p
    }
    // calculate other indexes
    var max = p * pageView;
    var start = prog.length-max+pageView - 1;
    if (p<lastPage) {                               // simple case
        var end = prog.length - max;
        var lastPage = (max==prog.length);
    } else {                                        // last page
        var end = 0;
        var lastPage = true;
    }
} else {                        // a content file, must be prog[_X].htm
    s = s.substring("prog".length);     // skip "prog" part
    if (s==".htm") id = 0;      // default to item 0
    else {                      // it must be _X.htm
        idx = s.indexOf(".");
        s = s.substring(1, idx);
        id = parseInt(s);
        if (isNaN(id)) id = 0;
        else if (id<0) id = 0;
        else if (id>=prog.length) id = prog.length-1;      // someone give a large id
    }
}

//-->
