function loadPanel_refreshQuickLook(itemid, attributes, lastone) {
	var attribute = attributes.split(",");

	content = 'itemid' + '=' + escape(itemid);
	for (var i = 0; i < attribute.length; i++) {
		var attributeName = attribute[i];
		var index = document.selectionform.elements[attributeName].selectedIndex;
		var attributeValue = document.selectionform.elements[attributeName].options[index].value;
		content = content + '&attr-' + attributeName + '=' + escape(attributeValue);
	}
	if (lastone == 'last') {
		content = content + '&last=true';
	}

	doLoadPanelRefreshQuickLookPost('sub_webcart_quickLook.php', content, 'processLoadPanelRefreshQuickLook');
}

function processLoadPanelRefreshQuickLook(result) {

	var windowHeight = 0;
	var windowBottom = 0;
	var windowTop = 0;

	if (typeof(window.innerHeight) == 'number')
		windowHeight = window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight)
		windowHeight = document.documentElement.clientHeight;
	else if (document.body && document.body.clientHeight)
		windowHeight = document.body.clientHeight;

	if (typeof(window.pageYOffset) == 'number')
		windowBottom = windowHeight + window.pageYOffset;
	else if (document.body && document.body.scrollTop)
		windowBottom = windowHeight + document.body.scrollTop;
	else if (document.documentElement && document.documentElement.scrollTop)
		windowBottom = windowHeight + document.documentElement.scrollTop;

	windowTop = (windowBottom - windowHeight);
	if (windowTop < 0) {
		windowTop = 0;
	}

	var x = Math.round(windowTop);
	x = (x + 10);
	var y = 350;
	
	quickLookObj = document.getElementById('quickLookBox');
	quickLookObj.innerHTML = result;
	quickLookObj.style.top = x;
	quickLookObj.style.left = y;
	quickLookObj.style.display='block';
	
}

function doLoadPanelRefreshQuickLookPost(url, content, callback_name) {

	var async_requestLoadPanelRefreshQuickLook = false;
	try {
		// Firefox, Opera 8.0+, Safari, IE7+
		async_requestLoadPanelRefreshQuickLook = new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			async_requestLoadPanelRefreshQuickLook = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			async_requestLoadPanelRefreshQuickLook = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	async_requestLoadPanelRefreshQuickLook.open('POST', url, true);
	async_requestLoadPanelRefreshQuickLook.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	async_requestLoadPanelRefreshQuickLook.onreadystatechange = function() {
		if (async_requestLoadPanelRefreshQuickLook.readyState == 4) { 
			if (async_requestLoadPanelRefreshQuickLook.status == 200) {
				response_content = async_requestLoadPanelRefreshQuickLook.responseText;
				eval(callback_name + '(response_content);');
			}
		}
	}
	async_requestLoadPanelRefreshQuickLook.send(content);
}

