// JavaScript Document

	for (Index=1;Index<8;Index++){
	   my_item="itm_"+Index;
	   my_pic="pic_"+Index;
	   //for background
	   Event.observe($(my_item), 'mouseover', over, false);
	   Event.observe($(my_item), 'mouseout', out, false);
	   Event.observe($(my_item), 'click', chPage, false);
       //for image title 
	   Event.observe($(my_pic), 'mouseover', over, false);
	   Event.observe($(my_pic), 'mouseout', out, false);
	   Event.observe($(my_pic), 'click', chPage, false);
	
	}

	var Last_Id=0;
	var Last_click=0;
	var addreses= new Array ("","myPoem.php","myBlog.php?id=1","myIdea.php?id=3","myReport.php?id=1","mainArticle.php?id=1","pprofile.php","index.php");
	
	function chPage(e){
	 caller_id=Event.element(e).id;
	 my_link=caller_id.substr (4,2);
	 my_add=addreses[my_link];
	 location=my_add;
	}
	
	function over(e){
	  var myFlag=false;
	  var myIdx;
	  
	  caller_id=Event.element(e).id;
	  if (caller_id.substr (0,4)=="pic_"){
	    caller_id="itm_"+caller_id.substr (4,2);
	  }
	  
	  
	  if (caller_id!=Last_Id && caller_id!=main_page_id) {
		  //alert(main_page_id);
		  $(caller_id).style.backgroundImage ="url('images/tab_red.gif')";
		  //alert(caller_id);
	  }
	
	  Last_Id=caller_id;
	  
	}

	function out(e){
	  caller_id=Event.element(e).id;
	  if (caller_id.substr (0,4)=="pic_"){
	    caller_id="itm_"+caller_id.substr (4,2);
	  }
	  
	  if (caller_id!=main_page_id){
	   $(caller_id).style.backgroundImage = "url('images/tab_blue.gif')";
	   Last_Id=0; 
	  }
	}
