// JavaScript Document

function timer(nMins, sMsg, sRedirTo) {
    if ( isNaN(nMins) ) { nMins = 60; }
    // alert( 'Hello World: '+sMsg+': '+nMins+': '+sRedirTo );
    
    nLimit = nMins * 60 * 1000;
    sCmd = 'alert(\''+ sMsg + '\');window.location=\'' + sRedirTo +'\'';
    // alert( sCmd );
    setTimeout(sCmd ,nLimit);
}

function MM_reloadPage(init) {  //Updated by PVII. Reloads the window if Nav4 resized

	if (init==true) with (navigator) {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth;
			document.MM_pgH=innerHeight;
			onresize=MM_reloadPage;
		}
	}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) {
		history.go(0);
	}
}

MM_reloadPage(true);

function P7_swapClass()
{ //v1.4 by PVII
	var i,x,tB,j=0;
	tA=new Array();

//    alert (this.id);
//    this.id = 'p7current';

	// unload all arguments to an array
	arg=P7_swapClass.arguments;

 	// only do something we can read tags by their name
	if(document.getElementsByTagName) {

		// all arguments from the 5th onwards are TAGS we must work on
		// typically we will limit ourselves to one TAG at a time
		for(i=4;i<arg.length;i++) {

			// fill an array with all the TAGs of THIS type
			tB=document.getElementsByTagName(arg[i]);

			// copy the array
			for(x=0;x<tB.length;x++) {
				tA[j]=tB[x];
				j++;
			}
		}

		// for each TAG of THIS type
		for(i=0;i<tA.length;i++) {

			// only process if it has "class"
			if(tA[i].className) {

				// if ID matches with 2nd arg
				if(tA[i].id==arg[1]) {

					// and 1st arg is 1
					if(arg[0]==1) {

						// swap classes listed as 3rd and 4th args
						tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
					}

					// if 1st arg is 0
					else {

						// set class to be the one listed in the 3rd arg
						tA[i].className=arg[2];
					}
				}

				// if ID does NOT matche with 2nd arg
				// but 1st arg is 1 and 2nd arg is 'none'
				else if(arg[0]==1 && arg[1]=='none') {

					// and the classname is the same as either the 3rd or the 4th arg
					if(tA[i].className==arg[2] || tA[i].className==arg[3]) {

						// then swap classes listed as 3rd and 4th args
						tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
					}
				}

				// if ID does NOT matche with 2nd arg
				// and (1st arg is 0 or 2nd arg is not 'none')
				// but classname is the one listed as 3rd argment
				else if(tA[i].className==arg[2]) {
					
					// then set classname to be the same as 4th argument
					tA[i].className=arg[3];
				}
			}
		}
	}
}
