/***********************************************
* AnyLink Drop Down Menu- © 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()

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://www.wspa.com/spa/news/state_regional/">State</a>'
menu2[1]='<a href="http://hosted.ap.org/dynamic/fronts/US?SITE=WSPATV&SECTION=US">National</a>'
menu2[2]='<a href="http://hosted.ap.org/dynamic/fronts/INTERNATIONAL?SITE=WSPATV&SECTION=INTERNATIONAL">World</a>'
menu2[3]='<a href="http://www.wspa.com/spa/news/politics/">2008 Election</a>'
menu2[4]='<a href="http://www.mgwashington.com">Washington Bureau</a>'
menu2[5]='<a href="http://www.wspa.com/spa/news/special_reports/">Special Reports</a>'
menu2[6]='<a href="http://hosted.ap.org/dynamic/fronts/BUSINESS?SITE=WSPATV&SECTION=BUSINESS">Business</a>'
menu2[7]='<a href="http://hosted.ap.org/dynamic/files/specials/today-in-history/index.html?SITE=WSPATV&SECTION=HISTORY">Today in History</a>'
menu2[8]='<a href="http://hosted.ap.org/dynamic/files/specials/homepage/index2.html?SITE=WSPATV&SECTION=NATIONAL">Multimedia</a>'
menu2[9]='<a href="http://hosted.ap.org/dynamic/files/specials/interactives/photoweek/flash.html?SITE=WSPATV&SECTION=NATIONAL">Photos</a>'
menu2[9]='<a href="http://www.wspa.com/spa/you_write_it/">You Write It</a>'

//Contents for menu 3
var menu3=new Array()
menu3[0]='<a href="http://www.wspa.com/spa/weather/hurricane_tips/">Hurricane Center</a>'
menu3[1]='<a href="http://www.wspa.com/spa/weather/school_and_business_closings/">School and Business Closings</a>'
menu3[2]='<a href="http://my.textcaster.com/ServePopup.aspx?id=1305">Get Closings Alerts</a>'
menu3[3]='<a href="http://www.wspa.com/spa/weather/severe_weather_alerts/">Severe Weather Alerts</a>'
menu3[4]='<a href="http://www.wspa.com/spa/weather/hurricane_tips/">Severe Weather Tips</a>'
menu3[5]='<a href="http://www.wspa.com/spa/weather/kidcaster/">Kidcaster</a>'


//Contents for menu 4
var menu4=new Array()
menu4[0]='<a href="http://hosted.ap.org/dynamic/fronts/SPORTS?SITE=WSPATV&SECTION=SPORTS">National</a>'
menu4[1]='<a href="http://www.wspa.com/spa/sports/motor_sports/">Auto Racing</a>'
menu4[2]='<a href="http://hosted.ap.org/dynamic/files/specials/interactives/sportsweek_pix/flash.html?SITE=WSPATV&SECTION=SPORTS">Sports Week</a>'
menu4[3]='<a href="http://www.wspa.com/spa/sports/professional/professional_football/">NFL</a>'
menu4[4]='<a href="http://www.wspa.com/spa/sports/professional/professional_baseball/">MLB</a>'
menu4[5]='<a href="http://www.wspa.com/spa/sports/professional/professional_basketball/">NBA</a>'
menu4[6]='<a href="http://www.wspa.com/spa/sports/olympics/">2008 Olympic Games</a>'
menu4[7]='<a href="http://www.wspa.com/spa/sports/high_school_friday_night/">High School Friday Night</a>'
menu4[8]='<a href="http://www.wspa.com/spa/sports/high_school_prep/">High School Sports</a>'
menu4[9]='<a href="http://www.wspa.com/spa/sports/college/clemson/">Clemson</a>'
menu4[10]='<a href="http://www.wspa.com/spa/sports/college/usc/">USC</a>'

//Contents for menu 5
var menu5=new Array()
menu5[0]='<a href="http://www.wspa.com/spa/news/consumer/">Consumer Watch</a>'
menu5[1]='<a href="http://www.wspa.com/spa/news/crime/">Crime Tracker</a>'
menu5[2]='<a href="http://www.wspa.com/spa/news/investigation/">Investigation</a>'
menu5[3]='<a href="http://www.wspa.com/spa/lifestyles/health_med_fit/">Medical Watch</a>'
menu5[4]='<a href="http://www.wspa.com/spa/news/problem_solver/">Problem Solver</a>'
menu5[5]='<a href="http://www.wspa.com/spa/news/state_regional/state_regional_govtpolitics/">Statehouse Watch</a>'
menu5[6]='<a href="http://www.wspa.com/spa/news/local/education/">School Watch</a>'
menu5[7]='<a href="http://www.wspa.com/spa/news/voice_of_the_viewer/">Voice of the Viewer</a>'

//Contents for menu 6
var menu6=new Array()
menu6[0]='<a href="http://www.wspa.com/spa/entertainment/cbs/">CBS Full Episodes</a>'
menu6[1]='<a href="http://www.wspa.com/spa/entertainment/television/">TV Listings</a>'
menu6[2]='<a href="http://movies.mgnetwork.com/index.cfm?SiteID=SPA">Movies</a>'
menu6[3]='<a href="http://www.wspa.com/spa/entertainment/horoscope/">Horoscopes</a>'
menu6[4]='<a href="http://www.wspa.com/spa/entertainment/lottery/">Lottery</a>'
menu6[5]='<a href="http://hosted.ap.org/dynamic/fronts/ENTERTAINMENT?SITE=WSPATV&SECTION=ENTERTAINMENT">Entertainment</a>'
menu6[6]='<a href="http://www.wspa.com/spa/entertainment/video/">Video</a>'
menu6[7]='<a href="http://www.wspa.com/spa/entertainment/question_of_the_day/">Question of the Day</a>'
menu6[8]='<a href="http://www.yourcarolina.tv/">Your Carolina</a>'
menu6[9]='<a href="http://www.wspa.com/spa/entertainment/youre_the_critic/">You\'re the Critic</a>'

//Contents for menu 7
var menu7=new Array()
menu7[0]='<a href="http://ww2.wspa.com/Global/category.asp?C=120076">Health Directory</a>'
menu7[1]='<a href="http://www.wspa.com/spa/social_networking/blogs/">Blogs</a>'
menu7[2]='<a href="http://www.wspa.com/spa/lifestyles/caring_for_the_carolinas/">Caring for the Carolinas</a>'
menu7[3]='<a href="http://eventsearch.mgnetwork.com/index.cfm?fuseaction=home.entresults&siteid=spa">Community Calendar</a>'
menu7[4]='<a href="http://www.wspa.com/spa/lifestyles/faith_values/">Faith and Values</a>'
menu7[5]='<a href="http://www.wspa.com/spa/you_write_it/">You Write It</a>'
menu7[6]='<a href="http://www.wspa.com/spa/classifieds/travel_splash_page/">Travel</a>'
menu7[7]='<a href="http://www.wspa.com/spa/lifestyles/go_green_save_green/">Go Green Save Green</a>'
menu7[8]='<a href="http://www.wspa.com/spa/lifestyles/weddings/ ">Wedding 101</a>'

//Contents for menu 8
var menu8=new Array()
menu8[0]='<a href="http://www.wspa.com/spa/online/#rss">RSS</a>'
menu8[1]='<a href="http://www.wspa.com/spa/special_sections/">Database Center</a>'
menu8[2]='<a href="http://www.wspa.com/spa/online/#email">Email Alerts</a>'
menu8[3]='<a href="http://www.wspa.com/spa/online/#mobile">Text Alerts</a>'
menu8[4]='<a href="http://www.wspa.com/spa/online/news_over_wireless/">Mobile Video</a>'

//Contents for menu 9
var menu9=new Array()
menu9[0]='<a href="http://www.wspa.com/spa/classifieds/auto_splash_page/">Autos</a>'
menu9[1]='<a href="http://ww2.wspa.com/Global/category.asp?C=120076">Health</a>'
menu9[2]='<a href="http://www.wspa.com/spa/classifieds/jobs_splash_page/">Jobs</a>'
menu9[3]='<a href="http://www.wspa.com/spa/classifieds/real_estate_splash_page/">Real Estate</a>'

//Contents for menu 10
var menu10=new Array()
menu10[0]='<a href="http://www.wspa.com/spa/online/site_information/contacts/">Contact Us</a>'
menu10[1]='<a href="http://www.wspa.com/spa/online/site_information/news_team/">News Team Bios</a>'
menu10[2]='<a href="http://www.wspa.com/spa/online/childrens_programming/">Children\'s Programming</a>'
menu10[3]='<a href="http://www.wspa.com/spa/site/terms_and_conditions/">Terms and Conditions</a>'
menu10[4]='<a href="http://jobs.mediageneral.com/jobsearch.asp">Jobs</a>'

var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //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="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(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 showhide(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 iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().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? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().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 dropdownmenu(obj, e, menucontents, menuwidth, class_name){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
dropmenuobj.style.zIndex="6000"
dropmenuobj.setAttribute("class", class_name);
dropmenuobj.setAttribute("className", class_name);
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu