function FlashLoad(url,w,h,bg,t,code,id){
//alert(navigator.appName)
if(navigator.appName != "Microsoft Internet Explorer"){ w = "1024"; }
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width="+w+" height="+h+" id="+id+">");
document.write("<param name='movie' value="+url+ "?" + code + " />");
document.write("<param name='wmode' value="+t+" />");
document.write("<param name='bgcolor' value="+bg+" />");
document.write("<param name='allowScriptAccess' value='sameDomain' />");
document.write("<param name='quality' value='high' />");
document.write("<param name='menu' value='false' />");
//document.write("<param name='flashVars' value='&"+code+"' />");
document.write("<embed src="+url+ "?" + code + " width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' wmode='"+t+"' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.write("</object>");
}




//############# Layer Popup ############################
function product_print(idx) {
    window.open("/products/product_print.aspx?idx="+idx,"dddd","top=0,left=0,width=500,height=500");
}

function SLB_setCenter(obj) {
	if (obj) {
		var h = window.innerHeight || self.innerHeight || document.body.clientHeight;
		var w = window.innerWidth || self.innerWidth || document.body.clientWidth;
		//var l = (document.body.scrollLeft + ((w-(obj.width||parseInt(obj.style.width)||obj.offsetWidth))/2));
		var l = 0;
		//var t = (document.body.scrollTop + ((h-(obj.height||parseInt(obj.style.height)||obj.offsetHeight))/2));
		var t = 0;
		if((obj.width||parseInt(obj.style.width)||obj.offsetWidth) >= w) l = 0;
		if((obj.height||parseInt(obj.style.height)||obj.offsetHeight) >= h) t = document.body.scrollTop;
		document.getElementById('SLB_content').style.left = l + "px";

		if(SLB_cnt == 0) {
			document.getElementById('SLB_content').style.top = t + "px";
			if(document.getElementById('SLB_content').offsetHeight >= h) {
				SLB_cnt ++;
			}
		}
		obj.style.visibility = 'visible';
		if(obj.nextSibling && (obj.nextSibling.className == 'SLB_close' || obj.nextSibling.className == 'SLB_caption')) {
			obj.nextSibling.style.display = 'block';
			if(document.getElementById('SLB_content').offsetHeight < h) {
				document.getElementById('SLB_content').style.top = parseInt(document.getElementById('SLB_content').style.top) -  (obj.nextSibling.offsetHeight/2) + "px";
			}
		}
		if(!arguments[1]) {
			document.getElementById('SLB_loading').style.display = "none";
		} else {
			obj.style.left = l + "px";
			obj.style.top = t + "px";
		}
	}
}


var SLB_cnt = 0;
function SLB_show(url, type)
{
	var a = document.getElementById('SLB_film');
	var b = document.getElementById('SLB_content');
	var c = document.getElementById('SLB_loading');

	var win_width = document.body.clientWidth - 0;
	var win_height = document.body.clientHeight - 0;

	if(url) {
		a.style.top = 0;
		a.style.left = 0;
		a.style.display = "";
		a.style.height = document.body.scrollHeight + 'px';
		document.getElementById('SLB_loading').style.display = "block";
		SLB_setCenter(c,true);
		
		if(type == 'image') {
			b.innerHTML="<img src=" + url + " class='SLB_center' onload='SLB_setCenter(this);' />";
			if(arguments[2]) a.onclick = function () { SLB_show() };
			if(arguments[3]) b.innerHTML += "<div class='SLB_caption'>"+ arguments[3] +"</div>";
		} else if (type == 'iframe') {
			//b.innerHTML="<iframe src=" + url + " width="+ arguments[2] +" height="+ arguments[3] +" class='SLB_center' marginwidth='0' marginheight='0' frameborder='0' vspace='0' hspace='0' onload='SLB_setCenter(this);' /></iframe>";
			b.innerHTML = "<iframe src=" + url + " width=" + win_width + " height=" + win_height + " class='SLB_center' marginwidth='0' marginheight='0' frameborder='0' vspace='0' hspace='0' scrolling='no' onload='SLB_setCenter(this);' allowTransparency='true' /></iframe>";
			//if(arguments[4]) {
			//	b.innerHTML = "<div class='SLB_close' onclick='SLB_show();' title='´Ý±â'>close</div>";
			//}
			//b.onclick = ''; b.firstChild.style.cursor = 'default';
		} else if (type == 'html'){
			b.innerHTML = url;
			SLB_setCenter(b.firstChild);
			if(arguments[2]) b.onclick = '';
		}
//		else if (type == 'tag'){
			//b.innerHTML = url;
			//SLB_setCenter(b.firstChild);
			//showFlash(url+",'202','200','','1','','ABNshopping'");
			//if(arguments[2]) b.onclick = '';


//			b.innerHTML += "<div style='border:1px solid red;'>";
//			b.innerHTML += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='202' height='200' id='ABNshopping' align='middle'>";
//			b.innerHTML += "<param name='allowScriptAccess' value='always' />";
//			b.innerHTML += "<param name='allowFullScreen' value='false' />";
//			b.innerHTML += "<param name='movie' value="+url+" />";
//			b.innerHTML += "<param name='quality' value='high' />";
//			b.innerHTML += "<param name='bgcolor' value='#FBFAF6' />";
//			b.innerHTML += "<embed src="+url+" quality='high' bgcolor='#FBFAF6' width='202' height='200' name='ABNshopping' align='middle' allowScriptAccess='always' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
//			b.innerHTML += "</object>";
//			b.innerHTML += "</div>";
//		}

	//hideSelect();
	} else {
		a.onclick = '';
		a.style.display = "none";
		b.innerHTML = "";
		b.onclick = function () { SLB_show() };
		c.style.display = "none";
		//showSelect();
		SLB_cnt = 0;
	}
}
