var divid;
var flag=0;
// JavaScript Document

//******************************************//
// Start of Adaptive CSS related Javascript //
//******************************************//
function checkRes(func) {
  var initRes = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
	
      if (initRes) {
        initRes();
      }
      func();
    }
  }
}

/****** Browser Check for IE/Netscape/Others ******/
function chkBrowserWidth(){
	if (document.body){return document.body.clientWidth;} 
	else if (document.documentElement && document.documentElement.clientWidth != 0){
		return document.documentElement.clientWidth;	}
	else if (window.innerWidth){
		return window.innerWidth;}	
	return 0;
	}
	

checkRes(newRes);
checkRes(equalColumns); /* to equalize the the column height in eBP 1.5 */
window.onresize = newRes;

function newRes(){
		var fmt = chkBrowserWidth();
		var css = (fmt>0&&fmt<=980)?'aig800':(fmt>980&&fmt<=3000)?'aig1024':'';	
		document.getElementById("body_wrapper").className=css;
	}


 function homeLink(p_url){
               eraseCookie('tabSelect');
               location.href=p_url; 
               return false;
        }

// End of Adaptive CSS related Javascript //


//**************************************************//
// Start of Show Tab / List View Related Javascript //
//**************************************************//

var gblPrevLi = ""; /* Global variable defined for the Product Details tab view, which carried selected tab object */

function showDtls(obj){ /* Function to Show the details on mouse trigger */
	var parentClass = document.getElementById('divTab').className;
	var objLi = document.getElementById(obj); 
	
	if(parentClass == "tabView"){
		hideDtls(); /* Hides details of the previously selected tab */
		document.getElementById(objLi.title).style.display = "block";
		if(objLi.className == "tabLast"){ /* Checks for the special tab */
				objLi.className = "tabLastOn";
			}else {
				objLi.className = "tabOn";
				}
		gblPrevLi = objLi;
	}else{
		//alert(location.href + "#" + objLi.title);
		location.href = "#" + objLi.title;	 
	}
}
	
function hideDtls(){ /* Hides details of the previously selected tab */
	if(gblPrevLi && gblPrevLi != ""){
		document.getElementById(gblPrevLi.title).style.display = "none";
		if(gblPrevLi.className == "tabLastOn"){
			gblPrevLi.className = "tabLast";
			} else{
				gblPrevLi.className = "tab";
				}
		}
	}

/* For changing TabView to ListView.*/
function tabs(mode, theClass, obj,listTab,listView){
	if (mode == "listView"){
		document.getElementById('divTab').className = "listView";
		obj.parentNode.innerHTML = '<a href="javascript:void(0)" onclick="tabs(\'tabView\', \'tabDataContainer\',this,\''+listTab+'\',\''+listView+'\')">'+listTab+'</a> | '+listView;
		showHideAllDtls(theClass, 'block');
		}
	if (mode == "tabView"){
		document.getElementById('divTab').className = "tabView";
		obj.parentNode.innerHTML = listTab + ' | <a href="javascript:void(0)" onclick="tabs(\'listView\', \'tabDataContainer\', this,\''+listTab+'\',\''+listView+'\')">'+listView+'</a>';
		showHideAllDtls(theClass, 'none');
		showDtls('tab1');	/* To Show the Tab One Active*/			
		}
	}
	
// This Function Describes the pages with deafault list View 	
function listItems(){	
		document.getElementById('divTab').className = "listView";
		var obj1 = document.getElementById('jumpLink');
		obj1.style.display = 'none';
	}		
		
/* To Show all the Detail DIV in List View*/
function showHideAllDtls(theClass, mode) {
	var allPageTags=document.getElementsByTagName("div");
		for (i=0; i<allPageTags.length; i++) {
			if (allPageTags[i].className==theClass) {
				allPageTags[i].style.display = mode;
				}
			}
	}





/* For Country Page - Start of code for tab structure*/
var gblPrevLi1 = ""; /* Global variable defined for the Product Details tab view, which carried selected tab object */

function showDtls1(obj){ /* Function to Show the details on mouse trigger */
	var parentClass = document.getElementById('divTab1').className;
	var objLi = document.getElementById(obj); 
	
	if(parentClass == "tabView1"){
		hideDtls1(); /* Hides details of the previously selected tab */
		document.getElementById(objLi.title).style.display = "block";
		if(objLi.className == "tabLast1"){ /* Checks for the special tab */
				objLi.className = "tabLastOn1";
			}else {
				objLi.className = "tabOn1";
				}
		gblPrevLi1 = objLi;
	}else{
		//alert(location.href + "#" + objLi.title);
		location.href = "#" + objLi.title;	 
	}
}
	
function hideDtls1(){ /* Hides details of the previously selected tab */
	if(gblPrevLi1 && gblPrevLi1 != ""){
		document.getElementById(gblPrevLi1.title).style.display = "none";
		if(gblPrevLi1.className == "tabLastOn1"){
			gblPrevLi1.className = "tabLast1";
			} else{
				gblPrevLi1.className = "tab1";
				}
		}
	}
/* For Country Page - End of code for tab structure*/




// End of Show Tab / List View Related Javascript //


//*************************************************//
// Start of Flyout Menu section Related Javascript //
//*************************************************//

var hideDivTimer = null;
var browserName=navigator.appName; 

// Generalised Function to show a layer
function showSection(x){
//		clearTimeout(hideDivTimer);
		var bcID = 'section'+x;
		document.getElementById(bcID).style.display = 'block';
	}
	
// Generalised Function to hide a layer	
function hideSection(x){
		var bcID = 'section'+x;
		document.getElementById(bcID).style.display = 'none';
	}
	
// this function determines whether the event is the equivalent of the microsoft
// mouseleave or mouseenter events.
function isMouseLeaveOrEnter(e, handler)
{		
	if (e.type != 'mouseout' && e.type != 'mouseover') return false;
	var reltg = e.relatedTarget ? e.relatedTarget :
	e.type == 'mouseout' ? e.toElement : e.fromElement;
	while (reltg && reltg != handler) reltg = reltg.parentNode;
	return (reltg != handler);
}


//This function select the tab to show the Flyout
function globalTbMenu(val){
		clearTimeout(hideDivTimer);
		
		/*if(document.getElementById("menu4iframe"))
		document.getElementById("menu4iframe").style.display="block";*/
		var objLi = document.getElementById('li'+ val);
		if(objLi.className != "tabOn")
			{
				objLi.className = "tabOnLink";
			}
		objDiv = document.getElementsByTagName('div');
		objDivLen = objDiv.length
		for(x=0;x<objDivLen;x++)
			{
				if((String(objDiv[x].id)).substring(0,10)=="flyoutMenu")
					{
						if((String(objDiv[x].id)).substring(0,10)!="flyoutMenu" +val)
						{
							objDiv[x].style.display = 'none';				
						}
					}
			}		
			if(document.getElementById('flyoutMenu'+ val).style.display != 'block')
			{
				document.getElementById('flyoutMenu'+ val).style.display = 'block';
				if(document.getElementById('DivShim'))
				DivSetVisible(true,document.getElementById('flyoutMenu'+ val));
//				flag=1;
			}
			else
			{
				document.getElementById('flyoutMenu'+ val).style.display = 'none';
//				flag=0;
			}
				
/*			if(flag==1)
			{
				variableOpacity=0;
				flyid='flyoutMenu'+ val;
				fadeType=1;
				fadeMenu(flyid);
			}*/
		searchCountry();	//Check the availability of dropdown box
	}



//This function change the class name of the tab	
function hideGlbTabMenu(listclass){

/*	if(document.getElementById("menu4iframe"))
	document.getElementById("menu4iframe").style.display="none";*/
		var objLi = document.getElementById('li'+listclass);
		if(objLi.className != "tabOn")
			{
				objLi.className = "none";		
			}
	/*	fadeType=2 /* for fade out menu
		variableOpacity=maxOpacity;
		fadeMenu(flyid);*/
		searchCountryA();	
		hideDivTimer = setTimeout("removeAll()",200);
		if(document.getElementById('DivShim'))
		document.getElementById('DivShim').style.display="none";
	}

//This function hides all the flyout tabs	
function removeAll(){
		objDiv = document.getElementsByTagName('div');
		objDivLen = objDiv.length
		for(x=0;x<objDivLen;x++)
			{
				if((String(objDiv[x].id)).substring(0,10)=="flyoutMenu")
					{
						objDiv[x].style.display = 'none';				
					}
			}	
	}

//This function overlaps select box with the menu
  function DivSetVisible(state,DivRef)
  {
   var IfrRef = document.getElementById('DivShim');
   if(state)
   {
    DivRef.style.display = "block";
	DivRef.style.zIndex = 100;
    IfrRef.style.width = DivRef.offsetWidth;
    IfrRef.style.height = DivRef.offsetHeight;
    IfrRef.style.top = DivRef.style.top;
    IfrRef.style.left = DivRef.style.left;
    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
   }
  }

maxOpacity=100;
/* Fade menu effect starts */
function fadeMenu(divId)
{
if(fadeType==1) /*fade in */
	{	
	if(document.all) {
		document.getElementById(divId).style.filter='alpha(opacity='+variableOpacity+')'; /*sets opacity for IE */
	}
	else
		{
			document.getElementById(divId).style.MozOpacity=variableOpacity/101; /*sets opacity for Mozilla */
		}
	variableOpacity=variableOpacity+10; /*increments 'variableOpacity' by 10 milliseconds */
	if((maxOpacity - variableOpacity)<0) /* sets 'variableOpacity' equal to 100 when 'variableOpacity' exceeds 100 */
		{	
		variableOpacity=maxOpacity;
		return;
		}
	setTimeout('fadeMenu(flyid)',20); /* executes function fadeMenu after 20 milliseconds */
	}

else if(fadeType==2) /*fade out */
	{
	if(document.all) {
			document.getElementById(divId).style.filter='alpha(opacity='+variableOpacity+')'; /*sets opacity for IE */
		}
	else
		{
			document.getElementById(divId).style.MozOpacity=variableOpacity/101; /*sets opacity for Mozilla */
		}
	variableOpacity=variableOpacity-10; /* decreases 'variableOpacity' by 10 milliseconds */
	if(variableOpacity<0)
		{
		variableOpacity=0;
		return;
		}
	setTimeout('fadeMenu(flyid)',20);/* executes function fadeMenu after 20 milliseconds */
	}
}

/* Fade menu effect end */



//Check the availability of the dropdown box
function searchCountry(){
	 if (browserName=="Microsoft Internet Explorer")
	 {
		if(document.getElementById('searchCountry'))
		{
			document.getElementById('searchCountry').style.visibility = 'hidden'
		}
	 }
	}

//Shows the dropdown box if the select country box is available
function searchCountryA(){
	if (browserName=="Microsoft Internet Explorer")
	 {
		if(document.getElementById('searchCountry'))
		{
			document.getElementById('searchCountry').style.visibility = 'visible';
		}
	 }
	}
	
// End of Flyout Menu section Related Javascript //	


// Start of Contect Form Related Javascript //	
function validate()
{
var a= document.contact.email.value;
var b= document.contact.telNum.value;
var c= document.contact.comments.value;
//if(a=='' || b=='' || c=='')
//return false;
	if(echeck(a) && isInteger(b) && c!='' )
	return true;
	else
		{
		if(!echeck(a) || a=='')
			{
			document.getElementById('em1').style.display='block';
			}
		else
			document.getElementById('em1').style.display='none';
		if(!isInteger(b) || b=='')
			{
			document.getElementById('em2').style.display='block';
			}
		else
			document.getElementById('em2').style.display='none';
		if(c=='')
			{
			document.getElementById('em3').style.display='block';
			}
		else
			document.getElementById('em3').style.display='none';	
			return false;
		}
}


function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    //alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
// End of Contect Form Related Javascript //		

/* Cookie function starts */ 


// JavaScript Document

function writeCookie(name, value, hours, path)
{
  var expire = "";
  var pathUrl = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  if(path != null)
  {
	  pathUrl = "; path=" + path;
  }
  else
	{
  	  pathUrl = "; path=/";
	}
  document.cookie = name + "=" + escape(value) + expire + pathUrl;
  
}


/* function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
  
} */

function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

function eraseCookie(name) {
	writeCookie(name,"",-1);
}

/* functionality to set the cookies */
function showFlySel()
{
	a = readCookie('tabSelect');
	if(a) 
	{
		showFly(a);
		if(typeof showTab == "function")
		{
			showTab(a);
		}
	}
	if(document.getElementById('homeBanner'))
	{
		document.getElementById('homeBanner').style.zIndex = 11;
	}
}

/* Function to hightlight the tab based on the cookie */
function showFly(val)
{
	objLi = document.getElementsByTagName('li');
	objLiLen = objLi.length;
	for(i=0;i<objLiLen;i++)
	{
		if((String(objLi[i].id)).substring(0,2)=="li")
		objLi[i].className = "none";
	}
	document.getElementById("li"+val).className="tabOn";
}

/* Function to resset cookie for country page  starts*/
function resetCookieAndRedirect(p_name, p_value, p_hours, p_url) {
		writeCookie(p_name, p_value, p_hours);
		location.href=p_url;
		return false;
	}
/* Function to resset cookie for country page  endss*/

/* Cookies function end */

/* Additional EBP 1.0 functions starts */

function removedrop(){
	document.getElementById('drop1').innerHTML="<img src='images/aig_pixel.gif' alt='' width='1' height='28' border='0'></a>";
}
function putdrop(){
	document.getElementById('drop1').innerHTML="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><select name='select' class='fld'><option>Select one</option></select></td><td><input name='Button' type='image' src='images/go_btn.jpg' class='Btn' value='Go'></td></tr></table>";
	document.getElementById('motioncontainer').style.display = 'block';
	document.getElementById('motiongallery').style.display = 'block';
	document.getElementById('trueContainer').style.display = 'block';
}


// JavaScript Document
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="#">Menu1 Sublink One</a>'
menu1[1]='<a href="#">Menu1 Sublink Two</a>'
menu1[2]='<a href="#">Menu1 Sublink Three</a>'
menu1[3]='<a href="#">Menu1 Sublink Four</a>'
menu1[4]='<a href="#">Menu1 Sublink Five</a>'
menu1[5]='<a href="#">Menu1 Sublink Six</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="#">Menu2 Sublink One</a>'
menu2[1]='<a href="#">Menu2 Sublink Two</a>'
menu2[2]='<a href="#">Menu2 Sublink Three</a>'

	
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=5 //horizontal offset of menu from default location. (0-5 is a good value)

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropMenuDivAIG" style="visibility:hidden;width: 180px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="leftedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropMenuDivAIG") : dropMenuDivAIG
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "leftedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+35+"px"
}
return clickreturnvalue()
}

function clickreturnvalue(){
	
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

/* Additional EBP 1.0 functions ends */



/* Addition EBP 1.5 functions stats */

/********************************************************/
/****** Function to equalize the the column height ******/
/********************************************************/

function equalColumns(){
	var c = document.getElementById('gridCenter');
	var r = document.getElementById('gridRight');
	var l = document.getElementById('gridLeft');
	var cenb = document.getElementById('pageBanner');
	var x = navigator;
	var z = x.appName;	
	if(l){ /* Checks for availability of left grid */
		var browser=navigator.appName
		
		if ((browser=="Netscape")){ /* if its otherthan Explorer */  			
			l.style.height = "auto !important"; /* Very important => so that the extended menu pushes the left grid */
			
			/* Check the center height and changes the left section accordingly */
			c.offsetHeight >= l.offsetHeight ? l.style.minHeight = c.offsetHeight + "px" : c.style.height = l.offsetHeight + "px"; 
		}
		else{
			c.offsetHeight >= l.offsetHeight ? l.style.height = c.offsetHeight + "px" : c.style.height = l.offsetHeight + "px";
		}
	}
	if(r){
		/* Check the center height and changes the right section accordingly */
		c.offsetHeight >= r.offsetHeight ? r.style.height = c.offsetHeight + "px" : c.style.height = r.offsetHeight + "px";				
	}
	
	if(cenb){ /* This condition overwrites the above the script if the page banner is available */
				var z = parseInt(c.offsetHeight+cenb.offsetHeight);/* Adding the page banner height with the center section */
				if(l){
				var browser=navigator.appName
				if ((browser=="Netscape"))
					{l.style.height = "auto !important";
					z >= l.offsetHeight ? l.style.minHeight = parseInt(c.offsetHeight+cenb.offsetHeight) + "px" : c.style.height = parseInt(l.offsetHeight-cenb.offsetHeight) + "px";}
				else
					{z >= l.offsetHeight ? l.style.height = parseInt(c.offsetHeight+cenb.offsetHeight) + "px" : c.style.height = parseInt(l.offsetHeight-cenb.offsetHeight) + "px";}
			}
			if(r){
				z >= r.offsetHeight ? r.style.height = c.offsetHeight + "px" : c.style.height = r.offsetHeight + "px";				
			}
		}
}
	
/********************************************************/
/* Addition EBP 1.5 functions ends */

/* Addition EBP 2.0 functions stats */

/********************************************************/
/****** Function to equalize the the column height ******/
/********************************************************/

var highlightInnertab = true;
function setTabIndex(name, value, hours)
{
	
	if(highlightInnertab) writeCookie(name, value, hours);
	if(navigator.appName=="Microsoft Internet Explorer")
	{
		var a = window.event.srcElement.parentNode;
		a.href = "home_page.html"
	}
	else
	{
		window.location.href="home_page.html";
	}
	
	
}

function clearTabIndex(name)
{
	if(highlightInnertab) eraseCookie(name);
}



/********************************************************/
/****** Function for Country Map ******/
/********************************************************/

function over(x,y)
{
if(y==0)
{
var a=document.getElementById('map').src;
document.getElementById('txtWP').title=a;
}
if(x==0 && y==1)
{
document.getElementById('map').src=document.getElementById('txtWP').title;
}

if(x==1)
document.getElementById('map').src='images/wm_rt_america.gif';
if(x==2)
document.getElementById('map').src='images/wm_rt_europe.gif';
if(x==3)
document.getElementById('map').src='images/wm_rt_a_pacific.gif';
if(x==4)
document.getElementById('map').src='images/wm_rt_m_east.gif';
if(x==5)
document.getElementById('map').src='images/wm_rt_africa.gif';
}

/********************************************************/

/********************************************************/
/*********** Function for Left Menu Triggering **********/
/********************************************************/

function toggle(id){

	var ul = id;

	var ulElement = document.getElementById(ul);

	if (ulElement){

			if (ulElement.className == 'closed'){

					ulElement.className = "open";

					}else{

					ulElement.className = "closed";

					}

			}

	}
/********************************************************/
/* Addition EBP 2.0 functions ends */