function getElement(elID)
{
    return (document.getElementById) ?
        document.getElementById(elID) : document.all[elID];
}

function getIFrame(frameID){ 
    var rv = null; 
    var frame=getElement(frameID);
    // if contentDocument exists, W3C compliant (e.g. Mozilla) 

    if (frame.contentDocument)
        rv = frame.contentDocument;
    else // bad IE  ;)

        rv = document.frames[frameID].document;
    return rv;
}

function adjustFrameHeight(frameID)
{
    var frame = getElement(frameID);
    var frameDoc = getIFrame(frameID);
    
    var content = frame.contentWindow.document.body.innerHTML;  
    //alert(content);
    frame.contentWindow.document.body.innerHTML = "<div id='fcontainer'>" + frame.contentWindow.document.body.innerHTML + '</div>';  
    //window.alert(frame.contentWindow.document.body.offsetHeight);
    
    var fcont = frame.contentWindow.document.getElementById('fcontainer');
    //alert(fcont.offsetHeight);

    frame.height = fcont.offsetHeight + 20;
    
    
}
function adjustFrameHeight02(frameID, elID)
{
    var frame = getElement(frameID);
    var el = frame.contentWindow.document.getElementById(elID);
    frame.height = el.offsetHeight;    
}

function hidehelp_root(preview_el, close_el, framepreview_el)
{
	el1 = document.getElementById(preview_el);
	el1.innerHTML  = '';
	el1.style.display = "none";
	el2 = document.getElementById(close_el);
	el2.style.display = "none";
	el3 = document.getElementById(framepreview_el);
	el3.style.display = "none";
}
function showhelp_root(e, preview_el, close_el, framepreview_el, num) {
  var helptext=new Array();
  
  for (i = 1; i <= 200; i++) {
    helptext[i] = i;
  }
  helptext[1] = "<span class='highlight'>Abstract:</span> Embodied artificial intelligence argues that the body and brain play equally important roles in the generation of adaptive behavior. This raises the question then of not only what brain, but also what body is appropriate for a given task. An increasingly common approach therefore is to evolve an agent's morphology along with its control in the hope that evolution will find a good coupled system. In order for embodied artificial intelligence to gain credibility within the robotics and cognitive science communities however, it is necessary to amass evidence not only for *how* to co-optimize morphology and control of adaptive machines, but *why*. This presentation will describe two new lines of evidence for why this co-optimization is useful: I will show that as task difficulty increases, there is an increasing benefit to evolving more aspects of a robot's body; and that co-optimizing a robot's body and controller leads to the discovery of legged locomotion faster than if only the robot's controller is optimized.<br /><br /><span class='highlight'>A relevant forthcoming paper:</span><br /><a href='http://www.cs.uvm.edu/~jbongard/temp/2009_ALife_Bongard.pdf' target='_blank'>http://www.cs.uvm.edu/~jbongard/temp/2009_ALife_Bongard.pdf</a>";
  helptext[2] = "<span class='highlight'>Abstract:</span> Most theories of cognitive development are \"cognitive\"  in the sense of being about internal models, propositions, and inferences.  It is not at all clear that these theories can explain real world learning.   Children learn in a physical world - about objects, actions, other social beings, and language -- through their second-by-second, minute-by-minute sensorimotor interactions in that work.  They create their own experiences through their own actions. This talk considers how the body -and physical actions -may play a special role in -and indeed simplify - learning objet names.  The body's momentary actions and appear to play a direct role in what might seem to be cognitive operations - attention and binding bind objects in the physical environment to internal cognitive operations. The domain used to illustrate these points is toddler word learning.  Using tiny video-cameras placed low on the forehead of the child to capture the dynamic first person view, measures of eye-gaze direction, motion sensors on heads and hands, and success in word learning tasks, the experiments shows learning that is inseparable from -and made in - embodied interaction in the world.";
  helptext[3] = '<span class=\'highlight\'>Abstract:</span> Cognitive Development and the iCub Humanoid Robot<br /><br />In this talk we consider the role of humanoid robotics in cognition research and we discuss in particular the iCub humanoid robot, the motivation for its creation, the specific paradigm of cognition that has been adopted in its design, and we address the attendant phylogenetic and ontogenetic implications from both neuro-physiological and psychological perspectives. We consider what development means in this context and we provide an overview of the progress that has been made so far.<br /><br />The iCub is a humanoid robot R&D platform for modelling the development of cognitive capabilities.  It was created by the recently-completed RobotCub project1 as a freely-available open system to be used by research groups across Europe and elsewhere.  To date, fifteen robots have been shipped and a further five are in production.  This has created an extensive community of users and developers who all share their work, and specifically their software, on the iCub website.   By developing on a common platform, results can be directly replicated, evaluated, and improved by other R&D teams.<br /><br />One of the chief tenets underlying the design of the iCub that action is the organizing principle in cognitive behaviour and, in particular, that manipulation plays a key role in this development. As such, the complexity and sophistication of cognitive behaviour is dependent on the richness and diversity of the perceptual and motoric repertoire. Consequently, the design of the iCub was aimed at maximizing the number of degrees of freedom of the upper part of the body (head, torso, arms, and hands). The lower body (legs) supports crawling on arms and legs and sitting on the ground in a stable position. This allows the robot to explore the environment and to grasp and manipulate objects on the floor. The total number of degrees of freedom is 53 (7 for each arm, 9 for each hand, 6 for the head and 3 for the torso and spine). Each leg has a further 6 degrees of freedom. The sensory system includes binocular vision and haptic, cutaneous, aural, and vestibular sensors.<br /><br />Whilst the iCub can support any cognition paradigm, it was designed with the specific objective of furthering the enactive systems paradigm.   Enaction is based on five central principles: embodiment, experience, emergence, autonomy, and sense-making.  Cognition is the process by which the issues that are important for the continued operation of a cognitive entity are brought out or enacted: co-determined and co-developed by the entity as it interacts with the environment in which it is embedded. An enactive cognitive agent is embodied and embedded in the environment and is specified by it. At the same time, the process of cognition determines what is real or meaningful for the agent. Ultimately, this means that the system’s perceptions reflect those actions which are consistent with the maintenance of the system\'s autonomy. Thus, an enactive cognitive agent constructs its reality as a result of its operation in that world and therefore cognitive understanding is intrinsically specific to the embodiment of the system and dependent on the system’s history of interactions, i.e., its experiences. Thus, nothing is ‘pre-given’. Instead there is an enactive interpretation: a real-time context-based choosing of relevance. This is often referred to as \'sense-making\'. For enactive systems, the purpose of cognition is to uncover unspecified regularity and order that can then be construed as meaningful because they facilitate the continuing operation, development, and autonomy of the cognitive system.<br /><br />The iCub’s software – encapsulating its perception-action skills – was and continues to be developed on the basis of an extensive roadmap for the development of cognitive capabilities.  This roadmap is founded on the phylogeny and ontogeny of natural cognitive systems, embracing the perspectives of both neuro-physiology and developmental psychology.  The roadmap asserts the dual purpose of development to improve the prospective capability of the cognitive system and the consequent expansion of its space of effective actions. It also identifies the key features that a system capable of cognitive development should exhibit and, in particular, it identifies the requisite constituents of the iCub phylogeny and sets out several scenarios for the iCub’s ontogeny.<br /><br />In this talk, we illustrate the foregoing issues by considering the progress that has been made to date in using the iCub to develop cognitive capabilities, addressing, for example, selective visual and aural attention, sensorimotor coordination, learning to reaching & grasp, learning affordances, locomotion, imitation and social interaction, as well as their relationship to the iCub cognitive architecture.<br /><br />For more information on the iCub, please refer to the iCub and RobotCub websites: <a href="http://www.icub.org">www.icub.org</a> and <a href="http://www.robotcub.org">www.robotcub.org</a>. ';
  helptext[4] = '<span class=\'highlight\'>Abstract:</span> The question of how we perceive and interact with the world around us has been at the heart of cognitive and neuroscience research for the last decades. Despite tremendous advances in the field of computational vision – made possible by the development of powerful learning techniques as well as the existence of large amounts of labeled training data for harvesting - artificial systems have yet to reach human performance levels and generalization capabilities. In this contribution we want to highlight some recent results from perceptual studies that could help to bring artificial systems a few steps closer to this grand goal. In particular, we focus on the issue of spatio-temporal object representations (dynamic faces), face synthesis, as well as the need for taking into account multi-sensory data in models of object categorization. In all of these perceptual research lines, the underlying research philosophy was to combine the latest tools in computer vision, computer graphics, and computer simulations in order to gain a deeper understanding of recognition and categorization in the human brain. Conversely, we discuss how the perceptual results can feed back into the design of better and more efficient tools for artificial systems.';
  
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
  
    posx = posx - 320;
  
   el1 = document.getElementById(preview_el);
   el1.style.left = posx + 'px';
   el1.style.top = posy + 'px';
   el1.style.width = '310px';
   el1.style.height = '350px';
   //αν πρόκειται για μήνυμα της δήλωσης
   el1.innerHTML  = '<p style="margin: 2px; padding: 2px; text-align: justify;"><span style="font-size: 100%;">' + helptext[num] + '</span></p>';

   closex = posx + 330;
   closey = posy;

   if (num == 1) {
     el1.style.height = '430px';
   } else if (num == 2) {
     el1.style.height = '430px';
   } else if (num == 3) {
     el1.style.height = '430px';
     el1.style.width = '510px';
     closex = posx + 532;
   } else if (num == 4) {
     el1.style.height = '430px';
   }

   el2 = document.getElementById(close_el);
   el2.style.left =  closex + 'px';
   el2.style.top = closey + 'px';

   el3 = document.getElementById(framepreview_el);
   el3.style.left = posx + 'px';
   el3.style.top = posy + 'px';
   el3.style.width = '315px';
   el3.style.height = '100px';



   el1.style.display = "block";
   el2.style.display = "block";
   el3.style.display = "block";
   //el4 = document.getElementById("helpid");
   //el4.focus();


	// posx and posy contain the mouse position relative to the document
	// Do something with this information
}

