/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------- GENERAL --------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function fetchItem(arr,col,row,id,mode)
{
  for(i=0;i<arr.length;i++)
  {
	if(mode=="next")
    {
      if(document.getElementById("arthro_"+arr[i]).style.display!="none")
	  { 
	    if(arr[i+1])
		{
	      document.getElementById("arthro_"+arr[i]).style.display="none";
	      document.getElementById("arthro_"+arr[i+1]).style.display="block";
		  return;
		}
	  }
    }
    else
    {
      if(document.getElementById("arthro_"+arr[i]).style.display!="none")
	  {
	    if(arr[i-1])
		{
	      document.getElementById("arthro_"+arr[i]).style.display="none";
	      document.getElementById("arthro_"+arr[i-1]).style.display="block";
		  return;
		}
	  }
    }
  }
  
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function fetchItem2(arr,id,mode)
{
  for(i=0;i<arr.length;i++)
  {
	if(mode=="next")
    {
      if(document.getElementById("gegonos_"+arr[i]).style.display!="none")
	  { 
	    if(arr[i+1])
		{
	      document.getElementById("gegonos_"+arr[i]).style.display="none";
	      document.getElementById("gegonos_"+arr[i+1]).style.display="block";
		  return;
		}
	  }
    }
    else
    {
      if(document.getElementById("gegonos_"+arr[i]).style.display!="none")
	  {
	    if(arr[i-1])
		{
	      document.getElementById("gegonos_"+arr[i]).style.display="none";
	      document.getElementById("gegonos_"+arr[i-1]).style.display="block";
		  return;
		}
	  }
    }
  }
  
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function two(obj)
{ 
  chImgN(obj);
  displayN(obj);
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function chImgN(obj)
{
  if(obj.src)
  {
    if(obj.src.indexOf("minus")!=-1){obj.src="layout/plus.gif";}
    else if(obj.src.indexOf("plus")!=-1){obj.src="layout/minus.gif";}
  }
  else{;}
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function displayN(ind)
{
  
  var k=ids.length; 
  
  if(document.getElementById("i_"+ids[ind]).src)
  { 
    if(document.getElementById("i_"+ids[ind]).src.indexOf("minus")==-1) 
	{ 
	  for(var i=0;i<k;i++)
      {
	    if(pids[i]==ids[ind])
	    { 
	      document.getElementById("id"+ids[i]).className=" show_node wrap";
	      
	    }
	  }
    }
  }	
  
  /*if(document.getElementById("xi_"+ids[ind]))
  {
    if(document.getElementById("xi_"+ids[ind]).src)
    { 
      if(document.getElementById("xi_"+ids[ind]).src.indexOf("minus")==-1) 
	  { 
	    for(var i=0;i<k;i++)
        {
	      if(pids[i]==ids[ind])
	      { 
	        document.getElementById("xid"+ids[i]).className=" show_node z_index no_wrap";
	      } 
	    }
	  }
    }
  }*/

  for(var i=0;i<k;i++)
  {
    if((vathoi[i]!="0")&&(pids[i]!=pids[ind])&&(pids[i]!=ids[ind]))
	{ 
	  if(document.getElementById("id"+ids[i]))
	  {
	    if(document.getElementById("id"+ids[i]).className)
	    {
	      document.getElementById("id"+ids[i]).className=" hide_node"; 
	    }	
	  }	
	}
  }
  
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//IE only
function mySetAttribute(node, name, value) 
{
  var l=node.attributes.length;
  var i=0;
  while(node.attributes[i])
  {
    if (node.attributes[i].name == name)
    {
      node.attributes[i].value = value;
    }
	i++;
  }
} 
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------- GENERAL --------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------- SELIDES --------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function MakeChild(new_sel_p_id,new_sel_g_id,new_sel_vathos,new_sel_id_path)
{
  document.getElementById("txt_selida_p_id").value=new_sel_p_id;
  document.getElementById("txt_selida_g_id").value=new_sel_g_id;
  document.getElementById("txt_selida_vathos").value=new_sel_vathos;
  document.getElementById("txt_selida_id_path").value=new_sel_id_path;
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------- SELIDES --------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------- NEA --------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/



/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function MakeChild2(new_sel_p_id,new_sel_vathos,new_sel_id_path)
{
  document.getElementById("txt_neo_p_id").value=new_sel_p_id;
  document.getElementById("txt_neo_vathos").value=new_sel_vathos;
  document.getElementById("txt_neo_id_path").value=new_sel_id_path;
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------- NEA --------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------- ARTHRA ---------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function epilogiArthro(id)
{
  if(window.opener.document.getElementById("txt_s_a_arthro_id"))
  {
    window.opener.document.getElementById("txt_s_a_arthro_id").value=id;
  }
  else
  {
    window.opener.document.getElementById("txt_k_a_arthro_id").value=id;
  }
  window.opener.document.getElementById("txt_state").innerHTML="<span style='color:#00FF00;font-weight:bold'> ΟΚ </span>";
  window.close();
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function MakeColor(inputId,viewId)
{
  var str=document.getElementById(inputId).value;
  if(str.match(/^#[0-9a-fA-F]{6}$/))
  { 
    //alert("allo");
    document.getElementById(viewId).style.color=document.getElementById(inputId).value;
  }
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function MakeBgcolor(inputId,viewId)
{
  var str=document.getElementById(inputId).value;
  if(str.match(/^#[0-9a-fA-F]{6}$/))
  { 
    //alert("allo");
    document.getElementById(viewId).style.background=document.getElementById(inputId).value;
  }
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function MakePreview()
{ 
  var header=document.getElementById("txt_arthro_kefalida").value; 
  var title=document.getElementById("txt_arthro_titlos").value;
  var text=document.getElementById("txt_arthro_perigrafi").value;
  var footer=document.getElementById("txt_arthro_katakleida").value;
  
  document.getElementById("kefalida").innerHTML=header;
  document.getElementById("titlos").innerHTML=title;
  document.getElementById("perigrafi").innerHTML=text;
  document.getElementById("katakleida").innerHTML=footer;
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------- ARTHRA ---------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/



function toggleDiv(id,flagit) {
  if (flagit=="1"){
    if (document.layers) document.layers[''+id+''].visibility = "show"
    else if (document.all) document.all[''+id+''].style.visibility = "visible"
    else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
  }
  else
  if (flagit=="0"){
    if (document.layers) document.layers[''+id+''].visibility = "hide"
    else if (document.all) document.all[''+id+''].style.visibility = "hidden"
    else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
  }
}





function img_on(img)
{  if(document.images)
        {  document [img].src="images/"+img+"on.jpg"; }
}

function img_off(img)
{  if(document.images)
   {document [img].src="images/"+img+".jpg";}
}

function img_on1(img)
{  if(document.images)
        {  document [img].src="images/"+img+"on.gif"; }
}

function img_off1(img)
{  if(document.images)
   {document [img].src="images/"+img+".gif";}
}

function img_on2(img)
{  if(document.images)
        {  document [img].src="menu_images/"+img+"on.jpg"; }
}

function img_off2(img)
{  if(document.images)
   {document [img].src="menu_images/"+img+".jpg";}
}
  
function openit2(sURL)
{
   newwin=open(sURL,"3d","dependent, location=yes,scrollbars=yes,toolbar=yes,resizable=yes,directories=yes,menubar=yes,width=770,height=510,status=0,screenX=0,left=0,screenY=0,top=0");
}