//tab script
var selectedtablink=""
var tcischecked=false
function handlelink(aobject){
selectedtablink=aobject.href
tcischecked=(document.tabcontrol && document.tabcontrol.tabcheck.checked)? true : false
if (document.getElementById && !tcischecked){
var tabobj=document.getElementById("tablist")
var tabobjlinks=tabobj.getElementsByTagName("A")
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].className=""
aobject.className="current"
document.getElementById("tabiframe").src=selectedtablink
return false
}
else
return true
}

/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
//subobj.style.left=xpos+"px"
//subobj.style.top=ypos+"px"
subobj.style.top="300px;"
subobj.style.left="300px;"
return false
}
else
return true
}
function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}


/***********************************************
* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}
function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}
function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}
function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}
function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}
function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}
function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}
document.cookie=window.location.pathname+"="+selectedItem
}
function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate


//******************************************
//Random Quote
//******************************************
//store the quotations in arrays
quotes = new Array(16);
authors = new Array(16);
quotes[0] = " \"Are you mad?\" ";
authors[0] = "Ronald Weasley";
quotes[1] = " \"That's why it's so brilliant, becuase it's so pathetically dim-witted.\" ";
authors[1] = "Fred &amp; George Weasley";
quotes[2] = " \"I want to fix that in my memory forever. Draco Malfoy, the amazing bouncing ferret...\" ";
authors[2] = "Ronald Weasley";
quotes[3] = " \"Lockhart'll sign anything if it stands still long enough.\" ";
authors[3] = "Ronald Weasley";
quotes[4] = " \"Pity you can't attach an extra arm to your broom, Malfoy. Then it could catch the Snitch for you.\" ";
authors[4] = "Harry Potter";
quotes[5] = " \"Brilliant! It's Potions last thing on Friday! Snape won't have the time to poison us all!\" ";
authors[5] = "Harry Potter";
quotes[6] = " \"There's no need to call me sir Professor.\" ";
authors[6] = "Harry Potter";
quotes[7] = " \"By all means continue destroying my possessions. I daresay I have too many.\" ";
authors[7] = "Albus Dumbledore";
quotes[8] = " \"I will only truly have left this school when none here are loyal to me...\" ";
authors[8] = "Albus Dumbledore";
quotes[9] = " \"Nitwit! Blubber! Oddment! Tweak!\" ";
authors[9] = "Albus Dumbledore";
quotes[10] = " \"Or maybe, he's waiting to hear why you two didn't arrive on the school train.\" ";
authors[10] = "Severus Snape";
quotes[11] = " \"Malfoy's got detention! I could sing.\" ";
authors[11] = "Hermione Granger";
quotes[12] = " \"Make way for the heir of Slytherin, seriously evil wizard coming through...\" ";
authors[12] = "Fred &amp; George Weasley";
quotes[13] = " \"I enjoyed the meetings, too. It was like having friends.\" ";
authors[13] = "Luna Lovegood";
quotes[14] = " \"It unscrews the other way, peeves.\" ";
authors[14] = "Minerva McGonagall";
quotes[15] = " \"You need your inner eye tested if you ask me.\" ";
authors[15] = "Ronald Weasley";
quotes[16] = " \"How in the name of Merlin's pants have you managed to get your hands on those Horcrux books?\" ";
authors[16] = "Ron Weasley";
//calculate a random index
index = Math.floor(Math.random() * quotes.length);