<!-- 
/*
 JS Script by PTNunn. 
 Generic animation functions. 10/07/08
*/ 

var i = 0;

function nap(k){
	
	if( k < 3 ){
		setTimeout(nap(k), 100);
		i++;
	}
}

function hideit(){

	var divs = document.getElementsByTagName('div');	
	for(i=0;i< (divs.length); i++){
			if (divs[i].id != "ctrl" ){				
				if( divs[i].style.visibility == "hidden"){
					divs[i].style.visibility="visible";
					}
				else
					divs[i].style.visibility="hidden";
			}
	}
 }   
  
function getCoords (element) {
	var coords = { x: 0, y: 0, width: element.offsetWidth, height: element.offsetHeight };
	while (element) {
		coords.x += element.offsetLeft;
		coords.y += element.offsetTop;
		element = element.offsetParent;
	}
	return coords;
}

function go2it(divid, xpos, ypos){
	var targetdiv = document.getElementById(divid);
	
	if(targetdiv){
		targetdiv.style.left = xpos + "px";
		targetdiv.style.top = ypos +"px";
	}
}

     

function moveit(divid, xpos, ypos){
	var targetdiv = document.getElementById(divid);
	var coords = getCoords(document.getElementById(divid)); 	
	
	var divleft= coords.x;
	var divtop = coords.y;
	
	var newleft = divleft + xpos;
	var newtop = divtop + ypos;
	
	if(targetdiv){
		targetdiv.style.left = newleft+"px";
		targetdiv.style.top = newtop +"px";
	}
}

function animbttmright(divid){
	var targetdiv = document.getElementById(divid);
	var i=0, x=0, y=0;
	
	for( i=1; i <= 50; i++){
		y = i/4;
		x = i/2;
		setTimeout( "moveit('"+ divid +"',"+ x +"," + y + ")", i*20); 		
	}
}
		
function animtopleft(divid){
	var targetdiv = document.getElementById(divid);
	var coords = getCoords(document.getElementById(divid)); 	
	
	var x = coords.x;
	var y = coords.y;
	var i=0;
	
	for( i =0; i < 100; i++){
		y = y - 10;
		x = x -20;	
		setTimeout( "go2it('"+ divid +"',"+ x +"," + y + ")", i*20); 	
	}
}
		
function setcolor(divid, colorstr){
			var targetdiv = document.getElementById(divid);
			
			targetdiv.style.color= colorstr;
}
		
function colorit(divid){
	var targetdiv = document.getElementById(divid);
	var i, j, k;
	var colorstr;
	var hexset= new Array('0','1','2','3','4','5','6','7','8','9','a', 'b','c','d','e','f');
	
	for( i=0; i < 16; i++){	
		for( j=0; j < 16; j++){	
			for( k=0; k < 16; k++){
				colorstr = "#" + i + i + j + j + k + k;
				//setTimeout("setcolor('"+ divid + "', '" + colorstr + "' )", 30);
				setcolor( divid , colorstr );
				nap(10);
			}
		}
		
	}
}
 
// for( i=0; k < 256 ; i++){
	//			colorstr = "rgb(" + i + "," + i + "," + i + " )";
		//		setTimeout("setcolor('"+ divid + "', '" + colorstr + "' )", 30*1);
			//}
  
-->




