// LEFT MENUÀÇ ¸µÅ©°ª

function GoMenu(name) {
    if (eval(name) == "") {
        alert("¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù.");
        return;    
    } else {
		document.location.href = eval(name);
	}
}

// Company
	var company="/01_company/info.html";	// company info
	var company01="/01_company/history.html";	// comapny history
	

// Product
	var product="/02_product/set_01.html";	// color camera
	var product01="/02_product/ptz_01.html";	// ptz camera
	

// News
	var news="/03_news/news_list.html";	// Players
			
		
// Qna
	var qna="/04_qna/qna_list.html";	// Q&A
	
var set01="x";	// Color Set camera
		var set0101="/02_product/set_01.html";	// ST-400CD/400CA
		var set0102="/02_product/set_02.html";	// ST-403CD/203CD
		var set0103="/02_product/set_03.html";	// ST-404CD/204CD
		var set0104="/02_product/set_04.html"; // ST-400CB/ADB
		
	var dome01="x";	// Color Dome Camera
		var dome0101="/02_product/dome_01.html"; //	ST-410CA/210CA
		var dome0102="/02_product/dome_02.html"; //	ST-231CA
		var dome0103="/02_product/dome_03.html"; //	ST-462CV/262CV
		var dome0104="/02_product/dome_04.html"; //	ST-470C/270C
		var dome0105="/02_product/dome_05.html"; // ST-462CVP/262CVP
		var dome0106="/02_product/dome_06.html"; //	ST-470CV/270CV
		var dome0107="/02_product/dome_07.html"; //	ST-470CVP/270CVP
		var dome0108="/02_product/dome_08.html"; //	ST-440CP/240CP
		var dome0109="/02_product/dome_09.html"; //	ST-440FCP/240FCP
		
	var mini01="x";	// Color Mini Camera
		var mini0101="/02_product/mini_01.html";	//	ST-461C/261C
		var mini0102="/02_product/mini_02.html";	//	ST-462C/262C

	var sepcial01="/02_product/special_01.html";	//	Special Camera
	
	var led01="x";	//	IR LED Camera	
		var led0101="/02_product/ir_01.html";	//	ST-520IR/530IR
		var led0102="/02_product/ir_02.html";	//	ST-2050IR
		var led0103="/02_product/ir_03.html";	//	ST-2000IR
		var led0104="/02_product/ir_04.html";	//	ST-2020IR
		var led0105="/02_product/ir_05.html";	//	ST-CATS EYE
		var led0106="/02_product/ir_06.html";	//	ST-CIT36/CHT36
		var led0107="/02_product/ir_07.html";	//	ST-CI48C/CI48HC
		var led0108="/02_product/ir_08.html";	//	ST-CI48VC/CI48HVC
		var led0109="/02_product/ir_09.html";	//	ST-CIE48VC/CIE48HVC
		var led0110="/02_product/ir_10.html";	//	ST-CIE50HVC
		var led0111="/02_product/ir_11.html";	//	ST-ZC 08GIR
		var led0112="/02_product/ir_12.html";	//	ST-IB100
		var led0113="/02_product/ir_13.html";	//	ST-IV120
		
// PTZ Camera/DVR/CCTV System
	var ptz01="";	// PTZ Camera
		var ptz0101="/02_product/ptz_01.html";	// SA series
		var ptz0102="/02_product/ptz_02.html";	// SE series
		var ptz0103="/02_product/ptz_03.html";	// CU series
		var ptz0104="/02_product/ptz_04.html";	// CE series
		var ptz0105="/02_product/ptz_05.html";	// SM series
		var ptz0106="/02_product/ptz_06.html";	// MV series
		var ptz0107="/02_product/ptz_07.html";	// MR series
		var ptz0108="/02_product/ptz_08.html";	// SV series X26
		var ptz0109="/02_product/ptz_09.html";	// SV series X30
		var ptz0110="/02_product/ptz_10.html";	// SV series X22
		var ptz0111="/02_product/ptz_11.html";	// CV series X26
		var ptz0112="/02_product/ptz_12.html";	// CV series X30
		var ptz0113="/02_product/ptz_13.html";	// CV series X22
		
	var stand01="";	// Stand Alone DVR
		var stand0101="/02_product/dvr_01.html";	// AVR-400S
		var stand0102="/02_product/dvr_02.html";	// JSD-400
		var stand0103="/02_product/dvr_03.html";	// JSD-800
		var stand0104="/02_product/dvr_04.html";	// JSD-1600
		var stand0105="/02_product/dvr_05.html";	// PDR-J1004/1008
		var stand0106="/02_product/dvr_06.html";	// PDR-H series
		var stand0107="/02_product/dvr_07.html";	// PDR-M1000 series
		var stand0108="/02_product/dvr_08.html";	// PDR-M5000 series
		var stand0109="/02_product/dvr_09.html";	// AIO-400/800
		var stand0110="/02_product/dvr_10.html";	// HQD-400R
		var stand0111="/02_product/dvr_11.html";	// HQD-800R
		var stand0112="/02_product/dvr_12.html";	// HQD-1600R
		
	var pc01="";	// PC Based DVR
		var pc0101="/02_product/pc_01.html";	// T04
		var pc0102="/02_product/pc_02.html";	// TS04
		var pc0103="/02_product/pc_03.html";	// CS04
		var pc0104="/02_product/pc_04.html";	// CS08
		var pc0105="/02_product/pc_05.html";	// CD08
		var pc0106="/02_product/pc_06.html";	// CS16
		var pc0107="/02_product/pc_07.html";	// CD16
		var pc0108="/02_product/pc_08.html";	// LS16
		var pc0109="/02_product/pc_09.html";	// LD16
		
	var cctv01="";	// CCTV System
		var cctv0101="/02_product/cctv_01.html";	// DOOREYE
		var cctv0102="/02_product/cctv_02.html";	// WTX-1500
		var cctv0103="/02_product/cctv_03.html";	// WTX-2000
	
	var visual01="/02_product/set_04.html";	// 
	var visual02="/02_product/ptz_06.html";	// 
	var visual03="/02_product/mini_03.html";	// 
	var visual04="/02_product/ir_06.html";	// 
	var visual05="/02_product/ir_11.html";	// 
	var visual06="/02_product/dvr_08.html";	// 
	


function openWindow(url, w, h, add) {
	if (!w) {
		var w = 600;
	}
	if (!h) {
		var h = 700;
	}
	if (screen.width < 1025){
		LeftPosition=0;
		TopPosition=0;
	 } else {
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	 }
	var Win = window.open(url, "", "width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition + add);
}

function ltrim(str)
{
	var strreturn = "";
	for(i=0; i <= str.length-1 ; i++)
	{
		if (str.charAt(i) != ' ')
		{
			strreturn = str.substring(i,str.length);
			return strreturn;
		}
	}
	return strreturn;
}

function rtrim(str)
{
	var strreturn = "";
	for(i=str.length-1; i >=0  ; i--)
	{
		if (str.charAt(i) != ' ')
		{
			strreturn = str.substring(0,i+1);
			return strreturn;
		}
	}
	return strreturn;
}

function trim(str)
{
	return rtrim(ltrim(str));
}
function JS_viewObj(html) {
	document.write(html);
}
function OpenImage(s, a){

        srcImg = new Image();
        clientWidth = screen.width;
        clientHeight = screen.height;
        srcImg.src = s;
  
        var srcFileName = srcImg.src.substr(srcImg.src.lastIndexOf("/")+1, srcImg.src.length);

        win = window.open("","","width=15,height=15,scrollbars=no,resizable=no,left="+(clientWidth/2-15)+",top="+(clientHeight/2));
        win.document.writeln("<html>");
        win.document.writeln("<head>");
        win.document.writeln("<title>"+a+"</title>");
        win.document.writeln("</head>");
		win.document.writeln('<body topmargin="0" leftmargin="0">');
        win.document.writeln("<link rel=\"STYLESHEET\" type=\"text/css\" href=\"/images/sunin.css\">");
        win.document.writeln('<table cellpadding="0" cellspacing="0" border="0" width="500">');
        win.document.writeln('<tr><td><a href="#"><img src="/images/pop_tt01.gif"></a></td></tr>');
        win.document.writeln(" <tr><td align='center'><img src="+s+" name='winImg' alt='ÀÌ¹ÌÁö¸¦ ´©¸£½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.' onclick='self.close();' style='cursor:hand'></td></tr>");
        win.document.writeln('<tr><td height="25" bgcolor="#5D5D5D" align="right"><img src="/images/butn_pop_close.gif" hspace="4" style="cursor:hand" onclick="self.close()"></td></tr>');
        win.document.writeln("</table>");
        win.document.writeln("</body>");
        win.document.writeln("</html>");

        srcImg = win.document.winImg;

        while(true)
                if(srcImg.readyState == "complete")
                        break;
        
        var winWidth = srcImg.width+10;
        var winHeight = srcImg.height+130;
		//alert(srcImg.height + "$$$" + winHeight)
		if (winWidth < 510) winWidth = 510;
        var left = (clientWidth/2)-(srcImg.width/2);
        var top = (clientHeight/2)-(srcImg.height/2);

        if(clientWidth <= srcImg.width){
                winWidth = clientWidth;
                left = 0;
                win.document.body.scroll = "auto";
        }
        if(clientHeight <= srcImg.height){
                winHeight = clientHeight-30;
                top = 0;
                win.document.body.scroll = "auto";
        }

        win.moveTo(left, top);
        win.resizeTo(winWidth, winHeight);

}
