//var site_url = 'http://www.ladygentleman.com/new/';
function showWhitePopup(page,obj)
{
	closeWhitePopup()
	var url = site_url+'templates/ajax/'+page;
	new Ajax.Updater('recCol', url, {asynchronous: false });
	if(-[1,])
	{
		var arrow = obj.parentNode.getElementsByClassName('arrow');
		arrow[0].style.display = 'block';
	}
	else
	{
		obj.parentNode.lastChild.style.display = 'block';
		
	}
	$('white_popup').style.visibility = 'visible';
	setHeight();
}
function showWhitePopupFromMethod(page,obj)
{
	closeWhitePopup()
	var url = site_url+page;
    var html = $.ajax({
        url: url,
        async: false
    }).responseText;
    $('#recCol').html(html);
	if(-[1,])
	{       
		var arrow = obj.parentNode.parentNode.getElementsByClassName('arrow');
        arrow[0].style.width = obj.parentNode.parentNode.clientWidth  + 'px'; 
        arrow[0].style.height = '25px';
        arrow[0].style.display = 'block';
	}
	else
	{     
        obj.parentNode.firstChild.style.width = obj.parentNode.parentNode.clientWidth + 'px';
        obj.parentNode.firstChild.style.height = '25px';
		obj.parentNode.firstChild.style.display = 'block';
	}
    obj.parentNode.parentNode.className = 'menu active';
    
	$('#white_popup').fadeIn('fast',function(){
        $('#recCol').hide();
        $('#recCol').css({'visibility':'visible'});
        $('#recCol').fadeIn('slow');
    });
	//setHeight();
}
function dump(obj) {
    var out = "";
    if(obj && typeof(obj) == "object"){
        for (var i in obj) {
            out += i + ": " + obj[i] + "\n";
        }
    } else {
        out = obj;
    }
    alert(out);
}
function active_link(obj)
{    
    obj = document.getElementById(obj).parentNode.parentNode;
    obj.className = 'menu active';
    set_menu_width();
    children = $(obj).children();
    $(children[0]).show();
    setTimeout(set_menu_width,500);    
}
function closeWhitePopup()
{
	//$('#white_popup').css({'visibility' : 'hidden'});
	var arrows = $('.arrow');
	for(i = 0;i<arrows.length;i++)
	{
		arrows[i].style.display = 'none';
        arrows[i].parentNode.className = 'menu';
	}
}
