// JavaScript Document

// --- START Image Preload -- //

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// --- START Image Swapping Functions NO.1 -- //

//here you place the ids of every element you want.
var ids=new Array('a1','a2');

function switchid(id,currentclass){	
	
	current = id;
	hideallids();
	showdiv(id);
	hideallths();
	showclass(currentclass);
	
}

function nextid(id){	
	
	if (ids1.length == parseFloat(current.slice(1,3)))
		{	
			current = 'a1';
			currentclass = 't1';
			hideallids();
			showdiv(current);
			hideallths();
			showclass(currentclass);
		} 
		else
		{
			
			current = ('a'+(parseFloat(current.slice(1,3))+1)); 
			currentclass = ('t'+(parseFloat(current.slice(1,3)))); 
			hideallids();
			showdiv(current);
			hideallths();
			showclass(currentclass);
		}
	
}

function previousid(id){	
	
	if (current == 'a1')
		{	
			current = 'a' + ids1.length;
			currentclass = 't' + ths1.length;
			hideallids();
			showdiv(current);
			hideallths();
			showclass(currentclass);
		} 
		else
		{
			
			current = ('a'+(parseFloat(current.slice(1,3))-1)); 
			currentclass = ('t'+(parseFloat(current.slice(1,3)))); 
			hideallids();
			showdiv(current);
			hideallths();
			showclass(currentclass);
		}
	
}

function hideallths(){
	for (var i=0;i<ths1.length;i++){
		hideclass(ths1[i]);
	}	
}
	
function hideclass(id){
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).className = "unselected";
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.className = "unselected";
		}
		else { // IE 4
			document.all.id.className = "unselected";
		}
	}
}

function showclass(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).className = "selected";
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.className = "selected";
		}
		else { // IE 4
			document.all.id.className = "selected";
		}
	}
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids1.length;i++){
		hidediv(ids1[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
// --- END Image Swapping Functions NO.1 -- //

