
function get_phantom_cat(id) {
	dlg_get('/phantom.php?id='+id, function(d){
		var phantom;
		try {
			document.getElementById('lifestyle').innerHTML='';
			phantom = document.getElementById('cosmetics');
			phantom.style.border='none';
		}
		catch(e) {
			phantom = document.getElementById('phantom_cats');
		}
		phantom.innerHTML=d;
			
	});
}

function mouse_over(td, id) {
	td.className='phantom_group_o';
	document.getElementById('phantom_s'+id).className='phantom_start_o';
	document.getElementById('phantom_e'+id).className='phantom_end_o';
	document.getElementById('ph_b'+id).className='ph_borders_o';

}

function mouse_out(td, id) {
	td.className='phantom_group';
	document.getElementById('phantom_s'+id).className='phantom_start';
	document.getElementById('phantom_e'+id).className='phantom_end';
	document.getElementById('ph_b'+id).className='ph_borders';
}

function dlg_get(u,cb,cbp)
{
	return dlg_xmlhttprequest(u,'GET','','',cb,cbp);
}


function dlg_xmlhttprequest(u,m,d,c,cb,cbp)
{
	u=dlg_url(u);
	var r=false;
    if(window.XMLHttpRequest) {
    	try {
			r=new XMLHttpRequest();
        } 
		catch(e) {
			r=false;
        }
    } 
	else if(window.ActiveXObject) {
       	try {
        	r=new ActiveXObject("Msxml2.XMLHTTP");
      	} 
		catch(e) {
        	try {
          		r=new ActiveXObject("Microsoft.XMLHTTP");
        	} 
			catch(e) {
          		r=false;
        	}
		}
    }

	if(r) {
		r.onreadystatechange=function() {
			if(r.readyState==4) {
				if(r.status==200)
					cb(r.responseText,cbp);
			}
		};
		r.open(m,u);
		if(c!='')
			r.setRequestHeader('Content-Type',c);
		r.send(d);
		return true;
	}
	return false;
}

function dlg_url(u)
{
	if(typeof(u)=='object') {
		var s=u[0];
		if(typeof(u[1])=='object') {
			var k;
			var sp='?';
			for (k in u[1]) {
				s+=sp+encodeURIComponent(k)+'='+encodeURIComponent(u[1][k]);
				sp='&';
			}
		}
		if(typeof(u[2])!='undefined')
			s+='#'+u[2];
		return s;
	}
	return u;
}
