<!-- hide script from old browsers


function initArray2(ArrayLength){
	this.length=ArrayLength
	for (var i=0; i < this.length; i++)
	this[i+1] = 0}

function initArray(){
	this.length=initArray.arguments.length
	for (var i=0; i < this.length; i++)
	this[i+1] = initArray.arguments[i]}

 function setCookie (name, value, expires) {
        if (!expires) expires = new Date();
    document.cookie = name + "=" + escape (value) +     
    "; expires=" + expires.toGMTString() +  "; path=/";
    }                                                       

    function getCookie (name) {
    var dcookie = document.cookie; 
    var cname = name + "=";
    var clen = dcookie.length;
    var cbegin = 0;
        while (cbegin < clen) {
        var vbegin = cbegin + cname.length;
            if (dcookie.substring(cbegin, vbegin) == cname) { 
            var vend = dcookie.indexOf (";", vbegin);
                if (vend == -1) vend = clen;
            return unescape(dcookie.substring(vbegin, vend));
            }
        cbegin = dcookie.indexOf(" ", cbegin) + 1;
            if (cbegin == 0) break;
        }
    return null;
    }


   expdate = new Date();
   expdate1 = new Date();
   todaysdate = new Date();
   todayssec = todaysdate.getTime();
    expdate1.setTime (expdate.getTime()+ (365 * 24 * 3600) );
    expdate.setTime (expdate.getTime() + (365 * 24 * 3600 * 1000));

    function setCookieArray(name){
    this.length = setCookieArray.arguments.length - 1;
        for (var i = 0; i < this.length; i++) {
        data = setCookieArray.arguments[i + 1]
        setCookie (name + i, data, expdate);
        }        
    }

    function getCookieArray(name){
    var i = 0;
        while (getCookie(name + i) != null) {
        this[i + 1] = getCookie(name + i);
        i++; this.length = i; 
        }
   if (i==0){this[1]="none"}
    }

  answ = 0
username= null

 var testArray2 = new getCookieArray("_REBTQ")
	beliefscore = new initArray2(12);

  answ = testArray2[13]
username= testArray2[15]
scorestring = 'http://www.testandcalc.com/Self_Defeating_Beliefs/mail.asp?score='

        for (var i=1; i<13; i++){

if (testArray2[i]==null){testArray2[i]=0}
 beliefscore[i]=testArray2[i];

d = beliefscore[i].toString();

if (d=="none"){d="0"}

scorestring +=d 
}


if (scorestring != "http://www.testandcalc.com/Self_Defeating_Beliefs/mail.asp?score=000000000000"){
scorestring += "&name=" + username 
}


 newline=null ;

   if (navigator.appVersion.lastIndexOf('Win') != -1){  newline="\r\n"}   else {newline="\n"}



function getBottom() {document.write(footval);}

function surfto(){document.location=document.surfing.selectplace.options[document.surfing.selectplace.selectedIndex].value;} 

function showtit(){parent.header.document.showit.pgtitle.value=document.title;}
     

if (top.length>1){if (top.frames[0].name=="header"){showtit();}}



footval="<center><HR><small><small>Self-defeating belief: <a href='bel1.asp'>1</a> <a href='bel2.asp'>2</a> "
+"<a href='bel3.asp'>3</a> <a href='bel4.asp'>4</a> "
+"<a href='bel5.asp'>5</a> <a href='bel6.asp'>6</a> "
+"<a href='bel7.asp'>7</a> <a href='bel8.asp'>8</a> "
+"<a href='bel9.asp'>9</a> <a href='bel10.asp'>10</a> "
+"<a href='bel11.asp'>11</a> <a href='bel12.asp'>12</a><br></small></small>"
+"<form Name='surfing' align='center'>"+newline
+"<select SIZE='1' name='selectplace'>" + newline 
+"<option selected value='menu.asp'>Contents</option>"
+"<option value='intro1.asp'>How this programme can help you</option>"
+"<option value='Rebtq2.asp'>The Questionnaire</option>"
+"<option value='Rebtq3.asp'>The 12 self-defeating beliefs</option>"
+"<option value='sup6.asp'>Background information</option>"
+"<option value='sup5.asp'>* Distortions of reality</option>"
+"<option value='sup3.asp'>* Awfulising</option>"
+"<option value='sup4.asp'>* Discomfort-intolerance</option>"
+"<option value='sup2.asp'>* Demanding</option>"
+"<option value='sup8.asp'>* People-rating</option>"
+"<option value='sup9.asp'>Self-help techniques</option>"
+"<option value='sup7.asp'>Strategies for motivating yourself</option>"
+"<option value='http://www.rational.org.nz/misc/people/froggatt.htm'>About Wayne Froggatt</option>"
+"<option value='http://www.testandcalc.com/Richard/index.asp'>About Richard Lakeman</option>"
+"<option value='feedbkrt.asp'>Provide Feedback</option>"+newline
+"</select>"+newline
+"<input TYPE='Button' VALUE='Go!' onClick='surfto()'>"+newline
+"</form>"+newline

if (scorestring != "http://www.testandcalc.com/Self_Defeating_Beliefs/mail.asp?score=000000000000"){
footval +="<table border='0' id='table1' align='center' bgcolor='#FFFFFF'><tr><td><img border='0' src='images/emailIcon.gif' width='36' height='36'></td><td valign='top'><font face='Arial'><a href='" + scorestring + "' style='text-decoration: none'><font color='#000080'>E-mail Scores</font></a></font></td></tr></table>"}
footval+="<br><center><font face='Arial'><font color='#000080'><small><font size='2'>© 1998</font></small></font><font size='2'><font color='#000080'>"
+"</font><a href='http://www.rational.org.nz/misc/people/froggatt.htm' style='text-decoration: none'>"
+"<font color='#000080'> Wayne Froggatt</font></a><font color='#000080'> and </font></font>"
+"<a href='http://www.testandcalc.com/Richard/index.asp' style='text-decoration: none'><font size='2' color='#000080'>Richard Lakeman</font></a></font><p>"
+"<!-- AddThis Button BEGIN -->"
+"<a class='addthis_button' href='http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4b578e975a725a1d' addthis:url='http://www.testandcalc.com/Self_Defeating_Beliefs/index.asp'><img src='http://s7.addthis.com/static/btn/v2/lg-share-en.gif' width='125' height='16' alt='Bookmark and Share' style='border:0'/></a><script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b578e975a725a1d'></script>"
+"<!-- AddThis Button END -->"
+"<hr>"



function showstrength(bel){
if (beliefscore[bel]>0){
document.writeln("<table border='0' cellpadding='0' cellspacing='0'><tr><td style='color: rgb(113,0,113) !important'>Strength of belief:&nbsp;</td>");

	for (var i=0; i < 8; i++){
              var jb= bel+"_"+i+".src";
              if (beliefscore[bel]-1<i){var jv="ballgub.gif";}else{var jv="ballgua.gif";}
              document.writeln("<td><img src='images/"+jv+"' width='17' height='16' name='" +jb+ "'></td>");
         }

        document.writeln("</tr></table></center>");



                        document.writeln('<small><small><center>You scored ' + beliefscore[bel] + ' / 8 on this belief ' + username +'</small></small><br>')
		
		if (beliefscore[bel] <3){
			document.writeln('<small><small>It is likely that this belief may cause you minor problems.</small></small>')}
			else{
			if (beliefscore[bel] <6){
						document.writeln('<small><small>This belief may cause you moderate problems.</small></small>')}
			if (beliefscore[bel] >5){			
						document.writeln('<small><small>This belief is likely to be causing problems in your life. You are recommended to check out this belief.</small></small>')}
			
			}
		

			




}}



function getscores(){
var testArray3 = new getCookieArray("_REBTQ")


}

// end hiding script from old browsers -->







