/* 
Scripts below were compiled and in some cases created by Carlos Simoes from CPSnet Web Awards 
 * (www.excellentsite.org). If you are planning to use this .js file for the purpose of adding hidden
 * boxes to you page, plese keep this notice here.
 */

/*
 * cssjs
 * written by Christian Heilmann (http://icant.co.uk)
 * eases the dynamic application of CSS classes via DOM
 * parameters: action a, object o and class names c1 and c2 (c2 optional)
 * actions: swap exchanges c1 and c2 in object o
 *			add adds class c1 to object o
 *			remove removes class c1 from object o
 *			check tests if class c1 is applied to object o
 * example:	cssjs('swap',document.getElementById('foo'),'bar','baz');
 */

function cssjs(a,o,c1,c2){
switch (a){
case 'swap':
o.className=!cssjs('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);
break;
case 'add':
if(!cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
break;
case 'remove':
var rep=o.className.match(' '+c1)?' '+c1:c1;
o.className=o.className.replace(rep,'');
break;
case 'check':
return new RegExp('\\b'+c1+'\\b').test(o.className)
break;}}


function change2display(what) { 
if (!document.getElementById) return;
for (var l=1; l<20; l++) {
var a = 'more'; 
var theid = a + l;
if (!document.getElementById(theid)){
if (what == 'none'){
for (var m=1; m<20; m++) {
var b = 'show'; 
var otherid = b + m;
if (!document.getElementById(otherid)) return; 
document.getElementById(otherid).style.display = 'block';}}
if (what == 'block'){
for (var m=1; m<20; m++){
var b = 'show'; 
var otherid = b + m;
if (!document.getElementById(otherid)) return; 
document.getElementById(otherid).style.display = 'none';}}}
document.getElementById(theid).style.display = what;}}

function jsenabled() {
for (var m=1; m<20; m++) {
var b = 'show';
var otherid = b + m;
if (!document.getElementById(otherid))
{for (var m=1; m<20; m++) {
var b = 'innershow';
var otherid = b + m;
if (!document.getElementById(otherid)) return; 
cssjs('swap',document.getElementById(otherid),'javascript','javascriptyes');}}
cssjs('swap',document.getElementById(otherid),'javascript','javascriptyes');}}

function display(ide) {
document.getElementById(ide).style.display = "block";}

function hide(ide) {
document.getElementById(ide).style.display = "none";}

function checkCSS() {

//var el = document.body;

var el = document.getElementById('checkcss');

// if you want to use another element to check the applied style. Always use one
// style that is not the default one!

// in this case I am testing display value that should be 'none'
// if CSS is enabled and the stylesheet loaded. The span has usually a default 
// value of 'block' for this property.

if (document.uniqueID && el.currentStyle) { 
var checkappliedstyle = el.currentStyle.display; 
} else if(document.defaultView && document.defaultView.getComputedStyle){
var checkappliedstyle = document.defaultView.getComputedStyle(el, '').getPropertyValue("display");
} else if (document.all) {
var checkappliedstyle = document.all("checkcss").style.display;
}
if (checkappliedstyle == "none") {
var cssEnabled = 1; return true;} 
else {var cssEnabled = 0; return false;}
}


function createshowlink(text,ref,title,show,hide){
if (checkCSS()) {
document.write ('<a ');
document.write ('href="#' + ref +'" ' + 'title="' + title + '" ');
document.write('onclick="display(\''+ show +'\');hide(\''+ hide +'\')"');
document.write ('>');
document.write (text);
document.write ('</a>');
} else return;
}

function createinneroptions(innershow,ref,title,show,hide){
if (checkCSS()) {
document.write('<ul id="' + innershow + '" class="javascript">');
document.write ('<li><a href="#' + ref +'" ' + 'title="' + title + '" ');
document.write('onclick="display(\''+ show +'\');hide(\''+ hide +'\')"');
document.write ('>');
document.write (title);
document.write ('</li></a>');
document.write('<li><a href=#"'+ ref +'" onclick="change2display(\'none\')" title="Close all help boxes">Close all</a></li>');
document.write('<li><a href=#"'+ ref +'" onclick="change2display(\'block\')" title="Open all help boxes">Open all</a></li>');
document.write('</ul>');
} else return;
}

function createinneroption(innershow,ref,title,show,hide){
if (checkCSS()) {
document.write('<ul id="' + innershow + '" class="javascript">');
document.write ('<li><a href="#' + ref +'" ' + 'title="' + title + '" ');
document.write('onclick="display(\''+ show +'\');hide(\''+ hide +'\')"');
document.write ('>');
document.write (title);
document.write ('</li></a>');
document.write('</ul>');
} else return;
}


function createjscriptlink(text,ref,title,rel){
document.write ('<a ');
document.write ('href="' + ref +'" ' + 'title="' + title + '"' + 'rel="' + rel + '">');
document.write (text);
document.write ('</a>');
}
scrollbars= document.styleSheets[0].addRule("html", "behavior: url(scrollbars.htc)", 0);