var y = 0;
var dest_y = 0;
var interval3 = 50;

if(tab == 0){
	document.getElementById("transparent").style.marginTop = '-477px';	
	document.getElementById("slidebut").style.backgroundPosition = 'center -16px';
}else{
	document.getElementById("transparent").style.marginTop = '0px';
	document.getElementById("slidebut").style.backgroundPosition = 'center 0';
}

function movetab() {
	
	//alert(document.getElementById("transparent").style.marginTop);
	
	if (document.getElementById("transparent").style.marginTop == '0px'){
         y = 0; 
         dest_y = -477;
		 movetabUp();
		
		 
	}else if(document.getElementById("transparent").style.marginTop == '-477px'){
		 y = -477;
         dest_y = 0;
	     movetabDown();
		 
	}
}

function movetab2() {
	
		if(tab ==0){
		
			y = -477;
         	dest_y = 0;
	     	movetabDown();
		
		}
}

function movetabUp() {
	
	    		

		//Keep on moving the image till the target is achieved
		if(y>dest_y) y = y - interval3; 
				
		//Move the image to the new location
		document.getElementById("transparent").style.marginTop =  y+'px';
			
		if (y-interval3 > dest_y) {
			//Keep on calling this function every 10 microsecond 
			//	till the target location is reached
			window.setTimeout('movetabUp()',5);
		}else{
			
			tab = 0;
			POSTRequest('tab=0');
			
			document.getElementById("transparent").style.marginTop =  dest_y+'px';
			document.getElementById("slidebut").style.backgroundPosition = 'center -16px';
				
		}

}

function movetabDown() {
	
	    

			//Keep on moving the image till the target is achieved
			if(y<dest_y) y = y + interval3; 
					
			//Move the image to the new location
			document.getElementById("transparent").style.marginTop =  y+'px';
				
			if (y+interval3 < dest_y) {
				//Keep on calling this function every 10 microsecond 
				//	till the target location is reached
				window.setTimeout('movetabDown()',5);
			}else{
				
				tab = 1;
				POSTRequest('tab=1');
				
				document.getElementById("transparent").style.marginTop =  dest_y+'px';
				document.getElementById("slidebut").style.backgroundPosition = 'center 0';
					
			}
		


}


