/***********************************************
* AnyLink Drop Down Menu- c Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="/">Top Stories</a>'
menu1[1]='<a href="/taiwan/">Taiwan</a>'
menu1[2]='<a href="/china/">China</a>'
menu1[3]='<a href="/business/">Business</a>'
menu1[4]='<a href="/asia/">Asia</a>'
menu1[5]='<a href="/international/">World</a>'
menu1[6]='<a href="/Sports/">Sports</a>'
menu1[7]='<a href="/life/">Life</a>'
menu1[8]='<a href="/art/">Arts &amp; Leisure</a>'
menu1[9]='<a href="/health/">Health</a>'


//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="/editorial/">Editorial</a>'
menu2[1]='<a href="/commentary/">Commentary</a>'


//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="/travel/">Travel</a>'
menu3[1]='<a href="/movie/">Movies</a>'
menu3[2]='<a href="/art_calendar/Performance/">Art Calendar</a>'
menu3[3]='<a href="/tvguide/">TV Guide</a>'
menu3[4]='<a href="/classifieds/">Classifieds</a>'
menu3[5]='<a href="/bookstore/">Bookstore</a>'
menu3[6]='<a href="/fables/">Chinese Fables</a>'
menu3[7]='<a href="/cp/income-tax/en/">Income Tax Info</a>'
menu3[8]='<a href="/cp/transportation/">Getting Around</a>'
menu3[9]='<a href="/weather/">Weather</a>'


//Contents for menu 4, and so on
var menu4=new Array()
menu4[0]='<a href="http://www.chinapost.com.tw/supplement/2009/08/12/220244/p1/A-Handshake.htm">MBA Studies</a>'
menu4[1]='<a href="/guidepost/">Guide Post</a>'
menu4[2]='<a href="http://www.studentpost.com.tw" target="_blank">Student Post</a>'
menu4[3]='<a href="/cp/clubpost">Courses</a>'


//Contents for menu 5, and so on
var menu5=new Array()
menu5[0]='<a href="/cp/thechinapost/">About China Post</a>'
//menu5[1]='<a href="/subscribe/"><font color="#FF0000">Subscribe</font></a>'
menu5[2]='<a href="/cp/thechinapost/">Career</a>'
menu5[3]='<a href="/cp/advertisement/">Advertise</a>'
menu5[4]='<a href="/cp/advertisement/">Contact Us</a>'

		
var menuwidth='126px' //default menu width
var menubgcolor='white'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all;
var ns6=document.getElementById&&!document.all;

if (ie4||ns6)
document.write('<div id="dropmenudiv1" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu1()" onMouseout="dynamichide1(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide1(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest1(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge1(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest1().scrollLeft+iecompattest1().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest1().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest1().scrollTop+iecompattest1().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu1(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu1()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv1") : dropmenudiv1
populatemenu(menucontents)

if (ie4||ns6){
showhide1(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge1(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge1(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue1()
}

function clickreturnvalue1(){
if (ie4||ns6) return false
else return true
}

function contains_ns61(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide1(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu1()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns61(e.currentTarget, e.relatedTarget))
delayhidemenu1()
}

function hidemenu1(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu1(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu1()",disappeardelay)
}

function clearhidemenu1(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu1


