//----------------------------------------------------------------------------------------------
// Author Lucian Plesnicute - Webstarsltd (except Intellisense functions)
//----------------------------------------------------------------------------------------------

 //----------------------------------------------------------------------------------------------
var pmp3_last_item = null;

function play_mp3(file,item) {
	
	if(pmp3_last_item == item){
		 ph_player.stop();
		$(item).attr("src",config_dir+"images/play.gif");
		 pmp3_last_item = null;
	}
	else {
	  ph_player.file = file;
	  ph_player.play();	
	  $(item).attr("src",config_dir+"images/pause.gif");	 
	  $(pmp3_last_item).attr("src",config_dir+"images/play.gif");	 
	  pmp3_last_item = item;
	}
	
	
}


							   
   //---------------------------------------------------------------------------------------------
   // Intellisense function 
   //---------------------------------------------------------------------------------------------
							   
		/*$(".dictwords").mousemove(function(){
		   alert("asda");
			pos = findPos(this,$(this).width());
			$(this).children().show();
			$(this).children().css('position','absolute');
			$(this).children().css('left', pos[0]);
			$(this).children().css('top', pos[1]);
			$(this).children().css('width', 200);
			$(this).children().css('background-color', 'white');
			$(this).children().css('border', '1px dashed gray');
			$(this).children().css('color', 'green');
			$(this).children().css('padding', '5px');
		});
		
		$(".dictwords").mouseout(function(){
			$(this).children().hide();
		});*/


   function dic_over(item){
			pos = findPos(item,$(item).width());
			$(item).children().show();			
			$(item).children().css('left', pos[0]);
			$(item).children().css('top', pos[1]);
			$(item).children().css('width', 200);
   }
   
   function dic_out(item){
	   $(item).children().hide();
   }

   //---------------------------------------------------------------------------------------------
   // Intellisense function
   //---------------------------------------------------------------------------------------------

	function findPos(obj,w) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
/*			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}*/
		}
		return [curleft+w,curtop];
	}

   //---------------------------------------------------------------------------------------------
  function listpage(pageid){
	  
	   $.post("/ph_functs/listpage.php",{
			  	"pageid":pageid
			  },function(responseText)
			  {
			   var page = responseText.split("<[]>");	  
			   
			    pageHistory[cur_operation][0] = document.getElementById("ID_MODULE_TITLE").innerHTML;
				pageHistory[cur_operation][1] = document.getElementById("ID_MODULE_CONTENT").innerHTML;
				
			    cur_operation = 1;
				
			   document.getElementById("ID_MODULE_TITLE").innerHTML = page[0];
			   document.getElementById("ID_MODULE_CONTENT").innerHTML = page[1];
			    document.getElementById("ID_PREV").innerHTML = "Back to "+pageHistory[cur_operation-1][0];
		       document.getElementById("ID_PREV").style.display = "block"; 
               document.title =page[0];
		      });				
  }
  
$(document).ready(function() {
	
});
  
