var isNav, isIE, isIE5, isIE50;
var coll = "";
var styleObj = "";
if (parseInt(navigator.appVersion) >= 4) {
  if (navigator.appName == "Netscape") {
    isNav = true;
  }
  else {
    isIE = true;
    coll = "all.";
    styleObj = ".style";
    if ((navigator.userAgent.indexOf("MSIE 5") != -1) ||
        (navigator.userAgent.indexOf("MSIE 6") != -1) ) {
		isIE5 = true;
      if (navigator.userAgent.indexOf("MSIE 5.0") != -1) {
        isIE50 = true;
      }
    }
  }
}
function getObjectStyle(obj) {
	return "document."+coll+obj+styleObj;
}
function getObjectName(obj) {
	return "document."+coll+obj+'.name';
}
function show(obj) {
	var theObj = getObjectStyle(obj);
	eval(theObj + '.position = "relative";');
	eval(theObj + '.visibility = "visible";');
}

function hide(obj) {
	var theObj = getObjectStyle(obj);
	eval(theObj + '.position = "absolute";');
	eval(theObj + '.visibility = "hidden";');
}

function onloadfocus(Form,Obj){
    if (Obj != null ) {
        if (Obj.type != "hidden" && Obj.disabled !=true) Obj.focus();
    } else {
        for (i=0;i<Form.length;i++) {
            if (Form.elements[i].type != "hidden" && Form.elements[i].type != "select-one" && Form.elements[i].type != "radio" && Form.elements[i].disabled !=true){
                Form.elements[i].focus();
                break;
            }
        }
    }
}
/*------------------------------------------------------------------------*/
//  ¸Þ´ºÁ¤ÀÇ
/*------------------------------------------------------------------------*/
function Home(){	
	top.location.href = "../../";
}
function GoFrench(){	
	location.href = "../../../French/";
}
function GoEnglish(){	
	location.href = "../../../English/";
}
function GoEspanol(){	
	location.href = "../../../Espanol/";
}
function GoMain( code ){
	var gotourl = "";

	switch ( code ) {
		case "about":
		case "menu01":
		case "menu02":
		case "menu03":
		case "menu04":
			gotourl = "../../main/"+code+"/main.php";
			break;
		case "mailto":
			gotourl = "../../main/"+code+"/mailto.php";
			break;
		case "news":
			gotourl = "../../main/"+code+"/view.php";
			break;
		case "faq":
			gotourl = "../../main/"+code+"/list.php";
			break;			
		default:
			gotourl = "#";
	}
	location.href = gotourl;
}
function ZoomIn ( itemno ) {
	if ( itemno != null ) {
		window.open('../../main/shop/zoomin.php?itemno='+itemno,'ZoomIn','width=520,height=630')
	}
}
/*------------------------------------------------------------------------*/
//  µ¿¿µ»ó ÇÃ·¡½¬ ½ÇÇà
/*------------------------------------------------------------------------*/
function FlashPlay( src, width, height){	
	document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write ('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="');
	document.write (width);
	document.write ('" height="');
	document.write (height);
	document.write ('">');
	document.write ('<param name="movie" value="');
	document.write (src);
	document.write ('">');
	document.write ('<param name="quality" value="high">');
//	document.write ('<param name="wmode" Value="Transparent">');
	document.write ('<embed src="');
	document.write (src);
	document.write ('" quality="high" ');
	document.write ('pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="');
	document.write (width);
	document.write ('" height="');
	document.write (height);
	document.write ('">');
	document.write ('</embed>');
	document.write ('</object>');
}
/*------------------------------------------------------------------------*/
//  ÀÌ¹ÌÁö Ãâ·Â
/*------------------------------------------------------------------------*/
function ResizeImage(img_obj,max_width,max_height,swap) {
	imgobj =  eval("document."+img_obj);

	if ( swap == "SWAP" ) {
		if ( imgobj.width < imgobj.height ) {
			swaptmp = max_width;
			max_width = max_height;
			max_height = swaptmp;
		}
	}
	var tmp = 1;
	if ( imgobj.width > max_width) {
		tmp = max_width / imgobj.width ;	//width°¡ maxwidthº¸´Ù Å«°æ¿ìÃà¼ÒÀ²
		if ( Number( imgobj.height * tmp ) > max_height) {
			tmp = Number(tmp * (max_height / (imgobj.height*tmp)));
		}
	} else if ( imgobj.height > max_height )	{ //width°¡ maxwidthº¸´Ù Å«°æ¿ìÃà¼ÒÀ²
		 tmp = Number(max_height / imgobj.height) ;
	}
	imgobj.width = Number( imgobj.width * tmp );
}
function img_View(img_name,width,height) {

	if ( img_name != null && img_name != "" ) {

		var win_scrollbars = 'no';
		var width_plus = 0;

		if (height > 600) {
			var win_scrollbars = 'yes';
			height = 600;
			var width_plus = 20;
		} 
		if (width > 800) {
			var win_scrollbars = 'yes';
			width = 800;
			var width_plus = 20;
		}

		var openwidth = Number(width) + width_plus + 2;
		var openheight = Number(height) + width_plus + 2;

		window.open('../../main/unionpgm/imgView.php3?img='+img_name,'','width='+openwidth+',height='+openheight+', toolbar=0,menubar=0,resizable=yes,scrollbars='+win_scrollbars+', top=50, left=50');
	}
}
