var rm ; //needs global declaration to use readmore feature site wide.
function readMore(caller,id)
{
//alert(event.srcElement.id);
	if(typeof(rm) != 'object')
	{rm = new Spry.Effect.Blind(id, {duration: 2000, from: '270px', to: document.getElementById(id).scrollHeight+'px', toggle: true});}
	rm.start();

	// now do the image swapping
	//var caller = event.srcElement;
	if(caller!=null){
	if(caller.className=='readmore_expand'){caller.className = 'readmore_collapse';}
	else{caller.className = 'readmore_expand';}}
}

//function to show or not the readmore link/image
function checkHeight(caller, id)
{
	var maxheight = document.getElementById(id).scrollHeight;
	if(maxheight > 275){caller.style.display = 'block';}
}

// function for the login process..
function activateajax()
{
    document.getElementById('ajaxbox').style.display='block';
    document.getElementById('ajaxmsg').style.display='block';
    setTimeout(reloadimg,100);
}
function reloadimg()
{
    if (document.images["ajaximg"]) 
    {
	    document.images["ajaximg"].src = document.images["ajaximg"].src;
    }
}

function addOnloadEvent(fnc){
  if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", fnc, false );
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else
      window.onload = fnc;
  }
}

