var pos_prev=0, pos=0, k=0, l=0, working=0; 
function moveRight(id) {
	if((-getCount(id))!=pos){
		if(((pos-1)!=getCount(id))&&(working==0)) {
			pos_prev=pos;
			pos--;
			right(id);
		}
	}
}
function right(id) {
	if((pos*208)!=(l-8)) {
		working=1;
		l=l-10;
		document.getElementById(id).style.left = l+"px";	
		setTimeout("right('"+id+"')", 1);
	} else {
		l=l-8;
		document.getElementById(id).style.left = l+"px";
		working=0;		
	}
}
function moveLeft(id) {
	if(pos!=0) {
		if(((pos+1)!=getCount(id))&&(working==0)) {
			working=1;
			pos_prev=pos;
			pos++;
			left(id);
		}
	}
}
function left(id) {
	if((pos*208)!=(l+8)) {
		l=l+10;
		document.getElementById(id).style.left = l+"px";	
		setTimeout("left('"+id+"')", 1);
	} else {
		l=l+8;
		document.getElementById(id).style.left = l+"px";
		working=0;		
	}
}
function getCount(id) {
	list=document.getElementById(id).childNodes;
	var count = 0;
	for(i=0, k=list.length; i<k; i++) {
		if(list[i].tagName && list[i].tagName.toLowerCase()=='li') count++;
	}
	count=count-3;
	if(count<0)count=0;
	return count;
}

var pos_prev2=0, pos2=0, k2=0, l2=0, working2=0; 
function moveRight2(id) {
	if((-getCount2(id))!=pos2){
		if(((pos2-1)!=getCount2(id))&&(working2==0)) {
			pos_prev2=pos2;
			pos2--;
			right2(id);
		}
	}
}
function right2(id) {
	if((pos2*208)!=(l2-8)) {
		working2=1;
		l2=l2-10;
		document.getElementById(id).style.left = l2+"px";	
		setTimeout("right2('"+id+"')", 1);
	} else {
		l2=l2-8;
		document.getElementById(id).style.left = l2+"px";
		working2=0;		
	}
}
function moveLeft2(id) {
	if(pos2!=0) {
		if(((pos2+1)!=getCount2(id))&&(working2==0)) {
			working2=1;
			pos_prev2=pos2;
			pos2++;
			left2(id);
		}
	}
}
function left2(id) {
	if((pos2*208)!=(l2+8)) {
		l2=l2+10;
		document.getElementById(id).style.left = l2+"px";	
		setTimeout("left2('"+id+"')", 1);
	} else {
		l2=l2+8;
		document.getElementById(id).style.left = l2+"px";
		working2=0;		
	}
}
function getCount2(id) {
	list=document.getElementById(id).childNodes;
	var count = 0;
	for(i=0, k=list.length; i<k; i++) {
		if(list[i].tagName && list[i].tagName.toLowerCase()=='li') count++;
	}
	count=count-3;
	return count;
}
function prof_close_zoom(){
	var p_shadow = document.getElementById('prof_shadow');
	var p_tv_screen = document.getElementById('prof_full_screen');
	var p_close = document.getElementById('prof_zoom_close');
//	p_tv_screen.removeChild(p_tv_screen.firstChild);
	p_shadow.style.display = 'none';
	p_tv_screen.style.display = 'none';
	p_close.style.display = 'none';
}			
function prof_zoom(url,text){
	var x=302, y=402;
	var p_shadow = document.getElementById('prof_shadow');
	var p_tv_screen = document.getElementById('prof_full_screen');
	var p_close = document.getElementById('prof_zoom_close');
	p_shadow.style.width = (x+220)+'px';
	p_shadow.style.height = (y+30)+'px';
	p_shadow.style.margin = (Math.round((y-410)/2))+'px 0 0 -'+Math.round((x+250)/2)+'px';
	p_shadow.style.top='50%';
	p_shadow.style.left='50%';
	p_tv_screen.style.width = x+'px';
	p_tv_screen.style.height = y+'px';
	p_tv_screen.style.margin = Math.round((y-400)/2)+'px 0 0 -'+Math.round((x+240)/2)+'px';
	p_tv_screen.style.top='50%';
	p_tv_screen.style.left='50%';
	p_close.style.top='50%';
	p_close.style.left='50%';
	p_close.style.margin = (Math.round(y/2)+170)+'px 0 0 '+(Math.round((x-40)/2)+60)+'px';
	p_shadow.style.display = 'block';
	p_tv_screen.style.display = 'block';
	p_close.style.display = 'block';
	document.getElementById('prof_img').src = url;
	document.getElementById('prof_text').innerHTML = text;
}
function prof_zoom_small(url,text){
	var x=302, y=402;
	var p_shadow = document.getElementById('prof_shadow');
	var p_tv_screen = document.getElementById('prof_full_screen');
	var p_close = document.getElementById('prof_zoom_close');
	p_shadow.style.width = (x+220)+'px';
	p_shadow.style.height = (y+30)+'px';
	p_shadow.style.margin = (Math.round((y-410)/2))+'px 0 0 -'+Math.round((x+250)/2)+'px';
	p_shadow.style.top='50%';
	p_shadow.style.left='50%';
	p_tv_screen.style.width = x+'px';
	p_tv_screen.style.height = y+'px';
	p_tv_screen.style.margin = Math.round((y-400)/2)+'px 0 0 -'+Math.round((x+240)/2)+'px';
	p_tv_screen.style.top='50%';
	p_tv_screen.style.left='50%';
	p_close.style.top='50%';
	p_close.style.left='50%';
	p_close.style.margin = (Math.round(y/2)+170)+'px 0 0 '+(Math.round((x-40)/2)+60)+'px';
	p_shadow.style.display = 'block';
	p_tv_screen.style.display = 'block';
	p_close.style.display = 'block';
	document.getElementById('prof_img').src = url;
	document.getElementById('prof_text').innerHTML = text;
}


function prof_zoom_small_float(url,img_w,img_h,text){
	if (img_w>img_h) {
	var x=302, y=402;
	var p_shadow = document.getElementById('prof_shadow');
	var p_tv_screen = document.getElementById('prof_full_screen');
	var p_close = document.getElementById('prof_zoom_close');
	var p_img = document.getElementById('prof_img_float');
	var p_text = document.getElementById('prof_text');
	p_shadow.style.width = (x+130)+'px';
	p_shadow.style.height = (y+30)+'px';
	p_shadow.style.margin = (Math.round((y-410)/2))+'px 0 0 -'+Math.round((x+250)/2)+'px';
	p_shadow.style.top='50%';
	p_shadow.style.left='50%';
	p_tv_screen.style.width = (x-90)+'px';
	p_tv_screen.style.height = y+'px';
	p_tv_screen.style.margin = Math.round((y-400)/2)+'px 0 0 -'+Math.round((x+240)/2)+'px';
	p_tv_screen.style.top='50%';
	p_tv_screen.style.left='50%';
	p_close.style.top='50%';
	p_close.style.left='50%';
	p_close.style.margin = (Math.round(y/2)+170)+'px 0 0 '+(Math.round((x-40)/2)-30)+'px';
	p_shadow.style.display = 'block';
	p_tv_screen.style.display = 'block';
	p_close.style.display = 'block';
	p_img.src = url;
	p_text.innerHTML = text;
	p_text.style.position = 'static';
	p_text.style.padding = '0px';
	p_text.style.margin = '10px 0px';
	p_text.style.width = '402px';
	} else prof_zoom_float(url,text);
}
function prof_zoom_float(url,text){
	var x=302, y=402;
	var p_shadow = document.getElementById('prof_shadow');
	var p_tv_screen = document.getElementById('prof_full_screen');
	var p_close = document.getElementById('prof_zoom_close');
	p_shadow.style.width = (x+220)+'px';
	p_shadow.style.height = (y+30)+'px';
	p_shadow.style.margin = (Math.round((y-410)/2))+'px 0 0 -'+Math.round((x+250)/2)+'px';
	p_shadow.style.top='50%';
	p_shadow.style.left='50%';
	p_tv_screen.style.width = x+'px';
	p_tv_screen.style.height = y+'px';
	p_tv_screen.style.margin = Math.round((y-400)/2)+'px 0 0 -'+Math.round((x+240)/2)+'px';
	p_tv_screen.style.top='50%';
	p_tv_screen.style.left='50%';
	p_close.style.top='50%';
	p_close.style.left='50%';
	p_close.style.margin = (Math.round(y/2)+170)+'px 0 0 '+(Math.round((x-40)/2)+60)+'px';
	p_shadow.style.display = 'block';
	p_tv_screen.style.display = 'block';
	p_close.style.display = 'block';
	document.getElementById('prof_img_float').src = url;
	var p_text = document.getElementById('prof_text');
	p_text.innerHTML = text;
	p_text.style.position = '';
	p_text.style.padding = '110px 0 0 0';
	p_text.style.margin = '10px 0px';
	p_text.style.width = '140px';
}
