// formStyle.js, produced by Philip Howard, GamingHeadlines.co.uk
// This JavaScript is open source and freely available to all those who wish to use it.
// A link back to GamingHeadlines.co.uk would be appreciated!

	function toggleCheckbox(cbId,cbKey,ffId)
	{
	if (cbKey==0||cbKey==32){
	var cbFF = document.getElementById(ffId);
	
		var cbFFValue = cbFF.checked;
		
		if(cbId.className.indexOf("checkboxchecked")<0)
			{
				var checkBoxType = cbId.className.replace("checkbox","");
				cbFF.checked=true;cbId.className="checkboxchecked"+checkBoxType;}
			else
			{
				var checkBoxType = cbId.className.replace("checkboxchecked","");
				cbFF.checked=false;cbId.className="checkbox"+checkBoxType;}
	return false;
		}
	}
	
	function InitialiseCheckboxes()
	{
		var inputFields = document.getElementsByTagName("span");
		var checkboxIndex = 0;
		for (var inputIndex=0;inputIndex<inputFields.length;inputIndex++)
			{
				if (inputFields[inputIndex].className=="cbstyled")
					{
						var styleType = "";
						if (inputFields[inputIndex].getAttribute("name")!=null){styleType=inputFields[inputIndex].getAttribute("name");}
						
						var inputCurrent = inputFields[inputIndex].getElementsByTagName("input").item(0);
						if(inputCurrent.getAttribute("type")=="checkbox")
						{
							inputCurrent.className = "inputhidden";
							inputCurrent.setAttribute("id","styledcheckbox"+checkboxIndex);
							
							if(navigator.appName.indexOf("Internet Explorer")>0)
							{
								//Internet Explorer
								var inputHTML = inputFields[inputIndex].innerHTML;
								var styledHTML = "<a"//href=\"#\""
								styledHTML+=" tabindex=\""+inputIndex+"\"";
								//styledHTML+=" name=\""+inputCurrent.getAttribute("name")+"\""
								
								if(inputCurrent.hasAttribute){if(inputCurrent.hasAttribute("title")){styledHTML+=" title=\""+inputCurrent.getAttribute("title")+"\"";}}
								
								if (inputCurrent.checked)
									{styledHTML+=" class=\"checkboxchecked"+styleType+"\""}
									else
									{styledHTML+=" class=\"checkbox"+styleType+"\""}
									
								styledHTML+=" onClick=\"toggleCheckbox(this,'','styledcheckbox"+checkboxIndex+"');return false;\""
								styledHTML+=" onKeyPress=\"return toggleCheckbox(this,event.keyCode,'styledcheckbox"+checkboxIndex+"');\""
								
								styledHTML+="></a>"
								
								inputFields[inputIndex].innerHTML = inputHTML+styledHTML;
								inputFields[inputIndex].className = "checkbox"+styleType;
							}
							else
							{
								var styledCheckbox = document.createElement("a"); 
								styledCheckbox.setAttribute("href","#");
								
								if(inputCurrent.hasAttribute){if(inputCurrent.hasAttribute("title")){styledCheckbox.setAttribute("title",inputCurrent.getAttribute("title"));}}
								
								styledCheckbox.setAttribute("onClick","toggleCheckbox(this,'','styledcheckbox"+checkboxIndex+"');return false;");
								styledCheckbox.setAttribute("onKeyPress","return toggleCheckbox(this,event.keyCode,'styledcheckbox"+checkboxIndex+"');");
								
								if (inputCurrent.checked)
									{styledCheckbox.className="checkboxchecked"+styleType;}
									else
									{styledCheckbox.className="checkbox"+styleType;}
								inputFields[inputIndex].appendChild(styledCheckbox);
							}
							
							checkboxIndex++;
						}
					}
			}	
	}
	
	function toggleRadiobox(rbObj,rbKey,rbGroup,rbId)
	{
	if (rbKey==0||rbKey==32){
	var inputFields = document.getElementsByTagName("a");
		for (var inputIndex=0;inputIndex<inputFields.length;inputIndex++)
			{
				if (inputFields[inputIndex].getAttribute("name")==rbGroup){
					
					if(inputFields[inputIndex].className.indexOf("radioboxchecked")<0)
									{var RadioBoxType = inputFields[inputIndex].className.replace("radiobox","");}
									else
									{var RadioBoxType = inputFields[inputIndex].className.replace("radioboxchecked","");}
									
					inputFields[inputIndex].className="radiobox"+RadioBoxType;
					}
			}
	var inputFields = document.getElementsByTagName("input");
		for (var inputIndex=0;inputIndex<inputFields.length;inputIndex++)
			{
				if (inputFields[inputIndex].getAttribute("name")==rbGroup)
					{
						if (inputFields[inputIndex].getAttribute("id")==rbId)
							{
								if(rbObj.className.indexOf("radioboxchecked")<0)
									{var RadioBoxType = rbObj.className.replace("radiobox","");}
									else
									{var RadioBoxType = rbObj.className.replace("radioboxchecked","");}

								inputFields[inputIndex].checked = true;rbObj.className="radioboxchecked"+RadioBoxType;}
							else
							{inputFields[inputIndex].checked = false;}
					}
			}
	return false;
	}
	}
	
	function InitialiseRadioboxes()
	{
		var inputFields = document.getElementsByTagName("span");
		var radioboxIndex = 0;
		
		for (var inputIndex=0;inputIndex<inputFields.length;inputIndex++)
			{
				if (inputFields[inputIndex].className=="rbstyled")
					{
						var styleType = "";
						if (inputFields[inputIndex].getAttribute("name")!=null){styleType=inputFields[inputIndex].getAttribute("name");}
						
						var inputCurrent = inputFields[inputIndex].getElementsByTagName("input").item(0);
						if(inputCurrent.getAttribute("type")=="radio")
						{
							//inputCurrent.setAttribute("class","inputhidden");
							inputCurrent.className = "inputhidden";
							inputCurrent.setAttribute("id","styledradiobox"+radioboxIndex);
							
							if(navigator.appName.indexOf("Internet Explorer")>0)
							{
								//Internet Explorer
								var inputHTML = inputFields[inputIndex].innerHTML;
								var styledHTML = "<a"//href=\"#\""
								styledHTML+=" tabindex=\"1"+inputIndex+"\"";
								
								styledHTML+=" name=\""+inputCurrent.getAttribute("name")+"\""
								
								if(inputCurrent.hasAttribute){if(inputCurrent.hasAttribute("title")){styledHTML+=" title=\""+inputCurrent.getAttribute("title")+"\"";}}
								
								if (inputCurrent.checked)
									{styledHTML+=" class=\"radioboxchecked"+styleType+"\""}
									else
									{styledHTML+=" class=\"radiobox"+styleType+"\""}
									
								styledHTML+=" onClick=\"toggleRadiobox(this,'','"+inputCurrent.getAttribute("name")+"','styledradiobox"+radioboxIndex+"');return false;\""
								styledHTML+=" onKeyPress=\"return toggleRadiobox(this,event.keyCode,'"+inputCurrent.getAttribute("name")+"','styledradiobox"+radioboxIndex+"');\""
								
								styledHTML+="></a>"
								
								inputFields[inputIndex].innerHTML = inputHTML+styledHTML;
								inputFields[inputIndex].className = "radiobox"+styleType;
							}
							else
							{
								//Firefox, Opera, Netscape
								var styledRadiobox = document.createElement("a"); 
								styledRadiobox.setAttribute("href","#");
								styledRadiobox.setAttribute("name",inputCurrent.getAttribute("name"));
								
								if(inputCurrent.hasAttribute){if(inputCurrent.hasAttribute("title")){styledRadiobox.setAttribute("title",inputCurrent.getAttribute("title"));}}
								
								styledRadiobox.setAttribute("onClick","toggleRadiobox(this,'','"+inputCurrent.getAttribute("name")+"','styledradiobox"+radioboxIndex+"');return false;");
								styledRadiobox.setAttribute("onKeyPress","return toggleRadiobox(this,event.keyCode,'"+inputCurrent.getAttribute("name")+"','styledradiobox"+radioboxIndex+"');");
								
								if (inputCurrent.checked)
									{styledRadiobox.className="radioboxchecked"+styleType;}
									else
									{styledRadiobox.className="radiobox"+styleType;}
								
								inputFields[inputIndex].appendChild(styledRadiobox);
							}
							
							radioboxIndex++;
						}
					}
			}	
	}
	
	function checkImages() {
	  if (document.getElementById) {
		var x = document.getElementById('formStyleTestImage').offsetWidth;
		if (x == '1'||x == '7') {
			document.getElementById('formStyleTestImage').style.display='none';
			return true;
		}else{
			return false;
		}
	  }
	}
	
	function preloadImages()
		{
		img1 = new Image();img1.src = "templates/cs_red/images/CheckboxUnchecked.gif";
		img1 = new Image();img1.src = "templates/cs_red/images/CheckboxChecked.gif";
		
		img2 = new Image();img1.src = "templates/cs_red/images/RadioboxUnchecked.gif";
		img2 = new Image();img1.src = "templates/cs_red/images/RadioboxChecked.gif";
		}
	
	function Initialise()
		{
			if(checkImages()){preloadImages();InitialiseCheckboxes();InitialiseRadioboxes();}
		}
		
	window.onload = Initialise;
	
	//set random to one number past the last fact
	var fact=Math.floor(Math.random()*110);
	art=new Array()
	art[0]="Chuck Norris' tears cure cancer. Too bad he has never cried."
	art[1]="Chuck Norris does not sleep. He waits."
	art[2]="Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs." 
	art[3]="The chief export of Chuck Norris is pain."
	art[4]="Chuck Norris defines love as the reluctance to murder. If you're still alive, it's because Chuck Norris loves you."
	art[5]="Chuck Norris isn't hung like a horse. Horses are hung like Chuck Norris."
	art[6]="If you can see Chuck Norris, he can see you. If you can't see Chuck Norris you may be only seconds away from death." 
	art[7]="Rather than being birthed like a normal child, Chuck Norris instead decided to punch his way out of his mother's womb."
	art[8]="There are no disabled people. Only people who have met Chuck Norris."
	art[9]="Chuck Norris can win a game of Monopoly without owning any property."
	art[10]="There is no theory of evolution, just a list of creatures Chuck Norris allows to live."
	art[11]="In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone has ever gotten."
	art[12]="Chuck Norris invented cancer because he was tired of killing people."
	art[13]="In an average living room there are 1,242 objects Chuck Norris could use to kill you, including the room itself."
	art[14]="Chuck Norris is the only man to ever defeat a brick wall in a game of tennis."
	art[15]="Chuck Norris is the reason why Waldo is hiding." 
	art[16]="When Chuck Norris goes to donate blood, he declines the syringe, and instead requests a hand gun and a bucket."
	art[17]="Chuck Norris has two speeds: walk and kill."
	art[18]="When Chuck Norris jumps into a body of water, he doesn't get wet. The water gets Chuck Norris instead."
	art[19]="Chuck Norris can divide by zero." 
	art[20]="Chuck Norris can set ants on fire with a magnifying glass. At night."
	art[21]="When Chuck Norris runs with scissors, other people get hurt."
	art[22]="Chuck Norris recently had the idea to sell his urine as a beverage. We know this drink as Red Bull."
	art[23]="A Handicap parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there."
	art[24]="When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris."
    art[25]="Chuck Norris doesn't read books. He stares them down until he gets the information he wants."
    art[26]="Outer space exists because it's afraid to be on the same planet with Chuck Norris."
    art[27]="Chuck Norris is the reason why Waldo is hiding."
    art[28]="Chuck Norris counted to infinity - twice."
    art[29]="There is no chin behind Chuck Norris’ beard. There is only another fist."
    art[30]="When Chuck Norris does a pushup, he isn’t lifting himself up, he’s pushing the Earth down."
    art[31]="Chuck Norris is so fast, he can run around the world and punch himself in the back of the head."
    art[32]="Chuck Norris’ hand is the only hand that can beat a Royal Flush."
    art[33]="There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up."
    art[34]="Chuck Norris can lead a horse to water AND make it drink."
    art[35]="Chuck Norris doesn’t wear a watch, HE decides what time it is."
    art[36]="Chuck Norris gave Mona Lisa that smile."
    art[37]="Chuck Norris can slam a revolving door."
    art[38]="Chuck Norris does not get frostbite. Chuck Norris bites frost."
    art[39]="Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV."
    art[40]="Contrary to popular belief, America is not a democracy, it is a Chucktatorship."
    art[41]="Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. "
    art[42]="Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. "
    art[43]="Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing."
    art[44]="The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably."
    art[45]="Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. Within 3 minutes of being bitten, a human being experiences the following symptoms: fever, blurred vision, beard rash, tightness of the jeans, and the feeling of being repeatedly kicked through a car windshield."
    art[46]="Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous."
    art[47]="If you ask Chuck Norris what time it is, he always says, 'Two seconds 'til.' After you ask, 'Two seconds 'til what?' he roundhouse kicks you in the face."
    art[48]="Chuck Norris drives an ice cream truck covered in human skulls."
    art[49]="CNN was originally created as the 'Chuck Norris Network' to update Americans with on-the-spot ass kicking in real-time."
    art[50]="Chuck Norris can win a game of Connect Four in only three moves."
    art[51]="Chuck Norris once ate three 72 oz. steaks in one hour. He spent the first 45 minutes having sex with his waitress."
    art[52]="What was going through the minds of all of Chuck Norris' victims before they died? His shoe."
    art[53]="Chuck Norris is the only man to ever defeat a brick wall in a game of tennis."
    art[54]="Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide."
    art[55]="Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out."
    art[56]="Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Masacre."
    art[57]="If you spell Chuck Norris in Scrabble, you win. Forever."
    art[58]="Chuck Norris originally appeared in the 'Street Fighter II' video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this 'glitch,' Norris replied, 'That's no glitch.'"
    art[59]="Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. "
    art[60]="The opening scene of the movie 'Saving Private Ryan' is loosely based on games of dodgeball Chuck Norris played in second grade."
    art[61]="Chuck Norris once shot down a German fighter plane with his finger, by yelling, 'Bang!'"
    art[62]="Teenage Mutant Ninja Turtles is based on a true story: Chuck Norris once swallowed a turtle whole, and when he crapped it out, the turtle was six feet tall and had learned karate."
    art[63]="Chuck Norris is the only human being to display the Heisenberg uncertainty principle -- you can never know both exactly where and how quickly he will roundhouse-kick you in the face."
    art[64]="Chuck Norris can hit you so hard that he can actually alter your DNA. Decades from now your descendants will occasionally clutch their heads and yell 'What The Hell was That?' "
    art[65]="Time waits for no man. Unless that man is Chuck Norris."
    art[66]="Chuck Norris discovered a new theory of relativity involving multiple universes in which Chuck Norris is even more badass than in this one. When it was discovered by Albert Einstein and made public, Chuck Norris roundhouse-kicked him in the face. We know Albert Einstein today as Stephen Hawking."
    art[67]="Chuck Norris doesn't shower, he only takes blood baths."
    art[68]="The Chuck Norris military unit was not used in the game Civilization 4, because a single Chuck Norris could defeat the entire combined nations of the world in one turn."
    art[69]="According to the Encyclopedia Brittanica, the Native American 'Trail of Tears' has been redefined as anywhere that Chuck Norris walks."
    art[70]="Chuck Norris does not teabag the ladies. He potato-sacks them."
    art[71]="Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face."
    art[72]="Some people like to eat frogs' legs. Chuck Norris likes to eat lizard legs. Hence, snakes."
    art[73]="Chuck Norris’ house has no doors, only walls that he walks through."
    art[74]="In honor of Chuck Norris, all McDonald's in Texas have an even larger size than the super-size. When ordering, just ask to be Chucksized. "
    art[75]="Chuck Norris CAN believe it's not butter."
    art[76]="If tapped, a Chuck Norris roundhouse kick could power the country of Australia for 44 minutes."
    art[77]="While urinating, Chuck Norris is easily capable of welding titanium."
    art[78]="Contrary to popular belief, there is indeed enough Chuck Norris to go around."
    art[79]="Nobody doesn't like Sara Lee. Except Chuck Norris."
    art[80]="Archeologists unearthed an old english dictionary dating back to the year 1236. It defined 'victim' as 'one who has encountered Chuck Norris'"
    art[81]="Chuck Norris ordered a Big Mac at Burger King, and got one."
    art[82]="Chuck Norris and Mr. T walked into a bar. The bar was instantly destroyed, as that level of awesome cannot be contained in one building."
    art[83]="The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage."
    art[84]="It takes Chuck Norris 20 minutes to watch 60 Minutes."
    art[85]="You know how they say if you die in your dream then you will die in real life? In actuality, if you dream of death then Chuck Norris will find you and kill you."
    art[86]="Chuck Norris has a deep and abiding respect for human life... unless it gets in his way."
    art[87]="Chuck Norris can touch MC Hammer."
    art[88]="Thousands of years ago Chuck Norris came across a bear. It was so terrified that it fled north into the arctic. It was also so terrified that all of its decendents now have white hair."
    art[89]="Chuck Norris played Russian Roulette with a fully loaded gun and won."
    art[90]="Some people wear Superman pajamas. Superman wears Chuck Norris pajamas."
    art[91]="Chuck Norris once worked as a weatherman for the San Diego evening news. Every night he would make the same forecast: Partly cloudy with a 75% chance of Pain."
    art[92]="Simply by pulling on both ends, Chuck Norris can stretch diamonds back into coal."
    art[93]="Scotty in Star Trek often says “Ye cannae change the laws of physics.” This is untrue. Chuck Norris can change the laws of physics. With his fists. "
    art[94]="Chuck Norris doesn't stub his toes. He accidentally destroys chairs, bedframes, and sidewalks."
    art[95]="Chuck Norris does not own a stove, oven, or microwave , because revenge is a dish best served cold."
    art[96]="Chuck Norris did in fact, build Rome in a day."
    art[97]="Chuck Norris once pulled out a single hair from his beard and skewered three men through the heart with it."
    art[98]="When Chuck Norris says 'More cowbell', he MEANS it. "
    art[99]="It is scientifically impossible for Chuck Norris to have had a mortal father. The most popular theory is that he went back in time and fathered himself."
    art[100]="Chuck Norris destroyed the periodic table, because Chuck Norris only recognizes the element of surprise."
    art[101]="Chuck Norris does not own a house. He walks into random houses and people move."
    art[102]="Chuck Norris is the only person to ever win a staring contest against Ray Charles and Stevie Wonder at the same time."
    art[103]="Chuck Norris is the reason why Waldo is hiding."
    art[104]="Chuck Norris uses a night light. Not because Chuck Norris is afraid of the dark, but the dark is afraid of Chuck Norris."
    art[105]="Chuck Norris's version of a 'chocolate milkshake' is a raw porterhouse wrapped around ten Hershey bars, and doused in diesel fuel."
    art[106]="When chuck Norris does division, there are no remainders."
    art[107]="The best-laid plans of mice and men often go awry. Even the worst-laid plans of Chuck Norris come off without a hitch."
    art[108]="The square root of Chuck Norris is pain. Do not try to square Chuck Norris, the result is death."
    art[109]="Chuck Norris uses 8'x10' sheets of plywood as toilet paper."








	
	
	
	  var aryImages = new Array(2);
	  var aryImages1 = new Array(2);

  //aryImages[0] = "images/byaheader1.jpg";
  //aryImages[1] = "images/byaheader2.jpg";
  //aryImages[2] = "images/byaheader3.jpg";
  //aryImages[3] = "images/byaheader4.jpg";
  //aryImages[4] = "images/byaheader5.jpg";
  //aryImages[5] = "images/byaheader6.jpg";
  //aryImages[6] = "images/byaheader7.jpg";
  //aryImages[7] = "images/byaheader8.jpg";
  //aryImages[8] = "images/byaheader.jpg";
  
  aryImages[0] = "http://www.byaclan.com/images/byaheader1.jpg";
  aryImages[1] = "http://www.byaclan.com/images/byaheader2.jpg";
  aryImages[2] = "http://www.byaclan.com/images/byaheader3.jpg";
  aryImages[3] = "http://www.byaclan.com/images/byaheader4.jpg";
  aryImages[4] = "http://www.byaclan.com/images/byaheader5.jpg";
  aryImages[5] = "http://www.byaclan.com/images/byaheader6.jpg";
  aryImages[6] = "http://www.byaclan.com/images/byaheader7.jpg";
  aryImages[7] = "http://www.byaclan.com/images/byaheader8.jpg";
  aryImages[8] = "http://www.byaclan.com/images/byaheader.jpg";
  aryImages[9] = "http://www.byaclan.com/images/byaheader9.jpg";
  aryImages[10] = "http://www.byaclan.com/images/FLWebHeader1.jpg";
  aryImages[11] = "http://www.byaclan.com/images/FLWebHeader2.jpg";
  aryImages[12] = "http://www.byaclan.com/images/FLWebHeader3.jpg";
  aryImages[13] = "http://www.byaclan.com/images/FLWebHeader4.jpg";
  
  var p = aryImages.length-1;

  for (i=0; i < aryImages.length; i++) {
    var preload = new Image();
    preload.src = aryImages[i];
  }

	function swap(x) {
  	var imgIndex=document.holder.imgIndexHold.value; 
  	imgIndex = Number(imgIndex);	
  	var crossFadeDuration = 3;
  	document['imgMain'].style.filter="blendTrans(duration=2)";
    document['imgMain'].style.filter="blendTrans(duration=crossFadeDuration)";
    document['imgMain'].filters.blendTrans.Apply();
  	document['imgMain'].src = aryImages[imgIndex];
  	document['imgMain'].filters.blendTrans.Play();
  	//if (imgIndex<p){
  	//	imgIndex=imgIndex+1;
  	//}else{
  	//	imgIndex=0;
  	//}
  	var random=Math.floor(Math.random()*14);
  	while (imgIndex == random)
     {
   		random=Math.floor(Math.random()*14);
     }
	//document.holder.imgIndexHold.value=imgIndex;
	document.holder.imgIndexHold.value=random;
	setTimeout('swap()', 10000)
  }

