
// DreamWeaver Script
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}



function ControlBoard() {
var str,width,height;
window.open('/products/option/ControlBoard_pop.html','','width=570,height=400,scrollbars=0');
}





 
 
var imgObj = new Image(); 
function showImgWin(file) { 
	imgObj.src = file;
	setTimeout("createImgWin(imgObj)", 100); 
} 

function createImgWin(imgObj) { 
	if (! imgObj.complete) { 
		setTimeout("createImgWin(imgObj)", 100); 
		return; 
	} 
//	imageWin = window.open("", "imageWin", "width=" + imgObj.width/2 + ",height=" + imgObj.height/2); 
	imageWin = window.open("", "imageWin", "width=612,height=793");  //800 x 1153
	imageWin.document.write("<html>");
	imageWin.document.write("<title>Cyber Marketing</title>");
	imageWin.document.write("<body style='margin:0'><div style='border-bottom:0px solid; border-left:0px solid; border-right:0px solid; border-top:0px solid; height:793px; left:30px; overflow:auto; osition:absolute;width:612px;'>");
	imageWin.document.write("<a href='javascript:self.close()'>"); 
	imageWin.document.write("<img src='" + imgObj.src + "'  width=" + imgObj.width + " height=" + imgObj.height + " border='0'>"); 
	imageWin.document.write("</a></div>"); 
	imageWin.document.write("</body><html>"); 
} 



var imgObj = new Image(); 
function showImgWin2(file) { 
	imgObj.src = file;
	setTimeout("createImgWin2(imgObj)", 100); 
} 

function createImgWin2(imgObj) { 
	if (! imgObj.complete) { 
		setTimeout("createImgWin2(imgObj)", 100); 
		return; 
	} 
	imageWin = window.open("", "imageWin", "width=900,height=675");  //800 x 1153
	imageWin.document.write("<html>");
	imageWin.document.write("<title>Cyber Marketing</title>");
	imageWin.document.write("<body style='margin:0'><div style='border-bottom:0px solid; border-left:0px solid; border-right:0px solid; border-top:0px solid; height:675px; left:30px; overflow:auto; osition:absolute;width:900px;'>");
	imageWin.document.write("<a href='javascript:self.close()'>"); 
	imageWin.document.write("<img src='" + imgObj.src + "'  width=" + imgObj.width+ " height=" + imgObj.height+ " border='0'>"); 
	imageWin.document.write("</a></div>"); 
	imageWin.document.write("</body><html>"); 
} 



var imgObj = new Image(); 
function showImgWin3(file) { 
	imgObj.src = file;
	setTimeout("createImgWin3(imgObj)", 100); 
} 

function createImgWin3(imgObj) { 
	if (! imgObj.complete) { 
		setTimeout("createImgWin3(imgObj)", 100); 
		return; 
	} 
//	imageWin = window.open("", "imageWin", "width=" + imgObj.width/2 + ",height=" + imgObj.height/2); 
	imageWin = window.open("", "imageWin", "width=850,height=800");  //800 x 1153
	imageWin.document.write("<html>");
	imageWin.document.write("<title>Cyber Marketing</title>");
	imageWin.document.write("<body style='margin:0'><div style='border-bottom:0px solid; border-left:0px solid; border-right:0px solid; border-top:0px solid; height:900px; left:30px; overflow:auto; osition:absolute;width:850px;'>");
	imageWin.document.write("<a href='javascript:self.close()'>"); 
	imageWin.document.write("<img src='" + imgObj.src + "'  width=" + imgObj.width + " height=" + imgObj.height + " border='0'>"); 
	imageWin.document.write("</a></div>"); 
	imageWin.document.write("</body><html>"); 
} 


var imgObj = new Image(); 
function showImgWin4(file) { 
	imgObj.src = file;
	setTimeout("createImgWin4(imgObj)", 100); 
} 

function createImgWin4(imgObj) { 
	if (! imgObj.complete) { 
		setTimeout("createImgWin4(imgObj)", 100); 
		return; 
	} 

	 
	imgwidth =   imgObj.width;
	imgheight =  imgObj.height;
 


	  if  (imgwidth > 800) {
		imgwidth = imgwidth / 1.5   ;
		imgheight = imgheight / 1.5
	   }


	imageWin = window.open("", "imageWin", "width=" + imgwidth + ",height=" + imgheight); 
//	imageWin = window.open("", "imageWin", "width=850,height=800");  //800 x 1153
	imageWin.document.write("<html>");
	imageWin.document.write("<title>Cyber Marketing</title>");
	imageWin.document.write("<body style='margin:0'>");
	imageWin.document.write("<a href='javascript:self.close()'>"); 
	imageWin.document.write("<img src='" + imgObj.src + "'  width=" + imgwidth + " height=" + imgheight + " border='0'>"); 
	imageWin.document.write("</a>"); 
	imageWin.document.write("</body><html>"); 
} 

function newwindow(URL,width,height) {
var str,width,height;
str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,";
str=str+"width="+width;
str=str+",height="+height+"'";
window.open(URL,'remote',str);
}

 

 /********************************************************************
/  SUPPORT UTILITY SHOW HIDE
********************************************************************/
ok=0; 
old_what="non";

function show(what){
	if((old_what != "non") && (what != old_what)){
		ok=1;
		old_what.style.display="none";
		what.style.display="";
	} else {
		if(ok){
			ok=0;
			what.style.display="none";
		} else {
			ok=1;
			what.style.display="";
		}
	}
	old_what=what;
}

 /********************************************************************
/  SUPPORT Contact US - Send Mail
********************************************************************/


function sendMail2() {
	var form = document.forms[0];
	var rname = form.regionName.value;
	var rcode = form.Region.value;
	var cname = form.countryName.value;
	var ccode = form.Country;
	
	if ( rcode != 'R01' && ccode.value == '' ) {
		alert ( 'Please select country.' );
		ccode.focus();
		return;
	}
	
	var urls = "/" + DbPath + "/fContact?OpenForm&ViewName=wvContact";
	urls += "&RN=" + rname + "&RC=" + rcode + "&CN=" + cname + "&CC=" + ccode.value;
	var loc = setCenter ( 620 , 600 );
	
	PopWin = window.open ( urls , "PopWin" , loc );
	PopWin.focus();
}

function changeRegion ( r1 ) {
	var rdata = '';
	var cdata = '';
	var rName = document.sendform.regionName;
	
	if ( r1 == 'R01' ) {
		document.all.Country.disabled = true;
		rdata = 'R01';
		cdata = 'korea';
		document.sendform.countryName.value = 'korea';
		rName.value = 'H.Q';
	} else if ( r1 == 'R02' ) {
		document.all.Country.disabled = false;
		rdata = document.sendform.AsiaList.value;
		cdata = document.sendform.AsiaCode.value;
		rName.value = 'Asia';
	} else if ( r1 == 'R03' ) {
		document.all.Country.disabled = false;
		rdata = document.sendform.AmericaList.value;
		cdata = document.sendform.AmericaCode.value;
		rName.value = 'America';
	} else if ( r1 == 'R04' ) {
		document.all.Country.disabled = false;
		rdata = document.sendform.AfricaList.value;
		cdata = document.sendform.AfricaCode.value;
		rName.value = 'Africa';
	} else if ( r1 == 'R05' ) {
		document.all.Country.disabled = false;
		rdata = document.sendform.OceaniaList.value;
		cdata = document.sendform.OceaniaCode.value;
		rName.value = 'Oceania';
	} else if ( r1 == 'R06' ) {
		document.all.Country.disabled = false;
		rdata = document.sendform.EuropeList.value;
		cdata = document.sendform.EuropeCode.value;
		rName.value = 'Europe';
	} else if ( r1 == 'R07' ) {
		document.all.Country.disabled = false;
		rdata = document.sendform.BranchList.value;
		cdata = document.sendform.BranchCode.value;
		rName.value = 'Branch';

	}
	
	rdata = rdata.split ('; ');
	cdata = cdata.split ('; ');
	
	removeList();
	addList ( rdata , cdata );
}

function addList ( rdata , cdata ) {
	var oSelect = document.all.Country;
	
	for ( i = 0 ; i < rdata.length ; i ++ ) {
		var oOption = document.createElement ( "OPTION" );
		oOption.value = cdata[i];
		oOption.text = rdata[i];
		oSelect.add ( oOption );
	}
}

function removeList ( ) {
	var oSelect = document.all.Country;
	
	if ( oSelect.length > 0 )
		for ( i = oSelect.length ; i > 0 ; i -- ) {
			oSelect.remove ( i );
		}
}

function changeCountry ( c1 ) {
	var cName = document.sendform.countryName;
	var oSelect = document.all.Country;

	cName.value = oSelect.options[c1].text;
	if (cName.value=='--------------------')
		cName.value = '' 
		//alert ( 'Please select country.' );
		
	else
		cName.value = cName.value
}

function replaceRichtext () {
	if ( IsEdit == "Edit") {
		return false;
	} else {
		var ritem = document.all.Contents.value;
		var sitem = ritem.split ( '<UL>' );
		var titem = '';
		
		for ( i = 0 ; i < sitem.length ; i ++ )
		{
			if ( sitem[i] != '' )
				titem += sitem[i] + '<BR>';
		}
		document.all.rContents.innerHTML = titem;
	}
}

function changeType( tvalue , tname)
{
	tCode = document.sendform.typeCode;
	tName = document.sendform.typeName;
	
	if ( tvalue == 'T4' )
		document.all.UserList.disabled = false;
	else
		document.all.UserList.disabled = true;
	
	tCode.value = tvalue;
	tName.value = tname;
}

function changeCountry2 ( cindex )
{
	var f = document.sendform;
	f.CountryList.value = f.CountryList.options[cindex].text
}

function sendMail(){
 	f = document.sendform;
	var rname = f.regionName.value;
	var rcode = f.Region.value;
	var Cname = f.countryName.value;
	var ccode = f.Country;

	if ( rcode == '' ) {
		alert ( 'Please select Region.' );
		f.Region.focus();
		return;
	} else if ( rcode != 'R01' && ccode.value == '' ) {
		alert ( 'Please select country.' );
		f.Country.focus();
		return;
	} else if ( f.writer.value == '' ) {
		alert ( 'Please enter your name.' );
		f.writer.focus();
		return;
	} else if ( f.CountryList.value == 'C000' || f.CountryList.value == '' ) {
		alert ( 'Please select your Country.' );
		f.CountryList.focus();
		return;
	} else if ( f.tel.value == '' ) {
		alert ( 'Please enter your telephone.' );
		f.tel.focus();
		return;
	} else if ( f.e_mail.value == '' ) {
		alert ( 'Please enter your e-mail.' );
		f.e_mail.focus();
		return;
	} else if ( f.part.value == 'S00' || f.part.value == '' ) {
		alert ( 'Please select Inquire.' );
		f.part.focus();
		return;
	} else if ( f.model.value == 'S00' || f.model.value == '' ) {
		alert ( 'Please select Model.' );
		f.model.focus();
		return;
	} else if ( f.title.value == '' ) {
		alert ( 'Please enter title.' );
		f.title.focus();
		return;
	} else if ( f.contents.value == '' ) {
		alert ( 'Please enter contents.' );
		f.contents.focus();
		return;
	} else {
		f.submit();
	}
}



function sendReply(){
 	f = document.replyform;
	 if ( f.writer.value == '' ) {
		alert ( 'Please enter your name.' );
		f.writer.focus();
		return;
	} else if ( f.e_mail.value == '' ) {
		alert ( 'Please enter your e-mail.' );
		f.e_mail.focus();
		return;
	} else if ( f.tel.value == '' ) {
		alert ( 'Please enter your telephone.' );
		f.tel.focus();
		return;
	} else if ( f.title.value == '' ) {
		alert ( 'Please enter title.' );
		f.title.focus();
		return;
	} else if ( f.contents.value == '' ) {
		alert ( 'Please enter contents.' );
		f.contents.focus();
		return;
	} else {
		f.submit();
	}
}


function cancelPop(){

 	if (confirm("Do you close document?")) {
			self.close();
	}else{
			return;
	}
}

 function spopupWin(URL,width,height) {
var str,width,height;
str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,";
str=str+"width="+width;
str=str+",height="+height+"'";
window.open(URL,'remote',str);
}



function loginChk(){
 	f = document.loginform;

   if ( f.id.value == '' ) {
		alert ( 'Please enter your ID.' );
		f.id.focus();
		return false;
	} else if ( f.password.value == '' ) {
		alert ( 'Please enter your Password.' );
		f.password.focus();
		return false;
	} else {
		f.submit();
	}
}


function downloginChk(){
 	f = document.loginform;

	if ( f.password.value == '' ) {
		alert ( 'Please insert your passwords you have received though the e-mail.' );
		f.password.focus();
		return false;
	} else {
		f.submit();
	}
}


