
function moveFocus(num,fromform,toform)
{
	var str = fromform.value.length;
	if(str == num)
		toform.focus();
}
function checkSpace( str )
{
     if(str.search(/\s/) != -1){
     	return 1;
     }

     else {
         return "";
     }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function goList(){
   sform.exclude.value="1";
   sform.submit();
}

var timer_clear_num = 0;
var timer;

var g_BrowserWidth	= window.innerWidth;
var g_hasLayers		= (document.layers);
var g_hasAll		= (document.all);
var g_hasGetElement = (document.getElementById);

var IE40 = (navigator.appVersion.indexOf("MSIE 4.0") >= 0);
var IE45 = (navigator.appVersion.indexOf("MSIE 4.5") >= 0);
var NS7  = ((navigator.userAgent.indexOf("Netscape/7") >= 0) || (navigator.userAgent.indexOf("Safari") >= 0));
var NS6  = (!g_hasAll && g_hasGetElement);	// this test is positive for NS7 also

var g_sepText;
if (g_hasGetElement || g_hasAll) {
	if (IE40)
		g_sepText = "<font color='#999999' size='1'>&nbsp;|&nbsp;</font>";
	else
		g_sepText ="<span class='subNav' style='color:#999999'>&nbsp;|&nbsp;</span>";
} else if (g_hasLayers) {
	g_sepText = "&nbsp;|&nbsp;";
}
/*function showDDNav(itemId) { 
	var obj;
	if (g_hasGetElement || g_hasAll) {
		if (g_hasGetElement)
			obj = document.getElementById(itemId);
		else
			obj = document.all[itemId];
		
		if (obj)
		{
			if(obj.style.visibility == 'hidden')
			{
				obj.style.visibility = 'visible';
			}
		}
	} else if (g_hasLayers) {
		obj = document.layers[itemId];
		if (obj) 
			if(obj.visibility == 'hide')
				obj.visibility = 'show';
	}
}

function hideDDNav(itemId) {
	var obj;
	if (g_hasGetElement || g_hasAll) {
		if (g_hasGetElement)
			obj = document.getElementById(itemId);
		else
			obj = document.all[itemId];
		if (obj) {
			if(obj.style.visibility == 'visible') {
				obj.style.visibility = 'hidden';
			}
		}
	} else if (g_hasLayers) {
		obj = document.layers[itemId];
		if (obj) 
			if(obj.visibility == 'show')
				obj.visibility = 'hide';
	}
}
*/
function showDDNav(itemId) { 
	var obj = document.getElementById(itemId);
	obj.style.display = 'block'
}

function hideDDNav(itemId) {
	var obj = document.getElementById(itemId);
	obj.style.display = 'none';
}

function reSize()
{
	try{
			var objBody = Category.document.body;
			var objFrame = document.all["Category"];
			ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);

			if (ifrmHeight > 10)
			{
			   objFrame.style.height = ifrmHeight
			}
			else
			{
			   objFrame.style.height = 10;
			}
			objFrame.style.width = '150';
		}catch(e){}
}

function init_iframe()
{
   reSize();
   setTimeout('init_iframe()',0)
}
init_iframe();

function window_open(width, height, name, url)
{
     window.open(url,name,"width="+width+" height="+height+" left=0 top=0 scrollbars=1"); 
}

var ck_mode = 0;
function all_select()
{
    var form = document.forms.list_form;
	if(ck_mode == 0)
	{
		flage1 = false;
		flage2 = true;
		this.btn_display.src="/common/images/icon/btn_lbox_unlock.gif";
		this.btn_display2.src="/common/images/icon/btn_lbox_unlock.gif";
		ck_mode = 1;
	}
	else
	{
		flage1 = true;
		flage2 = false;
		this.btn_display.src="/common/images/icon/btn_lbox_lock.gif";
		this.btn_display2.src="/common/images/icon/btn_lbox_lock.gif";
		ck_mode = 0;	
	}
    for(var i=0; i< form.length; i++)
	{
		if(form[i].checked == flage1)
		{
			form[i].checked=flage2;
		}
	}	
}

function all_select_one()
{
    var form = document.forms.list_form;
	if(ck_mode == 0)
	{
		flage1 = false;
		flage2 = true;
		this.btn_display.src="/common/images/icon/btn_lbox_unlock.gif";
		ck_mode = 1;
	}
	else
	{
		flage1 = true;
		flage2 = false;
		this.btn_display.src="/common/images/icon/btn_lbox_lock.gif";
		ck_mode = 0;	
	}
    for(var i=0; i< form.length; i++)
	{
		if(form[i].checked == flage1)
		{
			form[i].checked=flage2;
		}
	}
}
function del_select(act_url)
{
	var form = document.forms.list_form;
	var cnt = 0;

	for(var i=0; i< form.length; i++)
	{
		if(form[i].checked == true)
		{
			cnt++;
		}
	}
	if(cnt==0)
	{
		alert("이미지를 선택하세요.");
	}
	else
	{
		 var mycon = confirm("선택한 이미지를 삭제하겠습니까?");
		 if(mycon == true)
		 {
			document.list_form.target = "hiddenframe";
			document.list_form.action = act_url;
			document.list_form.submit();
		 }
	}
}

function del_select_m(act_url)
{
	var form = document.forms.list_form;
	var cnt = 0;
	var str = '';

	for(var i=0; i< form.length; i++)
	{
		if(form[i].type == "checkbox" && form[i].checked == true)
		{
			cnt++;
			str += form[i].value+'|';
		}
	}
	if(cnt==0)
	{
		alert("데이타를 선택하세요.");
	}
	else
	{
		 var mycon = confirm("선택한 데이타를 삭제하겠습니까?");
		 if(mycon == true)
		 {
			document.list_form.target = "hiddenframe";
			document.list_form.action = act_url+'?code='+str;
			document.list_form.submit();
		 }
	}
}



function all_input(cnt)
{
	var form = document.forms.list_form
	var check_cnt = 0;
    for(var i=0; i< form.length; i++)
	{
		//if(eval("form.check"+i+".checked") == true)
		if(form[i].checked==true)
		{
			check_cnt++;
		}
	}
	if(check_cnt == 0)
	{
		alert("이미지를 체크하세요.");
		return;
	}
        list_form.target = "pop_result";
	    list_form.action="./pop_result.php/?cnt="+cnt;
        win=window.open(list_form.action,list_form.target,"width=540 height=350 left=0 top=0 scrollbars=yes");
        list_form.submit();
		win.window.focus();
}


// 이미지 프리뷰 창
function img_detail(cmd,seq,image_id,offer_type,offset,img_total,SearchSort,search,SearchFilter)
{
	url = '/search/preview.php?cmd='+cmd+'&image_id='+image_id+'&offer_type=' + offer_type + '&offset='+offset+'&img_total='+img_total+'&seq='+seq+'&SearchSort='+SearchSort+'&SearchFilter='+SearchFilter+'&search='+search;
	win=window.open(url, 'it_img_detail', 'left=20, top=20, width=922, height=723, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1');
	win.window.focus();
}


/*
function view_slideshow(cmd, offset, SearchSort, search,  update_seq, search_link)
{
	url = '/search/slideshow_full.php?cmd='+cmd+'&offset='+offset+'&SearchSort='+SearchSort+'&search='+search+'&search_link='+search_link+'&update_seq='+update_seq; 
	win=window.open(url, 'slidershow_it', 'fullscreen=yes,menubar=yes,status=yes,toolbar=yes,titlebar=no,scrollbar=1,location=no,directories=yes,resizable=1');

	win.window.focus();
}
*/
function view_slideshow(query)
{
	link='/search/view_Slide.php?query='+query;
	var full_win = window.open(link,'view_slide', 'fullscreen=yes,menubar=no,status=no,toolbar=no,titlebar=no,scrollbar=no,location=no,directories=no');
	full_win.focus();
}



