var imageshowing;
var fadingin, fadingout;
fadingin = false;
fadingout = false;

function getPageName(strParamName)
{
}

function new_win(urls) {
    window.open(urls);
}

 function mess() // Scramble email address
{
  var a,b,c,d,e
 
  a='<a hr'
  a+='ef=\"mai'
  b='i'
  b+='n'
  b+='f'
  b+='o'
  c='\">'
  a+='lto:'
  b+='@'
  e='</' + 'a>'
  d='inf'
  d+='o@jniservices.co.uk'
  b+='jniservices.co.uk'

  document.write(a+b+c+d+e)
}


function togglesubmenu(myItem, myItem_Menu)

{
 // document.getElementById("menulink-mandaps").style.color ='none'; 
 // document.getElementById("menulink-receptions").style.color ='none';   

  document.getElementById("submenu_mandaps").style.display = "none";
  document.getElementById("submenu_receptions").style.display = "none";  
  document.getElementById("submenu_parties").style.display = "none";
  document.getElementById("submenu_flowers").style.display = "none";
  document.getElementById("submenu_international").style.display = "none";  
  document.getElementById("submenu_corporate").style.display = "none";


  document.getElementById("menulink_mandaps").removeAttribute("class");
  document.getElementById("menulink_receptions").removeAttribute("class");  
  document.getElementById("menulink_parties").removeAttribute("class");
  document.getElementById("menulink_flowers").removeAttribute("class");
  document.getElementById("menulink_international").removeAttribute("class");
  document.getElementById("menulink_corporate").removeAttribute("class");
  
  document.getElementById("menulink_mandaps").removeAttribute("className");
  document.getElementById("menulink_receptions").removeAttribute("className");  
  document.getElementById("menulink_parties").removeAttribute("className");
  document.getElementById("menulink_flowers").removeAttribute("className");
  document.getElementById("menulink_international").removeAttribute("className");
  document.getElementById("menulink_corporate").removeAttribute("className");





  var myItem = document.getElementById(myItem);

var myItem_Menu = document.getElementById(myItem_Menu);

  
  if (myItem.style.display != "none")
  {
    myItem.style.display = "none";
  }

  else
  {
    myItem_Menu.setAttribute("class", "active"); //= "red";
       myItem_Menu.setAttribute("className", "active"); //= "red";
    myItem.style.display = "block";
    
  }

}


function togglemoretext(thetext)
{
  var thetext = document.getElementById(thetext);
  
  if (thetext.style.display != "none")
  {
    document.getElementById('texttogglebutton').style.display = "block";
    thetext.style.display = "none";
  }

  else
  {
    document.getElementById('texttogglebutton').style.display = "none";
    thetext.style.display = "block";
  }

}

function togglemainimage(theimage)
{
 
  
   if ((theimage != imageshowing) && (fadingin == false)  && (fadingout == false))
   {
     fadeOut(imageshowing,100);
     fadeIn(theimage,0);
   }
//  document.getElementById("mainimage1").style.display = "none";
}

function initImage() 
{
  imageId = 'mainimage1';
  image = document.getElementById("mainimage1");
  setOpacity(image, 100);
  image.style.visibility = 'visible';
  fadeIn(imageId,100);
}


  
  
function fadeIn(objId,opacity)
{
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 20;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 10);
      fadingin = true;
    }
    else
      fadingin = false;
  }
  
  imageshowing = objId;
}

function fadeOut(objId,opacity)
{
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity >= 0) {
      setOpacity(obj, opacity);
      opacity -= 20;
      window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 10);
      fadingout = true;      
    }
    else
      fadingout = false;    
  }
}

function setOpacity(obj, opacity)
{
  opacity = (opacity == 100)?99.999:opacity;
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}
