// ÀÌ¹ÌÁö ·Ñ¿À¹ö
function ImageOver(imgEL){
	imgEL.src = imgEL.src.replace(".gif", "On.gif");
}
function ImageOut(imgEL){
	imgEL.src = imgEL.src.replace("On.gif", ".gif");
}



//div show hide
function showLayer(obj,n,v){
	for (var i=1; i<=n; i++)
      {
         if (i == v) {document.all[obj+i].style.display="block";}
         else {document.all[obj+i].style.display="none";}
      }
}





//ÇªÅÍ ÆÐ¹Ð¸® »çÀÌÆ®
function FamilyGo(dropdownName){
	var page = document.all[dropdownName].value;
	if(page !="") window.open(page);
}



//»õÃ¢ ¿­±â 
function winOpen(url,win,opt){
	window.open(url,win,opt);
	
}

//FLASH
var paramInfo = new Array;

function initParam()
{
  var oldSize = paramInfo.length;

 for (var i=0; i<oldSize; i++) {
  paramInfo.length--;
 } 
}
function setParam(paramName, paramValue)
{
 var idx = paramInfo.length;

 paramInfo[idx] = [];
 paramInfo[idx][0] = paramName;  
 paramInfo[idx][1]= paramValue;
}
function playFlash(objID, objSource, objWidth, objHeight, objStyle, cabVersion, embedAttr)
{
	document.write('<OBJECT id="' + objID + '" name="' + objID + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');

	if (cabVersion != '') {
		document.write('codebase="' + self.window.document.protocol + '"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + cabVersion + '" ');
	}
	document.write('WIDTH="' + objWidth + '" HEIGHT="' + objHeight + '" ' + objStyle + '>');

	for (var i=0; i<paramInfo.length; i++) {
		document.write('<PARAM NAME="' + paramInfo[i][0] + '" VALUE="'+ paramInfo[i][1] +'">');		
	}	
	
	document.write('<embed src="' + objSource + '" width="' + objWidth + '" height="' + objHeight + '" ' + embedAttr + '>');
	document.write('</OBJECT>');
}


/**
 * Microsoft ActiveX & Flash Patch ´ëÀÀÀ» À§ÇÑ ½ºÅ©¸³Æ® ÇÔ¼ö
 */
function StringBuffer() {
	this.buff = '';
	
	this.append = function(str) {
		this.buff = this.buff + str;
	}
	
	this.toString = function() {
		return this.buff;
	}
}

function XObject(type) {
	this.type = type;
	this.infoKeyArray = new Array();
	this.infoValueArray = new Array();
	this.paramKeyArray = new Array();
	this.paramValueArray = new Array();
	this.embedKeyArray = new Array();
	this.embedValueArray = new Array();
	this.addInfo = function(name, value) {
		if(name==null || value==null) {
			alert("usage : addInfo(name, value)");
		}
		this.infoKeyArray.push(name);
		this.infoValueArray.push(value);
	}
	this.addParam = function(name, value) {
		if(name==null || value==null) {
			alert("usage : addParam(name, value)");
		}
		this.paramKeyArray.push(name);
		this.paramValueArray.push(value);
	}
	this.addEmbedInfo = function(name, value) {
		if(name==null || value==null) {
			alert("usage : addEmbedInfo(name, value)");
		}
		this.embedKeyArray.push(name);
		this.embedValueArray.push(value);	
	}
	this.show = function() {
		if(this.type==null) {
			alert("usage : new Map(type) - type={'object','applet'..}");
		}
		var sb = new StringBuffer();
		sb.append("<");
		sb.append(this.type);
		sb.append(" ");
		for(var i=0; i<this.infoKeyArray.length; i++) {
			sb.append(this.infoKeyArray[i]);
			sb.append("='");
			sb.append(this.infoValueArray[i]);
			sb.append("' ");
		}
		sb.append(">")
		
		for(var i=0; i<this.paramKeyArray.length; i++) {
			sb.append("<param name='");
			sb.append(this.paramKeyArray[i]);
			sb.append("' value='");
			sb.append(this.paramValueArray[i]);
			sb.append("'>");
		}
		
		if(this.embedKeyArray.length > 0) {
			sb.append("<embed ");
			for(var i=0; i<this.embedKeyArray.length; i++) {
				sb.append(this.embedKeyArray[i]);
				sb.append("='");
				sb.append(this.embedValueArray[i]);
				sb.append("' ");
			}
			sb.append(">");
		}
		
		sb.append("</");
		sb.append(this.type);
		sb.append(">");
		document.write(sb.toString());
	}
	this.showActiveXMap = function(id, width, height, x, y, scale, isMapLoadOnInit) {
		this.addInfo("id",id);
		this.addInfo("width",width);
		this.addInfo("height",height);
		this.addParam("CenterX",x);
		this.addParam("CenterY",y);
		this.addParam("DrawScale",scale);
		this.addParam("IsMapLoadOnInit",isMapLoadOnInit);
		this.show();
	}
	this.showAppletMap = function(id, width, height, x, y, scale, isMapLoadOnInit) {
		
	}
	this.showDefaultFlash = function(id, src, width, height, wmode) {
		if(id==null || src==null || width==null || height==null || wmode==null) {
			alert("usage : showDefaultFlash(id, src, width, height, wmode)");
		}
		this.addInfo("id",id);
		this.addInfo("width",width);
		this.addInfo("height",height);
		this.addInfo("classid","clsid:D27CDB6E-AE6D-11cf-96B8-444553540000");
		this.addInfo("codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0");
		this.addParam("movie",src);
		this.addParam("quality","high");
		this.addParam("wmode",wmode);
		this.addEmbedInfo("src",src);
		this.addEmbedInfo("quality","high");
		this.addEmbedInfo("bgcolor","#FFFFFF");
		this.addEmbedInfo("width",width);
		this.addEmbedInfo("height",height);
		this.addEmbedInfo("type","application/x-shockwave-flash");
		this.addEmbedInfo("pluginspace","http://www.macromedia.com/go/getflashplayer");
		this.show();
	}
	this.showDefaultCongnamulMap = function(id, width, height, x, y, scale, isMapLoadOnInit) {
		if(id==null || width==null || height==null || x==null || y==null || scale==null) {
			alert("usage : showDefaultCongnamulMap(id, width, height, x, y, scale, isMapLoadOnInit)");
		}
		this.addInfo("classid","clsid:E0BF7A2B-2F7C-497A-B50F-292D3F317965");
		this.addInfo("codebase","http://www.congnamul.com/ActiveX/CongnamulMap_V17.cab#version=1,0,0,17");
		this.addParam("ServerIPAddress","mapsvc.samsung.co.kr");
		this.addParam("ServerServletURL","Map/servlet/mapservice");
		this.addParam("UserImageLocation","http://mapsvc.samsung.co.kr/landmark/");
		this.addParam("DecoSymbolUrl","http://map.congnamul.com/images/decoimages");
		this.showActiveXMap(id, width, height, x, y, scale, isMapLoadOnInit);
	}
	this.showDefaultSamsungMap = function(id, width, height, x, y, scale, isMapLoadOnInit) {
		if(id==null || width==null || height==null || x==null || y==null || scale==null) {
			alert("usage : showDefaultSamsungMap(id, width, height, x, y, scale, isMapLoadOnInit)");
		}
		this.addInfo("classid","clsid:DA76E8AE-2E7F-49A8-B5F2-D1C4FF70ECD5");
		this.addInfo("codebase","http://mapsvc.samsung.co.kr/ActiveX/SamsungMap_V25.cab#version=1,0,0,25");
		this.addParam("ServerIPAddress","mapsvc.samsung.co.kr");
		this.addParam("ServerServletURL","Map/servlet/mapservice");
		this.addParam("UserImageLocation","http://mapsvc.samsung.co.kr/landmark/");
		this.addParam("DecoSymbolUrl","http://map.congnamul.com/images/decoimages");
		this.showActiveXMap(id, width, height, x, y, scale, isMapLoadOnInit);
	}
	this.showDefaultAspMap = function(id, width, height, x, y, scale, isMapLoadOnInit) {
		if(id==null || width==null || height==null || x==null || y==null || scale==null) {
			alert("usage : showDefaultAspMap(id, width, height, x, y, scale, isMapLoadOnInit)");
		}
		this.addInfo("classid","clsid:D96D2F74-0B74-47D2-964F-B67E9F69F1CD");
		this.addInfo("codebase","http://asp.congnamul.com/AspActiveX/CongnamulMap4Asp_V23.cab#version=1,0,0,23");
		this.addParam("ServerIPAddress","mapsvc.samsung.co.kr");
		this.addParam("ServerServletURL","Map/servlet/mapservice");
		this.addParam("UserImageLocation","http://mapsvc.samsung.co.kr/landmark/");
		this.addParam("DecoSymbolUrl","http://map.congnamul.com/images/decoimages");
		this.showActiveXMap(id, width, height, x, y, scale, isMapLoadOnInit);
	}
}




