//popup
function popup(url,w,h,n) {
	l = (screen.width) ?	(screen.width-550) / 2	: 0;
	t = (screen.height) ?	(screen.height-400) / 2 : 0;	
	var opt='top='+t+',left='+l+',width='+w+',height='+h;
	opt=opt+',toolbar=no,status=no,directories=no,scrollbars='+n+',location=no,resizable=no,menubar=no';
	window.open(url,'Content',opt);
}

function newwin() {
	var tgservice07="http://www.trigem.co.kr/tgservice/driver/DriverHowto.asp";

	var ScrnSize = "UnCommon"
    if (navigator.appVersion.indexOf("4.") != -1 && navigator.appName.indexOf("Explorer") != -1) {
  		ScrnSize = screen.width + "x" + screen.height;
    }
    if (navigator.appVersion.indexOf("4.") != -1 && navigator.appName.indexOf("Netscape") != -1) {
  		ScrnSize = screen.width + "x" + (screen.height + 19); //Netscape sees 19 pixels less on Height
    }
    switch(ScrnSize) {
    	case "640x480":   tgservice07="driver()";
		case "800x600":   tgservice07="driver()";		
	}	
	if (tgservice07 == "driver()") { //º¯¼ö¸íÀÌ XX ÀÏ°æ¿ì¿¡ ÆË¾÷À»¶ç¿î´Ù
		window.open('http://www.trigem.co.kr/tgservice/driver/product/DriverResult.asp','dd','width=640,height=480,scrollbars=yes,resizable=no,copyhistory=no,toolbar=no'); 
	}else { 		//ÀÏ¹Ý¸µÅ©
		document.location.href = tgservice07;
	}
}

function ImgView(img,w,h) {

			if(img != null) {
					
					win = 	window.open("", "imageviewer", "width="+w+",height="+h+",menubar=no,toolbar=no");
					win.document.open();
					win.document.write("<html><head><title>ImageViewer</title>");
					win.document.write("</head><body bgcolor=#FFFFFF>");
					
//					win.document.write('<div style="position:absolute;width:'+w+'px;height:'+h+'px;left:0px;top:0px">');
//					win.document.write("<a href='Javascript:self.close();'><center><img src=\""+img+"\" border=0></a></center></div></body></html>");
					win.document.write("<a href='Javascript:self.close();'><center><img src=\""+img+"\" border=0></a></center></body></html>");
					win.document.close();
			} else {
				return;
			}
	}

function ImgView01(img,w,h) {

			if(img != null) {
					wdiv= w-16;
					win = 	window.open("", "imageviewer", "width="+w+",height="+h+",scrollbars=yes, menubar=no,toolbar=no");
					win.document.open();
					win.document.write("<html><head><title>ImageViewer</title>");
					win.document.write("</head><body bgcolor=#FFFFFF>");
					
					win.document.write('<div style="position:absolute;width:'+wdiv+'px;height:'+h+'px;left:0px;top:0px">');
					win.document.write("<a href='Javascript:self.close();'><center><img src="+img+" border=0></a></center></div></body></html>");
					win.document.close();
			} else {
				return;
			}
	}

function ImgView02(img,w,h) {

			if(img != null) {
					wdiv= w-16;
					win = 	window.open("", "imageviewer", "width="+w+",height="+h+",scrollbars=no, menubar=no,toolbar=no");
					win.document.open();
					win.document.write("<html><head><title>ImageViewer</title>");
					win.document.write("</head><body bgcolor=#FFFFFF>");
					
					win.document.write('<div style="position:absolute;width:'+wdiv+'px;height:'+h+'px;left:0px;top:0px">');
					win.document.write("<a href='Javascript:self.close();'><center><img src="+img+" border=0></a></center></div></body></html>");
					win.document.close();
			} else {
				return;
			}
	}
	
function frsendwin(seq) {
			window.open("/tgproduct/popzoom.asp?p_seq="+seq, "zoom", "scrollbars=yes,resizable=no,copyhistory=no,width=667,height=700");
	}

    
var ImgName;
function ImgOn(obj)
{
	ImgName=obj;
	ImgView.src=ImgName;
}

function Fix()
{
	Look = ImgName;
	ImgView.src=Look;
}

function CompareWin()
{
	window.open("/tgproduct/PopCompare.asp","compare","scrollbars=yes,resizable=no,copyhistory=no,width=667,height=785")
}

/* ³ëÆ®ºÏ ¼³¸í¹® ·¹ÀÌ¾î ½ºÅ©¸³Æ® */
function setupDescriptions() {
var x = navigator.appVersion;
y = x.substring(0,4);
if (y>=4) setVariables();
}
var x,y,a,b;
function setVariables(){
	h=".pixelLeft=";
	v=".pixelTop=";
	dS="";
	sD=".style";
}
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function popLayer(a,left,top){
desc = "<table cellpadding=0 border=0 bgcolor=#F9F9EA width=154 style='border:1 solid #CDBD61'><td style='padding:7'><font color=#848244>";

if (a==1) desc += "AG 12.1\"\ ÀÌµ¿ÀÌ ¸¹Àº »ç¿ëÀÚ¸¦ À§ÇÑ ³ëÆ®ºÏ";
if (a==2) desc += "AR 14.1\"\ ÃÖ°íÀÇ ¸ð¹ÙÀÏ Æ¯±Ç ¼¾Æ®¸®³ë ³ëÆ®ºÏ";
if (a==3) desc += "BG 17\"\ ³Ð°Ô º¸°í ºü¸£°Ô ¿¢¼¼½ºÇÑ´Ù";
if (a==4) desc += "ER 15\"\ ÁßÀú°¡ °í¼º´É ¼¾Æ®¸®³ë ³ëÆ®ºÏ";
if (a==5) desc += "FD 15\"\ ÃÖ´ëÀÇ È®Àå¼º. ÃÖ°íÀÇ ¼º´É";
if (a==6) desc += "G7 15.2\"\ Wide Highlight LCD";
if (a==7) desc += "G9 15.2\"\ Wide Highlight LCD";
if (a==8) desc += "ddd";
if (a==9) desc += "HB 13.3\"\ ÃÊ°æ·® ¼¾Æ®¸®³ë ³ëÆ®ºÏ";
if (a==10) desc += "TL 14.1\"\ ½Ç¿ë¼º ³ôÀº °æÁ¦Àû ³ëÆ®ºÏ";
desc += "</td></table>";

object1.innerHTML=desc;
object1.style.pixelLeft = left;
object1.style.pixelTop = top;
//document.object1.style.visibility="visible"
}

function hideLayer(a){
object1.innerHTML="";
}

function handlerMM(e){
x = (isNav) ? e.pageX : event.clientX;
y = (isNav) ? e.pageY : event.clientY;
}
document.onmousemove = handlerMM;

function getCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;

	while ( x <= document.cookie.length ) {
		var y = (x+nameOfCookie.length);
	
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
				if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
						endOfCookie = document.cookie.length;
				return unescape( document.cookie.substring( y, endOfCookie ) );
		}

		x = document.cookie.indexOf( " ", x ) + 1;
	
		if ( x == 0 )
			break;
	}

	return "";
}

function hanmail_check(val) {
	pos = val.indexOf("@")+1;
	ext = val.substring(pos).toLowerCase();

	if(ext == "hanmail.net" || ext == "daum.net") 
		return false;
	else
		return true;
}

function check_email(objEmail, val) { 
    var emailpattern = /[-!#$%&'*+/^_~{}|0-9a-zA-Z]+(.[-!#$%&'*+/^_~{}|0-9a-zA-Z]+)*@[-!#$%&'*+/^_~{}|0-9a-zA-Z]+(.[-!#$%&'*+/^_~{}|0-9a-zA-Z]+)*/;
    var raw_mail_address = val.replace(/\s/g,'');  
    var result; 

	objEmail.value = raw_mail_address;
    result = raw_mail_address.match(emailpattern); 

    if (result == null) { 
	    alert(raw_mail_address + "´Â Àß¸øµÈ Email ÁÖ¼ÒÀÔ´Ï´Ù. ");                
		objEmail.focus();
        return false;
    } else {
        return true;
    }
}


function customer_pop() {
			window.open('/tgservice/customer/pop_ct_cost.asp','name','scrollbars=yes width=830 height=510');
	}

// ÇÃ·¡½Ã

function Swf_View(URL,SizeX,SizeY,LnkId,Frm,Flag) // quick
{
    document.write('            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
    //document.write('                    codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
	document.write('                    codebase="https://www.trigem.co.kr/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
    document.write('                    width="'+SizeX+'" height="'+SizeY+'"  id="'+LnkId+'" align="middle">');
    document.write('            <param name="movie"     value="'+URL+'" />');
    document.write('            <param name="quality"   value="high" />');
    if ( Flag == null || Flag != 'N' )
    {
        document.write('        <param name="wmode"     value="transparent"/>');
    }
	document.write('			<param name="allowScriptAccess" value="always"/> ');
	document.write('			<param name="base" value="." />');
    document.write('            <embed base="." src="'+URL+'" quality="high" width="'+SizeX+'" height="'+SizeY+'"  align="middle" ');
	 if ( Flag == null || Flag != 'N' )
    {
        document.write('       		wmode="transparent" ');
    }
    document.write('           		type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" swLiveConnect=true name="'+LnkId+'"  />');
    document.write('            </embed></object>');
	if ( Frm == 'Y' ) { // form ÅÂ±× µé¾î°¡´Â ÆäÀÌÁö¿¡ Àû¿ë
		eval("window." + LnkId + " = document.forms[0]."+ LnkId +"; ");
	}
}

function cleanup() {	// 'Out of memory line at 56' ¿À·ù ¶ã °æ¿ì
 __flash_unloadHandler = function(){
  externalProbSet = true;
  obj = document.getElementsByTagName('OBJECT');
  for (i=0;i<obj.length;i++){
   var theObj = eval(obj[i]);
   theObj.style.display = "none";
   for (var prop in theObj){
    if (typeof(theObj[prop]) == "function"){
     theObj[prop]=null
    }
   }
  }
 }
 if (window.onunload != __flash_unloadHandler){
  __flash_savedUnloadHandler = window.onunload;
  window.onunload = __flash_unloadHandler;
 }
}
window.onbeforeunload=cleanup;

function tab(num)
{
	if(num == '1')
	{
		document.getElementById('Layer1').style.display = 'block';
		document.getElementById('Layer2').style.display = 'none';
		document.getElementById('Layer3').style.display = 'none';
	
	}
	else if(num == '2')
	{
		document.getElementById('Layer1').style.display = 'none';
		document.getElementById('Layer2').style.display = 'block';
		document.getElementById('Layer3').style.display = 'none';
	
	}
	else if(num == '3')
	{
		document.getElementById('Layer1').style.display = 'none';
		document.getElementById('Layer2').style.display = 'none';
		document.getElementById('Layer3').style.display = 'block';
		
	}

}

