function flipContent(activeId){
	//menuItems = $('menuHolder').getElementsByTagName('DIV');
		var someNodeList = $('menuHolder').getElementsByTagName('DIV');
		var nodes = $A(someNodeList);

		nodes.each(function(node){
				//alert(node.nodeName + ': ' + node.id+':-: '+activeId);
				contentID = 'content_'+node.id;
				//alert(contentID);
				if($(contentID)){
					(node.id == activeId)? $(contentID).style.display = 'block' : $(contentID).style.display = 'none';
				}
				
			});
}

function flipAnyContent(containerName, activeId){
	//alert('containerName='+containerName+"activeId="+activeId);
	//menuItems = $('menuHolder').getElementsByTagName('DIV');
		var someNodeList = $(containerName).getElementsByTagName('DIV');
		var nodes = $A(someNodeList);

		nodes.each(function(node){
				//alert(node.nodeName + ': ' + node.id+':-: '+activeId);
				contentID = 'content_'+node.id;
				//alert(contentID+'=='+activeId);
				if($(contentID)){
					(node.id == activeId)? $(contentID).style.display = 'block' : $(contentID).style.display = 'none';
				}
				
			});
}


function page(id,menuName){
//alert(arguments.callee);

//Home, CWI Directory, Articles, CWI Library, Upcoming Events, Membership, Order Catalogue, Contact Us
//home dir listing atricle events membership catalogue contact links newlisting
   var edit_array 	=  new Array('g_box', 'selected', 'add_CSS', 'edit_CSS', 'add_A', 'edit_A','add_IMG','edit_IMG','preview_IMG','imgSrcWeb', 'imgSrcWeb',  'add_DIV_opt','edit_DIV_opt','add_DIV','edit_DIV','help');
	var page_array 	=  new Array("home", "dir", "listing","article", "library", "events", "membership", "catalogue",  "contact", "links", "newlisting"); 
	
   //alert('page: '+id+' menuName: '+menuName); 
   (menuName=='edit_array') ? menuName=edit_array :  menuName=page_array;
   //alert('page: '+id+' menuName: '+menuName); 
   var menuLength = menuName.length;		
   //alert('menuLength: '+menuLength);
	var count = 0;	//instantiate the counter	
	while (count < menuLength ){
		//alert('page_array[count]'+page_array[count]);
		var page_id = menuName[count];
     // alert('document.getElementById(page_id): '+page_id);
        if (document.getElementById(page_id)){
    		document.getElementById(page_id).style.display = (page_id==id)? 'block': 'none' ;
        //alert('document.getElementById(page_id).style.display: '+document.getElementById(page_id).style.display);
         var XXX = 'bypass';
        }
		count++;
	}	
}
function pageSingle(id){
	if (document.getElementById(id)){
    		//alert('document.getElementById(id).style.display='+document.getElementById(id).style.display);
		(document.getElementById(id).style.display == 'none')? display = 'block': display = 'none' ;
		//alert('display'+display);
		document.getElementById(id).style.display = display;
        //alert('document.getElementById(page_id).style.display: '+document.getElementById(page_id).style.display);
	}
}



function RipText(){
/*
   var RipText = document.getElementById('RipText').value
   if(RipText != ''){
       RipText =  RipText.replace(/[\t\v\f\n\r]+/g,'","');//WRAP EACH TAB/LINE SEPARATED CHAR IN DOUBLE QUOTES
       //alert(RipText);
       //RipText =  RipText.replace(/[\t\v\f\n\r]+/g,'\',\'');//WRAP EACH TAB/LINE SEPARATED CHAR IN SINGLE QUOTES
       //alert(RipText);
       //RipText =  RipText.replace(' ","',","'');//RIP TRAILING WHITE SPACE :-/
       //alert(RipText);
       
       
       
       //RegExp(smallString2, "i");
       //RipText = escape(RipText);
      document.getElementById('RipText').value = RipText; 
      document.getElementById('RipTextDiv').innerHTML = RipText;
   }
  */ 
}




function popActionWin(path,target)
{
	alert(path,target);
	if(target){
		
	}else{
		var target='popupwindow';
	}
	href = 'edit/'+path;
	settings = "height=300,width=400,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=yes,directories=no,resizable=no";
	alert(href, target, settings);
	window.open(href, target, settings);
  
}
/*
    function PopupWindow(href, w, h, settings)
    {
        leftpos = (screen.width) ? (screen.width-w)/2 : 0;
        toppos = (screen.height) ? (screen.height-h)/2 : 0;
        settings = 'height='+h+',width='+w+',top='+toppos+',left='+leftpos+' '+settings;
        window.open(href, 'popupwindow', settings)
    }
    
    PopupWindow('/global/verifyurl.php?href='+escape(href), 500, 400, "scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,directories=no,resizable=yes");
    
*/