var handleSuccess = function(o){

	if(o.responseText !== undefined)
	{
		document.getElementById("dialogContainer1").innerHTML = o.responseText;
		configure();
	}
}

var handleFailure = function(o){

	//alert('fail');
}

var callback =
{
  success:handleSuccess,
  failure:handleFailure,
  argument: { foo:"foo", bar:"bar" }
};



function makeRequest()
{
	var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
}

var widther = 720;


function showcat(id,other,widthe)
{
	if(widthe>0)
		widther = widthe;

	sUrl = "getcatalog.php?id="+id+other;
	
	//getform
	makeRequest();
	

	return false;
}

var dlg;

function configure()
{
	//alert("screen width: "+getWindowWidth());
	dlg = new YAHOO.widget.Dialog("dialogContainer1", {
		width:widther+"px",
		fixedcenter:false,
		modal:false,
		visible:true,
		close:true,
		zindex:10,
		draggable:false,
		xy:[getWindowWidth()/2-271,-950]
	});
	
	dlg.render();
	
	
	dlg.show();

	var attributes = { points: { to: [getWindowWidth()/2-271, 295],from:[getWindowWidth()/2-271,-950] } };
    	var anim = new YAHOO.util.Motion('dialogContainer1', attributes,0.7);
    	anim.animate();
		
}

function getWindowWidth() {
		var windowWidth = 0;
		if (typeof(window.innerWidth) == 'number') {
			windowWidth = window.innerWidth;
		}
		else {
			if (document.documentElement && document.documentElement.clientWidth) {
				windowWidth = document.documentElement.clientWidth;
			}
			else {
				if (document.body && document.body.clientWidth) {
					windowWidth = document.body.clientWidth;
				}
			}
		}
		return windowWidth;
	}

