
var current_vid;
 
function setNewFormActionMode(newMode){
    var s = document.forms[0].action.split('=');
	var action = "";
    for (i=0;i<s.length-1;i++){
	     action = action + s[i] + "=";
    }	
	document.forms[0].action = action + newMode; 
	tabModusForFilter = newMode;	
}


function expandSegThumb(action, id){
    if (action=='close') {
	    if (document.getElementById) {
            $('ThumbLayer_'+id).style.display = "none";
		}		
	} else {
        if (document.getElementById) {
            $('ThumbLayer_'+id).style.display = "inline";
	    }
	}
}

function getMouseX(e) {

if (document.layers) { //Netscape
	win_width = window.innerWidth;
	x= e.pageX-window.pageXOffset;
} else if (document.all) { //IE
	win_width = document.body.clientWidth;
	x=window.event.x ;
} else if (document.getElementById) {

	// Netscape 6 behaves the same as Netscape 4 in this regard
	win_width = window.innerWidth;
	x= e.pageX-window.pageXOffset;	
}

return x;
}

function getMouseY(e) {

if (document.layers) { //Netscape
	win_height = window.innerHeight;
	y= e.pageY-window.pageYOffset;
} else if (document.all) { //IE
	win_height = document.body.clientHeight;
	y=window.event.y ;
} else if (document.getElementById) {

	// Netscape 6 behaves the same as Netscape 4 in this regard
	win_height = window.innerHeight;
	y= e.pageY-window.pageYOffset;
}

return y;
}

function showTooltip(event,id,topOffset,leftOffset) {
  	
        tooltip = $(id);
        
        tooltip.style.marginTop = "22px"; 
 		
 		y = getMouseY(event);
 		
 		if (win_height/2 < y) {
 			 	 tooltip.style.marginTop = "-"+topOffset+"px";
 				 tooltip.style.y = y+20;
 			}else{
 			 	 tooltip.style.y = y-20;
 			}
 		
 		tooltip.style.left = leftOffset- $('Centerer').offsetLeft  +"px";
		tooltip.style.display = "inline";
		
}

function hideTooltip() {
    try {
        tooltip.style.display = "none";
    } catch (error) { 
	    error=null; 
	}
}

function showTooltipProfile(id,tid) {
    try {
        tooltip = $(id);
        tooltip.style.display = "inline";
        tooltip.style.left = "250px";
    } catch (error) { 
	    error=null; 
	}
}


