// javascript for cw - last updated 28 Jun 2009

if (document.images) {
c1 = new Image(120,120);
c1.src = 'img/c1.gif';
c2 = new Image(120,120);
c2.src = 'img/c2.gif';
c3 = new Image(120,120);
c3.src = 'img/c3.gif';
c4 = new Image(120,120);
c4.src = 'img/c4.gif';
c5 = new Image(120,120);
c5.src = 'img/c5.gif';
c6 = new Image(120,120);
c6.src = 'img/c6.gif';
c7 = new Image(120,120);
c7.src = 'img/c7.gif';
c8 = new Image(120,120);
c8.src = 'img/c8.gif';
c9 = new Image(120,120);
c9.src = 'img/c9.gif';
c10 = new Image(120,120);
c10.src = 'img/c10.gif';
c11 = new Image(120,120);
c11.src = 'img/c11.gif';
c12 = new Image(120,120);
c12.src = 'img/c12.gif';
c13 = new Image(120,120);
c13.src = 'img/c13.gif';
c14 = new Image(120,120);
c14.src = 'img/c14.gif';
c1u = new Image(120,120);
c1u.src = 'img/c1u.gif';
c2u = new Image(120,120);
c2u.src = 'img/c2u.gif';
c3u = new Image(120,120);
c3u.src = 'img/c3u.gif';
c4u = new Image(120,120);
c4u.src = 'img/c4u.gif';
c5u = new Image(120,120);
c5u.src = 'img/c5u.gif';
c6u = new Image(120,120);
c6u.src = 'img/c6u.gif';
c7u = new Image(120,120);
c7u.src = 'img/c7u.gif';
c8u = new Image(120,120);
c8u.src = 'img/c8u.gif';
c9u = new Image(120,120);
c9u.src = 'img/c9u.gif';
c10u = new Image(120,120);
c10u.src = 'img/c10u.gif';
c11u = new Image(120,120);
c11u.src = 'img/c11u.gif';
c12u = new Image(120,120);
c12u.src = 'img/c12u.gif';
c13u = new Image(120,120);
c13u.src = 'img/c13u.gif';
c14u = new Image(120,120);
c14u.src = 'img/c14u.gif';
}

function doFade(im) {
sImg = 'img/' + im + '.gif';
eImg= 'img/' + im + 'u.gif';
document.getElementById(im).filters[0].apply();
if (document.getElementById(im).src.indexOf(sImg)!=-1) {
	document.getElementById(im).src = eImg;
} else {
	document.getElementById(im).src = sImg;
}
document.getElementById(im).filters[0].play();
}


var text = new Array(12);
var i = 0;
var j = 0;
var x = 0;
var y = 0;
var site = '';
var alt = '';
var pick = 'abcdefghijklmn';
var xpos = 'abcdefghijklmn';
for (j=1; j<=14; j++) {
x = pick.length * Math.random();
x = Math.floor(x);
x = pick.substr(x,1);
pick = pick.replace(x,'');
x = eval(xpos.indexOf(x) + 1);
if ( x <= 6 ) { y+=1; }
if ( y <= 4 || x > 6 ) {
i+=1;
switch(x) {
case 7:
site = 'www.iqeq.com.au';
alt = 'iQeQ Web Reviews';
break;
case 8:
site = 'www.classpad.com.au';
alt = 'Casio Classpad Help Series';
break;
case 9:
site = 'www.waexams.com.au';
alt = 'WA Exam Papers';
break;
case 10:
site = 'www.thetuitioncentre.com.au';
alt = 'The Tuition Centre';
break;
case 11:
site = 'www.charliewatson.com/solutions/';
alt = 'Internet Solutions';
break;
case 12:
site = 'www.emarkbook.com';
alt = 'eMarkbook';
break;
case 13:
site = 'www.charliewatson.com/casio/';
alt = 'Casio Solutions';
break;
default:
site = '';
alt = '';
}
if ( ( x > 6 ) && ( x < 14 ) ) {
text[i] = '<a href="http://' + site;
text[i] = text[i] + '" target="_blank"><img class="fade" id="c' + x;
text[i] = text[i] + '" onmouseover="doFade(\'c' + x + '\')"';
text[i] = text[i] + ' onmouseout="doFade(\'c' + x + '\')"';
text[i] = text[i] + ' src="img/c' + x + '.gif" width="120" height="120" border="0" alt="' + alt + '"></a>\n';
} else {
text[i] = '<img class="fade" id="c' + x;
text[i] = text[i] + '" onmouseover="doFade(\'c' + x + '\')"';
text[i] = text[i] + ' onmouseout="doFade(\'c' + x + '\')"';
text[i] = text[i] + ' src="img/c' + x + '.gif" width="120" height="120" border="0" alt="">\n';
}
}
}

