/* Nifty Corners Cube - rounded corners with CSS and Javascript
Copyright 2006 Alessandro Fulciniti (a.fulciniti@html.it)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

var niftyOk=(document.getElementById && document.createElement && Array.prototype.push);

String.prototype.find=function(what){
return(this.indexOf(what)>=0 ? true : false);
}

var oldonload=window.onload;
if(typeof(NiftyLoad)!='function') NiftyLoad=function(){};
if(typeof(oldonload)=='function')
window.onload=function(){oldonload();NiftyLoad()};
else window.onload=function(){NiftyLoad()};

function Nifty(selector,options){
if(niftyOk==false) return;
var i,v=selector.split(","),h=0;
if(options==null) options="";
if(options.find("fixed-height"))
h=getElementsBySelector(v[0])[0].offsetHeight;
for(i=0;i<v.length;i++)
Rounded(v[i],options);
if(options.find("height")) SameHeight(selector,h);
}

function Rounded(selector,options){
var i,top="",bottom="",v=new Array();
if(options!=""){
options=options.replace("left","tl bl");
options=options.replace("right","tr br");
options=options.replace("top","tr tl");
options=options.replace("bottom","br bl");
options=options.replace("transparent","alias");
if(options.find("tl")){
top="both";
if(!options.find("tr")) top="left";
}
else if(options.find("tr")) top="right";
if(options.find("bl")){
bottom="both";
if(!options.find("br")) bottom="left";
}
else if(options.find("br")) bottom="right";
}
if(top=="" && bottom=="" && !options.find("none")){top="both";bottom="both";}
v=getElementsBySelector(selector);
for(i=0;i<v.length;i++){
FixIE(v[i]);
if(top!="") AddTop(v[i],top,options);
if(bottom!="") AddBottom(v[i],bottom,options);
}
}

function AddTop(el,side,options){
var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,colour;
d.style.marginLeft="-"+getPadding(el,"Left")+"px";
d.style.marginRight="-"+getPadding(el,"Right")+"px";
if(options.find("alias") || (colour=getBk(el))=="transparent"){
colour="transparent";bk="transparent"; border=getParentBk(el);btype="t";
}
else{
bk=getParentBk(el); border=Mix(colour,bk);
}
d.style.background=bk;
d.className="niftycorners";
p=getPadding(el,"Top");
if(options.find("small")){
d.style.marginBottom=(p-2)+"px";
btype+="s"; lim=2;
}
else if(options.find("big")){
d.style.marginBottom=(p-10)+"px";
btype+="b"; lim=8;
}
else d.style.marginBottom=(p-5)+"px";
for(i=1;i<=lim;i++)
d.appendChild(CreateStrip(i,side,colour,border,btype));
el.style.paddingTop="0";
el.insertBefore(d,el.firstChild);
}

function AddBottom(el,side,options){
var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,colour;
d.style.marginLeft="-"+getPadding(el,"Left")+"px";
d.style.marginRight="-"+getPadding(el,"Right")+"px";
if(options.find("alias") || (colour=getBk(el))=="transparent"){
colour="transparent";bk="transparent"; border=getParentBk(el);btype="t";
}
else{
bk=getParentBk(el); border=Mix(colour,bk);
}
d.style.background=bk;
d.className="niftycorners";
p=getPadding(el,"Bottom");
if(options.find("small")){
d.style.marginTop=(p-2)+"px";
btype+="s"; lim=2;
}
else if(options.find("big")){
d.style.marginTop=(p-10)+"px";
btype+="b"; lim=8;
}
else d.style.marginTop=(p-5)+"px";
for(i=lim;i>0;i--)
d.appendChild(CreateStrip(i,side,colour,border,btype));
el.style.paddingBottom=0;
el.appendChild(d);
}

function CreateStrip(index,side,colour,border,btype){
var x=CreateEl("b");
x.className=btype+index;
x.style.backgroundColor=colour;
x.style.borderColor=border;
if(side=="left"){
x.style.borderRightWidth="0";
x.style.marginRight="0";
}
else if(side=="right"){
x.style.borderLeftWidth="0";
x.style.marginLeft="0";
}
return(x);
}

function CreateEl(x){
return(document.createElement(x));
}

function FixIE(el){
tempstyle=0;
if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false) {
if(el.style.display=="none") {tempstyle=1;} else {tempstyle=0;};
el.style.display="inline-block";
if (tempstyle==1) {el.style.display="none";}
}
}

function SameHeight(selector,maxh){
var i,v=selector.split(","),t,j,els=[],gap;
for(i=0;i<v.length;i++){
t=getElementsBySelector(v[i]);
els=els.concat(t);
}
for(i=0;i<els.length;i++){
if(els[i].offsetHeight>maxh) maxh=els[i].offsetHeight;
els[i].style.height="auto";
}
for(i=0;i<els.length;i++){
gap=maxh-els[i].offsetHeight;
if(gap>0){
t=CreateEl("b");t.className="niftyfill";t.style.height=gap+"px";
nc=els[i].lastChild;
if(nc.className=="niftycorners")
els[i].insertBefore(t,nc);
else els[i].appendChild(t);
}
}
}

function getElementsBySelector(selector){
var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c;
if(selector.find("#")){ //id selector like "tag#id"
if(selector.find(" ")){ //descendant selector like "tag#id tag"
s=selector.split(" ");
var fs=s[0].split("#");
if(fs.length==1) return(objlist);
f=document.getElementById(fs[1]);
if(f){
v=f.getElementsByTagName(s[1]);
for(i=0;i<v.length;i++) objlist.push(v[i]);
}
return(objlist);
}
else{
s=selector.split("#");
tag=s[0];
selid=s[1];
if(selid!=""){
f=document.getElementById(selid);
if(f) objlist.push(f);
return(objlist);
}
}
}
if(selector.find(".")){ //class selector like "tag.class"
s=selector.split(".");
tag=s[0];
selclass=s[1];
if(selclass.find(" ")){ //descendant selector like tag1.classname tag2
s=selclass.split(" ");
selclass=s[0];
tag2=s[1];
}
}
var v=document.getElementsByTagName(tag); // tag selector like "tag"
if(selclass==""){
for(i=0;i<v.length;i++) objlist.push(v[i]);
return(objlist);
}
for(i=0;i<v.length;i++){
c=v[i].className.split(" ");
for(j=0;j<c.length;j++){
if(c[j]==selclass){
if(tag2=="") objlist.push(v[i]);
else{
v2=v[i].getElementsByTagName(tag2);
for(k=0;k<v2.length;k++) objlist.push(v2[k]);
}
}
}
}
return(objlist);
}

function getParentBk(x){
var el=x.parentNode,c;
while(el.tagName.toUpperCase()!="HTML" && (c=getBk(el))=="transparent")
el=el.parentNode;
if(c=="transparent") c="#FFFFFF";
return(c);
}

function getBk(x){
var c=getStyleProp(x,"backgroundColor");
if(c==null || c=="transparent" || c.find("rgba(0, 0, 0, 0)"))
return("transparent");
if(c.find("rgb")) c=rgb2hex(c);
return(c);
}

function getPadding(x,side){
var p=getStyleProp(x,"padding"+side);
if(p==null || !p.find("px")) return(0);
return(parseInt(p));
}

function getStyleProp(x,prop){
if(x.currentStyle)
return(x.currentStyle[prop]);
if(document.defaultView.getComputedStyle)
return(document.defaultView.getComputedStyle(x,'')[prop]);
return(null);
}

function rgb2hex(value){
var hex="",v,h,i;
var regexp=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;
var h=regexp.exec(value);
for(i=1;i<4;i++){
v=parseInt(h[i]).toString(16);
if(v.length==1) hex+="0"+v;
else hex+=v;
}
return("#"+hex);
}

function Mix(c1,c2){
var i,step1,step2,x,y,r=new Array(3);
if(c1.length==4)step1=1;
else step1=2;
if(c2.length==4) step2=1;
else step2=2;
for(i=0;i<3;i++){
x=parseInt(c1.substr(1+step1*i,step1),16);
if(step1==1) x=16*x+x;
y=parseInt(c2.substr(1+step2*i,step2),16);
if(step2==1) y=16*y+y;
r[i]=Math.floor((x*50+y*50)/100);
r[i]=r[i].toString(16);
if(r[i].length==1) r[i]="0"+r[i];
}
return("#"+r[0]+r[1]+r[2]);
}

var qnum=46;
var qn=new Array(4);
var qs=new Array(4);
var as=new Array(4);
var reqajax;

function randq() {
qn[0]=(Math.floor(Math.random()*qnum))+1;
do {qn[1]=(Math.floor(Math.random()*qnum))+1;} while (qn[0]==qn[1]);
do {qn[2]=(Math.floor(Math.random()*qnum))+1;} while (qn[0]==qn[2] || qn[1]==qn[2]);
do {qn[3]=(Math.floor(Math.random()*qnum))+1;} while (qn[0]==qn[3] || qn[1]==qn[3] || qn[2]==qn[3]);
try{reqajax=new XMLHttpRequest();} catch (e){try{reqajax=new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try{reqajax=new ActiveXObject("Microsoft.XMLHTTP");} catch (e){return false;}}}
//for (var kq=1; kq<14; kq++) {document.getElementById("kw"+kq).style.fontWeight="normal";}
var qtimtest=new Date().getTime();
qstring="http://www.prepareforsuccess.org.uk/q.php?time="+qtimtest+"&mode=1&a="+qn[0]+"&b="+qn[1]+"&c="+qn[2]+"&d="+qn[3];
reqajax.onreadystatechange=randqready;
reqajax.open("GET",qstring,true);
try{reqajax.send(null);} catch (e){;}
}

function topq() {
try{reqajax=new XMLHttpRequest();} catch (e){try{reqajax=new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try{reqajax=new ActiveXObject("Microsoft.XMLHTTP");} catch (e){return false;}}}
//for (var kq=1; kq<14; kq++) {document.getElementById("kw"+kq).style.fontWeight="normal";}
var qtimtest=new Date().getTime();
qstring="http://www.prepareforsuccess.org.uk/q.php?time="+qtimtest+"&mode=2";
reqajax.onreadystatechange=randqready;
reqajax.open("GET",qstring,true);
try{reqajax.send(null);} catch (e){;}
}

function randqready(){
try{if (reqajax.readyState==4)
{
var xdoc=reqajax.responseXML.documentElement;
qn[0]=xdoc.getElementsByTagName("na")[0].firstChild.data;
qs[0]=xdoc.getElementsByTagName("qa")[0].firstChild.data;
as[0]=xdoc.getElementsByTagName("aa")[0].firstChild.data;
qn[1]=xdoc.getElementsByTagName("nb")[0].firstChild.data;
qs[1]=xdoc.getElementsByTagName("qb")[0].firstChild.data;
as[1]=xdoc.getElementsByTagName("ab")[0].firstChild.data;
qn[2]=xdoc.getElementsByTagName("nc")[0].firstChild.data;
qs[2]=xdoc.getElementsByTagName("qc")[0].firstChild.data;
as[2]=xdoc.getElementsByTagName("ac")[0].firstChild.data;
qn[3]=xdoc.getElementsByTagName("nd")[0].firstChild.data;
qs[3]=xdoc.getElementsByTagName("qd")[0].firstChild.data;
as[3]=xdoc.getElementsByTagName("ad")[0].firstChild.data;
try{
document.getElementById("q0").innerHTML=qs[0];
document.getElementById("q1").innerHTML=qs[1];
document.getElementById("q2").innerHTML=qs[2];
document.getElementById("q3").innerHTML=qs[3];
document.getElementById("q0b").innerHTML=qs[0];
document.getElementById("q1b").innerHTML=qs[1];
document.getElementById("q2b").innerHTML=qs[2];
document.getElementById("q3b").innerHTML=qs[3];
document.getElementById("faq0").style.display="";
document.getElementById("faq1").style.display="";
document.getElementById("faq2").style.display="";
document.getElementById("faq3").style.display="";
document.getElementById("faq0b").style.display="none";
document.getElementById("faq1b").style.display="none";
document.getElementById("faq2b").style.display="none";
document.getElementById("faq3b").style.display="none";
if (qs[0]=="'") {document.getElementById("faq0").style.display="none";}
if (qs[1]=="'") {document.getElementById("faq1").style.display="none";}
if (qs[2]=="'") {document.getElementById("faq2").style.display="none";}
if (qs[3]=="'") {document.getElementById("faq3").style.display="none";}
document.getElementById("ans").innerHTML="<span class='midq'><br/><br/>Click on a question and the answer will appear in this box.<br/><br/><br/></span>";
}catch(e){;}
}
}catch(e){;}
}

function rready(){
try{if (reqajax.readyState==4)
{
;
}}catch(e){;}
}

function qr(qnu){
try{document.getElementById("ans").innerHTML=as[qnu];}catch (e){;}
//now show which box is pointing
for (var qq=0; qq<4; qq++) {
if (!(qq==qnu)) {
document.getElementById("faq"+qq).style.display="";
document.getElementById("faq"+qq+"b").style.display="none";
if (document.getElementById("q"+qq).innerHTML=="'") {document.getElementById("faq"+qq).style.display="none";}
}
}
document.getElementById("faq"+qnu).style.display="none";
document.getElementById("faq"+qnu+"b").style.display="";
document.getElementById("qr"+qnu+"b").focus();
try{reqajax=new XMLHttpRequest();} catch (e){try{reqajax=new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try{reqajax=new ActiveXObject("Microsoft.XMLHTTP");} catch (e){return false;}}}
var qtimtest=new Date().getTime();
qstring="http://www.prepareforsuccess.org.uk/q.php?time="+qtimtest+"&mode=3&a="+qn[qnu];
reqajax.onreadystatechange=rready;
reqajax.open("GET",qstring,true);
try{reqajax.send(null);} catch (e){;}
}

function kwbut(kwnum) {
try{reqajax=new XMLHttpRequest();} catch (e){try{reqajax=new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try{reqajax=new ActiveXObject("Microsoft.XMLHTTP");} catch (e){return false;}}}
//for (var kq=1; kq<14; kq++) {document.getElementById("kw"+kq).style.fontWeight="normal";}
//document.getElementById("kw"+kwnum).style.fontWeight="bold";
//for (var kq=1; kq<14; kq++) {document.getElementById("kw"+kq).style.background="none";}
//document.getElementById("kw"+kwnum).style.background="#fff";
var qtimtest=new Date().getTime();
qstring="http://www.prepareforsuccess.org.uk/q.php?time="+qtimtest+"&mode=6&w="+kwnum;
reqajax.onreadystatechange=randqready;
reqajax.open("GET",qstring,true);
try{reqajax.send(null);} catch (e){;}
}

function toggle(x){if (x.style.display=="none") {x.style.display="" ;}else{x.style.display="none";}}
function getNextSibling(startBrother){endBrother=startBrother.nextSibling;while(endBrother.nodeType!=1){endBrother=endBrother.nextSibling;}return endBrother;}
function getPrevSibling(startBrother){endBrother=startBrother.previousSibling;while(endBrother.nodeType!=1){endBrother=endBrother.previousSibling;}return endBrother;}

function sbutt(bnum){
var butlist=document.getElementsByTagName("button");
for (var ii=0; ii<12; ii++) {
document.getElementById("listt"+ii).style.display="none";
butlist[ii+4].style.background="transparent";
}
for (var ii=0; ii<4; ii++) {
if (!(ii==bnum)) {
document.getElementById("lists"+ii).style.display="none";
butlist[ii].style.background="transparent";
}
}
document.getElementById("lists"+bnum).style.display="";
butlist[bnum].style.background="#f9dba4";
document.getElementById("bltab").className="blue_tab";
document.getElementById("ortab").className="orange_tab curro";
document.getElementById("brock").style.display="none";
//then ajax the hit
try{reqajax=new XMLHttpRequest();} catch (e){try{reqajax=new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try{reqajax=new ActiveXObject("Microsoft.XMLHTTP");} catch (e){return false;}}}
var qtimtest=new Date().getTime();
qstring="http://www.prepareforsuccess.org.uk/q.php?time="+qtimtest+"&mode=4&a="+(bnum+1);
reqajax.onreadystatechange=rready;
reqajax.open("GET",qstring,true);
try{reqajax.send(null);} catch (e){;}
var expday=new Date();
expday.setTime(expday.getTime()+604800000);
document.cookie="but=0"+bnum+"; expires="+expday.toGMTString()+";path=/";
}

function tbutt(bnum){
var butlist=document.getElementsByTagName("button");
for (var ii=0; ii<4; ii++) {
document.getElementById("lists"+ii).style.display="none";
butlist[ii].style.background="transparent";
}
for (var ii=0; ii<12; ii++) {
if (!(ii==bnum)) {
document.getElementById("listt"+ii).style.display="none";
butlist[ii+4].style.background="transparent";
}
}
document.getElementById("listt"+bnum).style.display="";
butlist[bnum+4].style.background="#9be4f4";
document.getElementById("ortab").className="orange_tab";
document.getElementById("bltab").className="blue_tab currb";
document.getElementById("brock").style.display="";
//then ajax the hit
try{reqajax=new XMLHttpRequest();} catch (e){try{reqajax=new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try{reqajax=new ActiveXObject("Microsoft.XMLHTTP");} catch (e){return false;}}}
var qtimtest=new Date().getTime();
qstring="http://www.prepareforsuccess.org.uk/q.php?time="+qtimtest+"&mode=5&a="+(bnum+1);
reqajax.onreadystatechange=rready;
reqajax.open("GET",qstring,true);
try{reqajax.send(null);} catch (e){;}
var expday=new Date();
expday.setTime(expday.getTime()+604800000);
var bp=bnum+4;
if (bp<=9) {var bput="but=0"+bp;} else {var bput="but="+bp;}
document.cookie=bput+"; expires="+expday.toGMTString()+";path=/";
}

function cook() {
var ca = document.cookie.split(';');
for(var ai=0;ai<ca.length;ai++) {
var c=ca[ai];
while (c.charAt(0)==' ') c=c.substring(1,c.length);
if (c.indexOf("but=")==0) {var dcook=c.substring(4,c.length);}
}
if (!dcook) {return null;}
dco=parseInt(dcook,10);
if (dco<4) {sbutt(dco);} else {tbutt(dco-4);}
}

function uncook() {
var expday=new Date();
expday.setTime(expday.getTime()-604800000);
document.cookie="but=;expires="+expday.toGMTString()+";path=/";
}

function watchdemo() {
if (document.getElementById("wdem").style.display=="none") {
document.getElementById("wdem").style.display="";
document.getElementById("hdem").style.display="none";
document.getElementById("wdemo").style.display="none";
document.getElementById("wdemo").innerHTML="";
} else {
document.getElementById("wdem").style.display="none";
document.getElementById("hdem").style.display="";
document.getElementById("wdemo").style.display="";
document.getElementById("wdemo").innerHTML="<p><object type=\"application/x-shockwave-flash\" width=\"640\" height=\"293\" data=\"http://www.prepareforsuccess.org.uk/supportfiles/ukcisa_demo.swf\"><param name=\"movie\" value=\"http://www.prepareforsuccess.org.uk/supportfiles/ukcisa_demo.swf\"/></object></p><h3 class=\"pdf\"><a href=\"http://www.prepareforsuccess.org.uk/flash_demo_ukcisa.pdf\" target=\"_blank\">Audio transcript</a> (pdf, 63kb).</h3>";
}
}

function iehack() {
try {
document.getElementById("qr0").style.width=(document.getElementById("lfaq").offsetWidth-66);
document.getElementById("qr0b").style.width=(document.getElementById("lfaq").offsetWidth-66);
document.getElementById("qr1").style.width=(document.getElementById("lfaq").offsetWidth-66);
document.getElementById("qr1b").style.width=(document.getElementById("lfaq").offsetWidth-66);
document.getElementById("qr2").style.width=(document.getElementById("rfaq").offsetWidth-66);
document.getElementById("qr2b").style.width=(document.getElementById("rfaq").offsetWidth-66);
document.getElementById("qr3").style.width=(document.getElementById("rfaq").offsetWidth-66);
document.getElementById("qr3b").style.width=(document.getElementById("rfaq").offsetWidth-66);
} catch (e){;}
}

function prepare_elements()
{
var ieh=0;
if (navigator.appName=="Microsoft Internet Explorer")
{
var ua=navigator.userAgent;
var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua)!=null) {rv=parseFloat(RegExp.$1);}
if (rv>=7.0) {
ieh=1;
}
}
var butlist=document.getElementsByTagName("button");
for (var t=0; t<butlist.length; t++)
{if ((butlist[t].className=="feedback")||(butlist[t].className=="help")||(butlist[t].className=="review"))
{butlist[t].onclick=function () {var next=getNextSibling(this);var next_again=getNextSibling(next);toggle(this);toggle(next);toggle(next_again);next.focus();};}
if ((butlist[t].className=="hidefeedback")||(butlist[t].className=="hidehelp")||(butlist[t].className =="hidereview"))
{butlist[t].onclick=function () {var prev=getPrevSibling(this);var next=getNextSibling(this);toggle(this);toggle(prev);toggle(next);prev.focus();};}
if (butlist[t].className=="lbutr") {butlist[t].onclick=function () {randq();};butlist[t].onmouseover=function () {this.style.textDecoration="underline";};butlist[t].onmouseout=function () {this.style.textDecoration="none";};}
if (butlist[t].className=="lbutt") {butlist[t].onclick=function () {topq();};butlist[t].onmouseover=function () {this.style.textDecoration="underline";};butlist[t].onmouseout=function () {this.style.textDecoration="none";};}
if (butlist[t].className=="lbutd") {butlist[t].onclick=function () {watchdemo();};butlist[t].onmouseover=function () {this.style.textDecoration="underline";};butlist[t].onmouseout=function () {this.style.textDecoration="none";};}
if ((butlist[t].className=="sbut") && (t==0)) {butlist[t].onclick=function () {sbutt((0));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="sbut") && (t==1)) {butlist[t].onclick=function () {sbutt((1));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="sbut") && (t==2)) {butlist[t].onclick=function () {sbutt((2));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="sbut") && (t==3)) {butlist[t].onclick=function () {sbutt((3));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==4)) {butlist[t].onclick=function () {tbutt((0));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==5)) {butlist[t].onclick=function () {tbutt((1));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==6)) {butlist[t].onclick=function () {tbutt((2));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==7)) {butlist[t].onclick=function () {tbutt((3));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==8)) {butlist[t].onclick=function () {tbutt((4));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==9)) {butlist[t].onclick=function () {tbutt((5));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==10)) {butlist[t].onclick=function () {tbutt((6));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==11)) {butlist[t].onclick=function () {tbutt((7));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==12)) {butlist[t].onclick=function () {tbutt((8));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==13)) {butlist[t].onclick=function () {tbutt((9));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==14)) {butlist[t].onclick=function () {tbutt((10));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="tbut") && (t==15)) {butlist[t].onclick=function () {tbutt((11));};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==2)) {butlist[t].onclick=function(){kwbut(1)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==3)) {butlist[t].onclick=function(){kwbut(2)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==4)) {butlist[t].onclick=function(){kwbut(3)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==5)) {butlist[t].onclick=function(){kwbut(4)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==6)) {butlist[t].onclick=function(){kwbut(5)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==7)) {butlist[t].onclick=function(){kwbut(6)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==8)) {butlist[t].onclick=function(){kwbut(7)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==9)) {butlist[t].onclick=function(){kwbut(8)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==10)) {butlist[t].onclick=function(){kwbut(9)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==11)) {butlist[t].onclick=function(){kwbut(10)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==12)) {butlist[t].onclick=function(){kwbut(11)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==13)) {butlist[t].onclick=function(){kwbut(12)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
if ((butlist[t].className=="kword") && (t==14)) {butlist[t].onclick=function(){kwbut(13)};butlist[t].onmouseover=function(){this.style.textDecoration="underline";};butlist[t].onmouseout=function(){this.style.textDecoration="none";};}
}

var alist=document.getElementsByTagName("a");
for (var i=0; i<alist.length; i++) {
if (alist[i].id=="qr0") {alist[i].onclick=function () {qr(0);return false;};}
if (alist[i].id=="qr1") {alist[i].onclick=function () {qr(1);return false;};}
if (alist[i].id=="qr2") {alist[i].onclick=function () {qr(2);return false;};}
if (alist[i].id=="qr3") {alist[i].onclick=function () {qr(3);return false;};}
if (alist[i].id=="qr0b") {alist[i].onclick=function () {qr(0);return false;};}
if (alist[i].id=="qr1b") {alist[i].onclick=function () {qr(1);return false;};}
if (alist[i].id=="qr2b") {alist[i].onclick=function () {qr(2);return false;};}
if (alist[i].id=="qr3b") {alist[i].onclick=function () {qr(3);return false;};}
}

Nifty("div.round","big");Nifty("a.round","big");
if (document.getElementById("lfaq")) {randq();}
if (document.getElementById("lfaq") && ieh) {window.onresize=iehack;}
if (document.getElementById("lists0")) {cook();}
if (document.getElementById("wdemo")) {uncook();}
}
function updateScore0() {var a = 0; if (document.getElementById("tf1").GetVariable('/:myvar') == "false") {a++}; if (document.getElementById("tf2").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf3").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf4").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf5").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf6").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf7").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf8").GetVariable("/:myvar") == "true") {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore0a() {var a = 0; if (document.getElementById('tf1').checked == true) {a++}; if (document.getElementById('tf2').checked == true) {a++}; if (document.getElementById('tf3').checked == true) {a++}; if (document.getElementById('tf4').checked == true) {a++}; if (document.getElementById('tf5').checked == true) {a++}; if (document.getElementById('tf6').checked == true) {a++}; if (document.getElementById('tf7').checked == true) {a++}; if (document.getElementById('tf8').checked == true) {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore1() {var a = 0; if (document.getElementById('tf1').GetVariable('/:myvar') == "true") {a++}; if (document.getElementById("tf2").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf3").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf4").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf5").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf6").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf7").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf8").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf9").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf10").GetVariable("/:myvar") == "true") {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore1a() {var a = 0; if (document.getElementById('tf1').checked == true) {a++}; if (document.getElementById('tf2').checked == true) {a++}; if (document.getElementById('tf3').checked == true) {a++}; if (document.getElementById('tf4').checked == true) {a++}; if (document.getElementById('tf5').checked == true) {a++}; if (document.getElementById('tf6').checked == true) {a++}; if (document.getElementById('tf7').checked == true) {a++}; if (document.getElementById('tf8').checked == true) {a++}; if (document.getElementById('tf9').checked == true) {a++}; if (document.getElementById('tf10').checked == true) {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore2() {var a = 0; if (document.getElementById('tf1').checked == true) {a++}; if (document.getElementById('tf2').checked == true) {a++}; if (document.getElementById('tf3').checked == true) {a++}; if (document.getElementById('tf4').checked == true) {a++}; if (document.getElementById('tf5').checked == true) {a++}; if (document.getElementById('tf6').checked == true) {a++}; if (document.getElementById('tf7').checked == true) {a++}; if (document.getElementById('tf8').checked == true) {a++}; if (document.getElementById('tf9').checked == true) {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore3() {var a = 0; if (document.getElementById('tf1').GetVariable('/:myvar') == "false") {a++}; if (document.getElementById("tf2").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf3").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf4").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf5").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf6").GetVariable("/:myvar") == "false") {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore3a() {var a = 0; if (document.getElementById('tf1').checked == true) {a++}; if (document.getElementById('tf2').checked == true) {a++}; if (document.getElementById('tf3').checked == true) {a++}; if (document.getElementById('tf4').checked == true) {a++}; if (document.getElementById('tf5').checked == true) {a++}; if (document.getElementById('tf6').checked == true) {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore3b() {var a = 0; if (document.getElementById('tfa1').checked == true) {a++}; if (document.getElementById('tfa2').checked == true) {a++}; if (document.getElementById('tfa3').checked == true) {a++}; if (document.getElementById('tfa4').checked == true) {a++}; if (document.getElementById('tfa5').checked == true) {a++}; if (document.getElementById('tfa6').checked == true) {a++}; if (document.getElementById('tfa7').checked == true) {a++}; if (document.getElementById('tfa8').checked == true) {a++}; if (document.getElementById('tfa9').checked == true) {a++}; if (document.getElementById('tfa10').checked == true) {a++}; document.getElementById("yourScore2").innerHTML = a;}
function updateScore4() {var a = 0; if (document.getElementById('tf1').GetVariable('/:myvar') == "false") {a++}; if (document.getElementById("tf2").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf3").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf4").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf5").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf6").GetVariable("/:myvar") == "false") {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore4a() {var a = 0; if (document.getElementById('tf1').checked == true) {a++}; if (document.getElementById('tf2').checked == true) {a++}; if (document.getElementById('tf3').checked == true) {a++}; if (document.getElementById('tf4').checked == true) {a++}; if (document.getElementById('tf5').checked == true) {a++}; if (document.getElementById('tf6').checked == true) {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore5() {var a = 0; if (document.getElementById('tf1').GetVariable('/:myvar') == "false") {a++}; if (document.getElementById("tf2").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf3").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf4").GetVariable("/:myvar") == "false") {a++}; if (document.getElementById("tf5").GetVariable("/:myvar") == "true") {a++}; if (document.getElementById("tf6").GetVariable("/:myvar") == "false") {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore5a() {var a = 0; if (document.getElementById('tf1').checked == true) {a++}; if (document.getElementById("tf2").checked == true) {a++}; if (document.getElementById("tf3").checked == true) {a++}; if (document.getElementById("tf4").checked == true) {a++}; if (document.getElementById("tf5").checked == true) {a++}; if (document.getElementById("tf6").checked == true) {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore6() {var a = 0;if (document.getElementById("ans1").checked == true) {a++}; if (document.getElementById("ans2").checked == true) {a++}; if (document.getElementById("ans3").checked == true) {a++}; if (document.getElementById("ans4").checked == true) {a++}; if (document.getElementById("ans5").checked == true) {a++}; if (document.getElementById("ans6").checked == true) {a++}; if (document.getElementById("ans7").checked == true) {a++}; if (document.getElementById("ans8").checked == true) {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore6a() {var a = 0;if (document.getElementById("ans1").checked == true) {a++}; if (document.getElementById("ans2").checked == true) {a++}; if (document.getElementById("ans3").checked == true) {a++}; if (document.getElementById("ans4").checked == true) {a++}; if (document.getElementById("ans5").checked == true) {a++}; if (document.getElementById("ans6").checked == true) {a++}; if (document.getElementById("ans7").checked == true) {a++}; if (document.getElementById("ans8").checked == true) {a++}; document.getElementById("yourScore").innerHTML = a;}
function updateScore6b() {var a = 0; if (document.getElementById('tfa1').checked == true) {a++}; if (document.getElementById('tfa2').checked == true) {a++}; if (document.getElementById('tfa3').checked == true) {a++}; if (document.getElementById('tfa4').checked == true) {a++}; if (document.getElementById('tfa5').checked == true) {a++}; if (document.getElementById('tfa6').checked == true) {a++}; if (document.getElementById('tfa7').checked == true) {a++}; if (document.getElementById('tfa8').checked == true) {a++}; document.getElementById("yourScore2").innerHTML = a;}
window.onload=prepare_elements;