


//======================================================================
//----------------Globals------------------------------------
//======================================================================


_fade_tip_divo_timeset = null;

//-------------------------------------------------------------------------------------
//==========================END GLOBALS=====================================
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------












//======================================================================
//----------------ROLLOVER FUNCTIONS------------------------------------
//======================================================================



function show_tip_divo(){

if (_fade_tip_divo_timeset) window.clearTimeout(_fade_tip_divo_timeset);

span_obj = document.getElementById("tip_span");
div_obj = document.getElementById("tip_divo");

x = GetX(span_obj);
y = GetY(span_obj);

w = GetWidth(div_obj);
h = GetHeight(div_obj);



div_obj.style.left = x+w-40 + 'px';
div_obj.style.top = y + 'px';

div_obj.style.visibility = 'visible';


}



function fade_tip_divo(){

//document.getElementById('tip_divo').style.visibility = 'hidden'

_fade_tip_divo_timeset = window.setTimeout("document.getElementById('tip_divo').style.visibility = 'hidden'",500);


}





function td_over(obj){

//obj = document.getElementById(id);

obj.style.background = '#736F64';

if (_fade_tip_divo_timeset) window.clearTimeout(_fade_tip_divo_timeset);


}



function td_out(obj){

//obj = document.getElementById(id);
obj.style.background = 'gray';

}


function set_indio(){

search_obj = document.getElementById('searchh');

indi_obj = document.getElementById('indi_divo');


x = GetX(search_obj);
y = GetY(search_obj);


w = GetWidth(search_obj);
h = GetHeight(search_obj);



indi_obj.style.left = x+w + 20 + 'px';
indi_obj.style.top = y + 'px';





}






//-------------------------------------------------------------------------------------
//==========================END ROLLOVER FUNCTIONS=====================================
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------










//-------------------------------------------------------------------------------------
//==========================CLICKING FUNCTIONS=====================================
//-------------------------------------------------------------------------------------




function show_comments(click_id,open_html,comments_id){

click_obj = document.getElementById(click_id);
div_obj = document.getElementById(comments_id);

x = GetX(click_obj);
y = GetY(click_obj);

w = GetWidth(click_obj);
h = GetHeight(click_obj);

div_obj.style.left = x+(0.5*w)-100 + 'px';
div_obj.style.top = y + 50 + 'px';

new Effect.BlindDown(comments_id);

click_obj.innerHTML = open_html;

}



function close_comments(click_id, closed_html,comments_id){

new Effect.BlindUp(comments_id);

$(click_id).innerHTML = closed_html;


}




function open_comments_preview(commentbox_id, previewbox_id){


commentbox_obj = document.getElementById(commentbox_id);
previewbox_obj = document.getElementById(previewbox_id);

x = GetX(commentbox_obj);
y = GetY(commentbox_obj);

w = GetWidth(commentbox_obj);
h = GetHeight(commentbox_obj);

previewbox_obj.style.left = x+100 + 'px';
previewbox_obj.style.top = y+100 + 'px';

new Effect.BlindDown(previewbox_id);


}



function close_comments_preview(previewbox_id){

new Effect.BlindUp(previewbox_id);

}







//-------------------------------------------------------------------------------------
//==========================END CLICKING FUNCTIONS=====================================
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------













//-------------------------------------------------------------------------------------
//===========================HELPER FUNCTIONS==========================================
//-------------------------------------------------------------------------------------



//==========Get Width ofHTML element===============
function GetWidth (obj){

  var width = obj.offsetWidth;
  return width;
	
}



//==========Get Height of HTML element=============
function GetHeight (obj){

  var height = obj.offsetHeight;
  return height;

}


//==========Get Coords of HTML element=============

function GetX (obj){
  var x = 0;
  do{
    x += obj.offsetLeft;
    obj = obj.offsetParent;
  }
  while (obj);
  return x;
}

function GetXat (obj, elm){

  var x = 0;
  while (obj){
    x += obj.offsetLeft;
    obj = obj.offsetParent;
    }
    if (obj == elm)
    return x;
  return x - cmGetX (elm);

   
}


function GetY (obj){
  var y = 0;
  do{
    y += obj.offsetTop;
    obj = obj.offsetParent;
  }
  while (obj);
  return y;
}

//----------End Get Coords of HTML element---------



//-------------------------------------------------------------------------------------
//==========================END HELPER FUNCTIONS=====================================
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------














//-------------------------------------------------------------------------------------
//==========================UPDATING FUNCTIONS=====================================
//-------------------------------------------------------------------------------------




//-------------------------------------------------------------------------------------
//==========================END UPDATING FUNCTIONS=====================================
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------









//========LEFTOVERS===============






  //--set tip_div location
  /*  
	var body = document.body;
	var browserLeft;
	var browserRight;
	var browserTop;
	var browserBottom;


	if (window.innerWidth)
	{
		// DOM window attributes
		browserLeft = window.pageXOffset;
		browserRight = window.innerWidth + browserLeft;
		browserTop = window.pageYOffset;
		browserBottom = window.innerHeight + browserTop;

	}
	else if (body.clientWidth)
	{
		// IE attributes
		browserLeft = body.clientLeft;
		browserRight = body.clientWidth + browserLeft;
		browserTop = body.clientTop;
		browserBottom = body.clientHeight + browserTop;

	}
  */


function pause(millis) 
{
date = new Date();
var curDate = null;

do { var curDate = new Date(); } 
while(curDate-date < millis);
} 





