﻿<!--
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...","2004年9月14日","Protection of Well-known...");
registerProg("pl02","Trademark and Design Management Strategies in Europe","Trademark and Design...","2004年11月12日","Trademark and Design...");
registerProg("pl03","Intellectual Property Professional Services:<br>Business Opportunities in the Pearl River Delta","Intellectual Property Professional...","2004年11月24日","Intellectual Property...");
registerProg("pl04","The Current State of Play in WTO including TRIPs Negotiations","The Current State of Play in...","2004年12月15日,");
registerProg("pl05","Evolution of EC and UK case law : relevance to HKSAR","Evolution of EC and UK...","2005年2月4日","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...","2005年3月30日","How to use...");
registerProg("pl07","Intellectual Property Protection for Technology Transfer in China","Intellectual Property Protection...","2005年4月27日","Intellectual Property...");
registerProg("pl08","Marketing Dietary Supplements / Traditional Medicines Globally: Legal Aspects","Marketing Dietary Supplements...","2005年10月21日","Marketing Dietary...");
registerProg("pl09","Friend or Foe: Section 337 IP Infringement Investigations at the United States International Trade Commission","Friend or Foe: Section 337...","2006年1月18日","Friend or Foe: Section...");
registerProg("pl10","An Update On The Development of EC and UK Case Law on Trademark Protection","An Update On The...","2006年2月24日","An Update On The...");
registerProg("pl11","Making the IP System meet Users' Needs","Making the IP System meet...","2006年3月16日,");
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...","2006年5月12日","Development of Business...");
registerProg("pl13","U.S. Prosecution<br>(in The American Intellectual Property Law Association (AIPLA) Far East Committee Delegation)","U.S. Prosecution","2006年5月12日","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...","2006年5月12日","The Digital Millennium...");
registerProg("pl15","Judicial Enforcement Developments<br>(in The American Intellectual Property Law Association (AIPLA) Far East Committee Delegation)","Judicial Enforcement...","2006年5月12日","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...","2006年5月12日","Understanding United...");
registerProg("pl17","Some Recent Developments in EU and UK Trade Mark Law","Some Recent Developments...","2006年6月23日","Some Recent Developments...");
registerProg("pl18","IPR Enforcement and Global Village","IPR Enforcement...","2007年3月20日,");
registerProg("pl19","2007 : A year of change : An update on procedures and practices in the UK","2007 : A year of...","2007年3月30日","2007 : A year of...");
registerProg("pl20","Intellectual Property in the Obama Years - How It May Affect Hong Kong and China","Intellectual Property in...","2009年3月11日","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 others_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 others_video[_X].htm
    s = s.substring("prog".length);     // skip "others_video" 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
    }
}

//-->
