//Style Sheet Switcher version 1.1 Oct 10th, 2006
//Author: Dynamic Drive: http://www.dynamicdrive.com
//Usage terms: http://www.dynamicdrive.com/notice.htm

var manual_or_random="manual" //"manual" or "random"
var randomsetting="3 days" //"eachtime", "sessiononly", or "x days (replace x with desired integer)". Only applicable if mode is random.

//////No need to edit beyond here//////////////

function getCookie(Name) { 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return null
}

function setCookie(name, value, days) {
var expireDate = new Date()
//set "expstring" to either future or past date, to set or delete cookie, respectively
var expstring=(typeof days!="undefined")? expireDate.setDate(expireDate.getDate()+parseInt(days)) : expireDate.setDate(expireDate.getDate()-5)
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}

function deleteCookie(name){
setCookie(name, "moot")
}


function setStylesheet(title, randomize){ //Main stylesheet switcher function. Second parameter if defined causes a random alternate stylesheet (including none) to be enabled
var i, cacheobj, altsheets=[""]
for(i=0; (cacheobj=document.getElementsByTagName("link")[i]); i++) {
if(cacheobj.getAttribute("rel").toLowerCase()=="alternate stylesheet" && cacheobj.getAttribute("title")) { //if this is an alternate stylesheet with title
cacheobj.disabled = true
altsheets.push(cacheobj) //store reference to alt stylesheets inside array
if(cacheobj.getAttribute("title") == title) //enable alternate stylesheet with title that matches parameter
cacheobj.disabled = false //enable chosen style sheet
}
}
if (typeof randomize!="undefined"){ //if second paramter is defined, randomly enable an alt style sheet (includes non)
var randomnumber=Math.floor(Math.random()*altsheets.length)
altsheets[randomnumber].disabled=false
}
return (typeof randomize!="undefined" && altsheets[randomnumber]!="")? altsheets[randomnumber].getAttribute("title") : "" //if in "random" mode, return "title" of randomly enabled alt stylesheet
}

function chooseStyle(styletitle, days){ //Interface function to switch style sheets plus save "title" attr of selected stylesheet to cookie
if (document.getElementById){
setStylesheet(styletitle)
setCookie("mysheet", styletitle, days)
}
}

function indicateSelected(element){ //Optional function that shows which style sheet is currently selected within group of radio buttons or select menu
if (selectedtitle!=null && (element.type==undefined || element.type=="select-one")){ //if element is a radio button or select menu
var element=(element.type=="select-one") ? element.options : element
for (var i=0; i<element.length; i++){
if (element[i].value==selectedtitle){ //if match found between form element value and cookie value
if (element[i].tagName=="OPTION") //if this is a select menu
element[i].selected=true
else //else if it's a radio button
element[i].checked=true
break
}
}
}
}

if (manual_or_random=="manual"){ //IF MANUAL MODE
var selectedtitle=getCookie("mysheet")
if (document.getElementById && selectedtitle!=null) //load user chosen style sheet from cookie if there is one stored
setStylesheet(selectedtitle)
}
else if (manual_or_random=="random"){ //IF AUTO RANDOM MODE
if (randomsetting=="eachtime")
setStylesheet("", "random")
else if (randomsetting=="sessiononly"){ //if "sessiononly" setting
if (getCookie("mysheet_s")==null) //if "mysheet_s" session cookie is empty
document.cookie="mysheet_s="+setStylesheet("", "random")+"; path=/" //activate random alt stylesheet while remembering its "title" value
else
setStylesheet(getCookie("mysheet_s")) //just activate random alt stylesheet stored in cookie
}
else if (randomsetting.search(/^[1-9]+ days/i)!=-1){ //if "x days" setting
if (getCookie("mysheet_r")==null || parseInt(getCookie("mysheet_r_days"))!=parseInt(randomsetting)){ //if "mysheet_r" cookie is empty or admin has changed number of days to persist in "x days" variable
setCookie("mysheet_r", setStylesheet("", "random"), parseInt(randomsetting)) //activate random alt stylesheet while remembering its "title" value
setCookie("mysheet_r_days", randomsetting, parseInt(randomsetting)) //Also remember the number of days to persist per the "x days" variable
}
else
setStylesheet(getCookie("mysheet_r")) //just activate random alt stylesheet stored in cookie
} 
}
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
function backToTop() {
    var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;

    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }

    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }

    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;

    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));

    window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));

    if (x > 0 || y > 0) {
        window.setTimeout("backToTop()", 25);
    }
}
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


	// The Array Function 

	function makeArray(len) {
	    for (var i = 0; i < len; i++) this[i] = null;
	this.length = len;
	}

	// This is where the array of text/images/sounds is created.

	ideas = new makeArray(205);
	ideas[0] = "Samus the lead character in Metroid, is a girl.";
	ideas[1] = "People think that Luigi from Super Mario Bros is gay."
	ideas[2] = "The shortest French word with all five vowels is oiseau meaning bird. "
	ideas[3] = "Traffic lights were used before the advent of the motorcar."
	ideas[4] = "I KNOW WHAT YOU DID LAST SUMMER!"
	ideas[5] = "The microwave was invented after a researcher walked by a radar tube and a chocolate bar melted in his pocket."
	ideas[6] = "The Nintendo Wii won't work if left in sun light too long."
	ideas[7] = "Sound travels through water 3 times faster than through air."
	ideas[8] = "You can't lick your own elbow. And 75% of people who read this try to!"
	ideas[9] = "A bear has 42 teeth."
	ideas[10] = "Two-thirds of the world's eggplants are grown in New Jersey."
	ideas[11] = "Thieves built up the white culture in Australia."
	ideas[12] = "The longest word in the Bible is Maher-shalal-hash-baz: Isaiah 8:1."
	ideas[13] = "Being a Newb doesn't mean that you play bad."
	ideas[14] = "There are about one billion cattle in the world of which 200 million are in India."
	ideas[15] = "When you have to solve a printed maze its a smart thing to start at the end, not at the beginning."
	ideas[16] = "Nintendo themselves was in a way responsible for the creation of the PlayStation, the N64īs worst competitor."
	ideas[18] = "When Nintendo was to distribute the SNES they did it with ships late at night to avoid a gang of mobsters."
	ideas[19] = "Zelda Ocarina of Time breaks new records and outsells Hollywood blockbuster movie A bug's life!"
	ideas[20] = "In 1994, Chicago artist Dwight Kalb sent David Letterman a statue of Madonna, made of 180lb of ham."
	ideas[21] = "The longest line in the Bible is Esther 8:9 - 89 words, 425 letters."
	ideas[22] = "The scales of a crocodile are made of ceratin, the same substance that hooves and fingernails are made of. "
	ideas[23] = "There are more than 150 million sheep in Australia, a nation of 17 million people."
	ideas[24] = "There are 361 points on the human body known as tenketsu."
	ideas[25] = "Don't steal - the government hates competition."
	ideas[26] = "Banging your head against a wall uses 150 calories an hour."
	ideas[27] = "Swans are the only birds with penises."
	ideas[28] = "There is no theory of evolution, just a list of creatures Chuck Norris allows to live."
	ideas[29] = "In Switzerland: It is illegal to flush the toilet after 10 P.M. if you live in an apartment."
	ideas[30] = "The first reference to a handgun was made in an order for iron bullets in 1326."
	ideas[31] = "Chinese gooseberries are actually from New Zealand"
	ideas[32] = "In cuba there is a law that states you have to pick up ANY hickers that you meet along the way"
	ideas[33] = "The first ice-cream soda was sold in 1874 in the US"
	ideas[34] = "During your lifetime, you'll eat about 60,000 pounds of food, that's the weight of about 6 elephants!"
	ideas[35] = "Donkeys kill more people annually than plane crashes."
	ideas[36] = "The first hard drive available for the Apple had a capacity of 5 megabytes."
	ideas[37] = "Napoleon reportedly carried chocolate on all his military campaigns."
	ideas[38] = "The keyboard layout has been created by Christopher Latham Scholes - Thank him for your tendinitis!"
	ideas[39] = "More than a billion transistors are manufactured... every second."
	ideas[40] = "The doors that cover US nuclear silos weigh 748 tons and opens in 19 seconds."
	ideas[41] = "1/4 of the worlds children born, are chineese babies."
	ideas[42] = "Christianity is the world's most widespread religion (1,7 billion Christians)."
	ideas[43] = "Sauron is not the real villain in The Lord of the Rings. He's just a servant of the dark lord Morgoth."
	ideas[44] = "Sails were first used by the Phoenicians around 2000 BC."
	ideas[45] = "That the best thing in this world is referring your friends to Snes Classics!"
	ideas[46] = "New York cabs get about 2000 tickets per month, handed out by about 2000 traffic attendants."
	ideas[47] = "In Daytona Beach, Florida, USA: The molestation of trash cans is banned."
	ideas[48] = "Finnish people invented the sauna."
	ideas[49] = "The South American giant anteater eats more than 30,000 ants a day. "
	ideas[50] = "Teachers are a seperate species apart from human kind."
	ideas[51] = "The people killed most often during bank robberies are the robbers."
	ideas[52] = "The chance of being born on Leap Day is about 684 out of a million, or 1 in 1461."
	ideas[53] = "Some people make a living out of playing computer games. They are called progamers."
	ideas[54] = "In Alaska, USA: It is considered an offense to push a live moose out of a moving airplane. "
	ideas[55] = "You cannot multiply wealth by dividing it."
	ideas[56] = "17 Percent of humans, gorillas, and chimpanzees are left handed."
	ideas[57] = "The dragonfly signifies good luck, courage and manliness in Japan."
	ideas[58] = "The full name of Barbie the doll is Barbara Millicent Roberts."
	ideas[59] = "The Ford Motor Company hit 1000000 cars in 1922."
	ideas[60] = "The Chinese celebrate their birthdays every 10 years."
	ideas[61] = "There are approximately 320,000 icebergs in the world."
	ideas[62] = "A white dwarf is the dense, burned out remains of a star, a stellar corpse."
	ideas[63] = "Spanish Saffraan is the most expensive spice at $2000 per pound."
	ideas[64] = "The banana is a female fruit. The male flowers on a banana tree turn into flowers, but not fruit."	
	ideas[65] = "A peanut isn't a nut it is a legume. A peanut is a member of the pea family."	
	ideas[66] = "The umbrella originated in Mesopotamia in 1400 B.C. It was used for shade."	
	ideas[67] = "It is illegal to hunt whales in Oklahoma. There is a law on the books that says this."	
	ideas[68] = "The United States has the greatest number of collect calls on Fathers day."
	ideas[69] = "The first TV was demonstrated in 1928 and it the screen was 3 inches by 4 inches."	
	ideas[70] = "The vacuum cleaner which could be converted to a hair dryer by attaching a hose to the exhaust."	
	ideas[71] = "Americans drink 1 billion pounds of coffee per year."
	ideas[72] = "In earlier times Eskimos built their homes with sod. Ice was only used for temporary shelters."	
	ideas[73] = "A ten gallon hat holds 3/4 gallons of water or 3 quarts."
	ideas[74] = "By raising your legs slowly and lying on your back, you can't sink in quicksand."	
	ideas[75] = "Donald Duck comics were banned from Finland because he doesn't wear pants."	
	ideas[76] = "Because metal was scarce, the Oscars given out during World War II were made of wood."	
	ideas[77] = "Your stomach has to produce a new layer of mucus every two weeks, otherwise it will digest itself."	
	ideas[78] = "The sloth (a mammal) moves so slowly that green algae can grow undisturbed on its fur!"	
	ideas[79] = "Most lipstick contains fish scales!"	
	ideas[80] = "The longest recorded tapeworm found in the human body was 33 meters in length."	
	ideas[81] = "The oldest known goldfish lived to 41 years of age. Its name was Fred."
    ideas[82] = "A pig's orgasm lasts for 30 minutes."
    ideas[83] = "Humans and dolphins are the only species that have sex for pleasure."
    ideas[84] = "The strongest muscle in the body is the tongue."
    ideas[85] = "A crocodile cannot stick its tongue out."
    ideas[86] = "Polar bears are left handed."
    ideas[87] = "The flea can jump 350 times its body length. It's like a human jumping the length of a football field."
    ideas[88] = "A cockroach will live nine days without it's head, before it starves to death."
    ideas[89] = "Some lions mate over 50 times a day."
    ideas[90] = "Butterflies taste with their feet."
    ideas[91] = "Elephants are the only animals that can't jump."
    ideas[92] = "An ostrich's eye is bigger than it's brain."
	ideas[93] = "Starfish don't have brains."
	ideas[94] = "During the chariot scene in Ben Hur, a small red car can be seen in the distance."
	ideas[95] = "Donald Duck comics were banned from Finland because he doesn't wear pants."
	ideas[96] = "Donald Duck never wore pants but always wore a towel when he came out of the shower!"
	ideas[97] = "Because metal was scarce, the Oscars given out during World War II were made of wood."
	ideas[98] = "The number of possible ways of playing the first four moves per side in a game of chess is 318,979,564,000."
	ideas[99] = "14% of all facts and statisticts are made up and 27% of people know that fact."
	ideas[100] = "Venus is the only planet that rotates clockwise."
	ideas[101] = "Charlie Chaplin once won third prize in a Charlie Chaplin look-alike contest."
	ideas[102] = "The glue on Israeli postage is certified kosher."
	ideas[103] = "The Guinness Book of Records holds the record for being the book most often stolen from public libraries."
	ideas[104] = "In 10 minutes, a hurricane releases more energy than all of the world's nuclear weapons combined."
	ideas[105] = "On average,100 people choke to death on ball-point pens every year."
	ideas[106] = "Thirty-five percent of the people who use personal ads for dating are already married."
	ideas[107] = "Every time you lick a stamp, you're consuming 1/10 of a calorie."
	ideas[108] = "The electric chair was invented by a dentist."
	ideas[109] = "In ancient Egypt, priests plucked EVERY hair from their bodies, including their eyebrows and eyelashes."
	ideas[110] = "Bruce Lee was so fast that they actually had to s-l-o-w film down so you could see his moves."
	ideas[111] = "American Airlines saved $40,000 in 1987 by eliminating one olive from each salad served in first-class."
    ideas[112] = "Americans on the average eat 18 acres of pizza every day.... each"
	ideas[113] = "A Boeing 747s wingspan is longer than the Wright brother's first flight."
	ideas[114] = "You can pick your friends, you can pick your nose, but you cant pick your friends nose."
	ideas[115] = "Babies are born without knee caps. They don't appear until the child reaches 2-6 years of age."
    ideas[116] = "You are most likely to get murdered at Christmas time due to more alcohol being consumed. Merry Christmas."
    ideas[117] = "On a Canadian two dollar bill, the flag flying over the Parliament buildings is an American flag."
    ideas[118] = "Almonds are a member of the peach family."
    ideas[119] = "23% of all photocopier faults worldwide are caused by people sitting on them and photocopying their butts."
    ideas[120] = "In every episode of Seinfeld there is a Superman somewhere."
    ideas[121] = "Wearing headphones for just an hour will increase the bacteria in your ear by 700 times."
    ideas[122] = "More than 50% of the people in the world have never made or received a telephone call."
	ideas[123] = "The average human eats 8 spiders in their lifetime at night."
	ideas[124] = "Males, on average, think about sex every 7 seconds."
	ideas[125] = "Every 5 seconds a computer gets infected with a virus."
	ideas[126] = "13% of Americans actually believe that some parts of the moon are made of cheese."
	ideas[127] = "The world's youngest parents were 8 and 9 and lived in China in 1910."
	ideas[128] = "Fish that live more than 800 meters below the ocean surface don't have eyes."
	ideas[129] = "Grapes explode when you put them in the microwave."
	ideas[130] = "Duelling is legal in Paraguay as long as both parties are registered blood donors."
	ideas[131] = "In England, the Speaker of the House is not allowed to speak."
	ideas[132] = "Peanuts are one of the ingredients of dynamite."
	ideas[133] = "The average human eats 8 spiders in their lifetime at night."	
	ideas[134] = "The average chocolate bar has 8 insects' legs in it."
	ideas[135] = "To testify was based on men in the Roman court swearing to a statement made by swearing on their testicles."
	ideas[136] = "In York, it is perfectly legal to shoot a Scotsman with a bow and arrow (except on Sundays)"
    ideas[137] = "The sentence the quick brown fox jumps over the lazy dog uses every letter in the English language."
	ideas[138] = "An average human loses about 200 head hairs per day."
	ideas[139] = "It's impossible to sneeze with your eyes open?"
	ideas[140] = "In France, a five year old child can buy an alcholic drink in a bar."
	ideas[141] = "The average shelf-life of a latex condom is about two years."
	ideas[142] = "14% of Americans have skinny-dipped with a member of the opposite sex at least once."
	ideas[143] = "Male bats have the highest rate of homosexuality of any mammal."
	ideas[144] = "A man's beard grows fastest when he anticipates sex."
	ideas[145] = "The first couple to be shown in bed together on prime time television were Fred and Wilma Flintstone."
	ideas[146] = "For every 'normal' webpage, there are five porn pages."
	ideas[147] = "Some ribbon worms will eat themselves if they can't find any food."
	ideas[148] = "Cat's urine glows under a blacklight."
	ideas[149] = "A donkey will sink in quicksand but a mule won't."
	ideas[150] = "In the state of Minnesota, citizens may not enter Wisconsin with a chicken on their head."
	ideas[151] = "Polar bear livers are poisonous because they contain too much vitamin C."
	ideas[152] = "Sharks never get sick, they are immune to all known diseases."
	ideas[153] = "A study conducted in Germany appears to show listening to loud rock music causes homosexuality in rats."
	ideas[154] = "The poison-arrow frog has enough poison to kill about 2,200 people !"
	ideas[155] = "In some American states it is illegal to have sex with a dead fish!"
	ideas[156] = "Contray to the phrase sweating like a pig, pigs cant actually sweat."
	ideas[157] = "In Utah, birds have the right of way on all highways."
	ideas[158] = "Human birth control pills work on gorillas."
	ideas[159] = "The groundhog is only accurate in predicting the weather 28 percent of the time."
	ideas[160] = "The human heart creates enough pressure when it pumps out to the body to squirt blood 30 feet."
	ideas[161] = "Bats always turn left when exiting a cave."
	ideas[162] = "A snail can sleep for three years."
	ideas[163] = "It's possible to lead a cow upstairs ... but not downstairs."
	ideas[164] = "More people fear spiders more than they do death."
	ideas[165] = "Right-handed people live, on average, nine years longer than left-handed people."
	ideas[166] = "Your stomach has to produce a new layer of mucus every two weeks or it will digest itself."
	ideas[167] = "A female ferret will die if it goes into heat and cannot find a mate."
	ideas[168] = "If someone places a tiny amount of liquor on a scorpion, it will instantly go mad and sting itself to death."
	ideas[169] = "It is impossible to hum if your nose is plugged."
	ideas[170] = "The opposite sides of a dice cube always add up to seven!"
	ideas[171] = "a cheetah does not roar like a lion - it purrs like a cat (meow)."
	ideas[172] = "The original name for the butterfly was 'flutterby'!"
	ideas[173] = "Lightning strikes about 6,000 times per minute on this planet!"
	ideas[174] = "A chameleon's tongue is twice the length of its body."
	ideas[175] = "A chimpanzee can learn to recognize itself in a mirror, but monkeys can't."	
	ideas[176] = "A rat can last longer without water than a camel can."	
	ideas[177] = "About 10% of the world's population is left-handed."	
	ideas[178] = "A typical bed usually houses over 6 billion dust mites."	
	ideas[179] = "A woodpecker can peck twenty times a second."
	ideas[180] = "A jellyfish is 95 percent water!"
	ideas[181] = "Fingernails grow nearly 4 times faster than toenails!"	
	ideas[182] = "You blink over 10,000,000 times a year!"
	ideas[183] = "Of all the words in the English language, the word ' set '  has the most definitions!"
	ideas[184] = "A giraffe can clean its ears with its 21-inch tongue!"	
	ideas[185] = "More people are killed annually by donkeys than die in air crashes."
	ideas[186] = "Go. Is the shortest complete sentence in the English language"
	ideas[188] = "The vocabulary of the average person consists of 5,000 to 6,000 words."	
	ideas[189] = "No word in the English language rhymes with month."	
	ideas[188] = "The average person laughs about 15 times a day."
	ideas[189] = "The average person walks the equivalent of twice around the world in a lifetime."	
	ideas[190] = "Ants don't sleep."	
	ideas[191] = "The smallest bird in the world is the Hummingbird. It weighs 1oz."	
	ideas[192] = "The bird that can fly the fastest is called a White It can fly up to 95 miles per hour."	
	ideas[193] = "Dolphins sleep with one eye open!"	
	ideas[194] = "It was the Chinese who made the first wheelbarrow?"	
	ideas[195] = "The Sumerians, who lived in the Middle East, invented the wheel in about 3450 BC."	
	ideas[196] = "The major air-polluting industries are iron, steel and, cement."	
	ideas[197] = "Major contributor to Delhi's air pollution are vehicles."	
	ideas[198] = "Marriage is a very expensive way to get your laundry done."	
	ideas[199] = "The trouble with being the best man at a wedding is that you never get to prove it."	
	ideas[200] = "Every year more than 2500 left handed people are killed from using right handed products."	
	ideas[201] = "Death is hereditary."	
	ideas[202] = "The advantage of exercising every day is that you die healthier."	
	ideas[203] = "It's impossible to sneeze with your eyes open."	
	ideas[204] = "12 astronauts have walked on the moon"




	// The random number generator.

	function rand(n) {
	seed = (0x015a4e35 * seed) % 0x7fffffff;
	return (seed >> 16) % n;
	}
        
	var now = new Date()
	var seed = now.getTime() % 0xffffffff



//Chrome Drop Down Menu v2.01- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: November 14th 06- added iframe shim technique

var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: true, //when user clicks on a menu item with a drop down menu, disable menu item's link?
enableswipe: 1, //enable swipe effect? 1 for yes, 0 for no
enableiframeshim: 1, //enable "iframe shim" technique to get drop down menus to correctly appear on top of controls such as form objects in IE5.5/IE6? 1 for yes, 0 for no

//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, swipetimer: undefined, bottomclip:0,

getposOffset:function(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;
},

swipeeffect:function(){
if (this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10) //unclip drop down menu visibility gradually
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
}
else
return
this.swipetimer=setTimeout("cssdropdown.swipeeffect()", 10)
},

showhide:function(obj, e){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (this.enableswipe==1){
if (typeof this.swipetimer!="undefined")
clearTimeout(this.swipetimer)
obj.clip="rect(0 auto 0 0)" //hide menu via clipping
this.bottomclip=0
this.swipeeffect()
}
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null) //hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(e){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
this.positionshim() //call iframe shim function
}
},

positionshim:function(){ //display iframe shim function
if (this.enableiframeshim && typeof this.shimobject!="undefined"){
if (this.dropmenuobj.style.visibility=="visible"){
this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px"
this.shimobject.style.left=this.dropmenuobj.style.left
this.shimobject.style.top=this.dropmenuobj.style.top
}
this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")? "block" : "none"
}
},

hideshim:function(){
if (this.enableiframeshim && typeof this.shimobject!="undefined")
this.shimobject.style.display='none'
},

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

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'; cssdropdown.hideshim()",this.disappeardelay) //hide menu
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

startchrome:function(){
for (var ids=0; ids<arguments.length; ids++){
var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
cssdropdown.dropit(this,event,this.getAttribute("rel"))
}
}
}
}
if (window.createPopup && !window.XmlHttpRequest){ //if IE5.5 to IE6, create iframe for iframe shim technique
document.write('<IFRAME id="iframeshim"  src="" style="display: none; left: 0; top: 0; z-index: 90; position: absolute; filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>')
this.shimobject=document.getElementById("iframeshim") //reference iframe object
}
}

}
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
