
function createHttpRequest(){
  if(window.ActiveXObject) {
    try{
        return new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e){
			try{
			    return new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e2){
			    return null;
			}
    }       
  }
  else if(window.XMLHttpRequest) {
		return new XMLHttpRequest();
  }
  else {
		return null;    
  }    
}    

function getPage(url, targetDiv){
	
	var xmlObj = createHttpRequest();
	if(!xmlObj) return "Your browser is not supported";   
	xmlObj.onreadystatechange = function(){
		if(xmlObj.readyState == 4) {
			if(xmlObj.status == 200) {
				document.getElementById(targetDiv).innerHTML = xmlObj.responseText;
			}
		}			
	}
	xmlObj.open("GET", url);
	xmlObj.send(null);	
}

function loadHomeCate( sel, selTarget, curLoc ){
	var selCate = sel;
	if( sel == "" )  selCate = "1";
	getPage('../../inc/ajaxpage/mainCateList.php?ch='+selCate+'&cur='+curLoc, selTarget );
}

function view(what) { 
	var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10'); 
	imgwin.focus(); 
	imgwin.document.open(); 
	imgwin.document.write("<html>\n"); 
	imgwin.document.write("<head>\n"); 
	imgwin.document.write("<title>마우스를 클릭하시면 창이 닫힙니다.</title>\n"); 
	imgwin.document.write("<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n"); 
	imgwin.document.write("<sc"+"ript>\n"); 
	imgwin.document.write("function resize() {\n"); 
	imgwin.document.write("pic = document.il;\n"); 
	imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
	imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 80; myWidth = eval(pic).width + 12;\n"); 
	imgwin.document.write(" } else { myHeight = eval(pic).height + 58; myWidth = eval(pic).width + 9; }\n"); 
	imgwin.document.write(" clearTimeout();\n"); 
	imgwin.document.write(" var height = screen.height;\n"); 
	imgwin.document.write(" var width = screen.width;\n"); 
	imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n"); 
	imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n"); 
	imgwin.document.write(" self.moveTo(leftpos, toppos);\n"); 
	imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n"); 
	imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
	imgwin.document.write("</sc"+"ript>\n"); 
	imgwin.document.write("</head>\n"); 
	imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 
	imgwin.document.write("<a href=# onclick=window.close()><img border=0 src="+what+" xwidth=100 xheight=100 name=il onload='resize();'></a>\n"); 
	imgwin.document.write("</body>\n"); 
	imgwin.document.close(); 
} 

function flashWrite(url,w,h,id,bg,vars,win){

var flashStr=
"<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+"' align='middle'>" +

"<param name='allowScriptAccess' value='always' />" +
"<param name='movie' value='"+url+"' />" +
"<param name='FlashVars' value='"+vars+"' />" +
"<param name='wmode' value='"+win+"' />" +
"<param name='menu' value='false' />" +
"<param name='quality' value='high' />" +
"<param name='bgcolor' value='"+bg+"' />" +

"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.marcomedia.com/go/getflashplayer'/>" +

"</object>";

document.write(flashStr);
}
