	// script.js


var defaultInput = "검색어를 입력해 주십시요";

// check Submit
function checkSubmit() {
	var frm = document.search;
	if (frm.query.value == defaultInput || frm.query.value == "") {
		alert(defaultInput);
		frm.query.focus();
		return false;
	}

	if (typeof frm.requery != "undefined") {
		if (frm.requery.checked == true) {
			if (frm.query.value == frm.rq.value) {
				if (!confirm("같은 검색어를 재검색 하시겠습니까?")) return false;
			}
			//frm.query.value = frm.rq.value + " " + frm.query.value;
			frm.rq.value = frm.rq.value + " " + frm.query.value;
			//frm.rq.value = null;
		}
	}

	var collection = frm.collection.value;
	frm.SFidx.value = 0;
	if (collection != "all") {
		frm.pcount.value = 10;
	} else {
		frm.pcount.value = 3;
	}
	
	PageAction();// 페이지 처리 
	
	
	frm.sort.value = "";
	frm.order.value = "";
	frm.submit();
}

function goPopularSearch(query)
{
	document.search.query.value = query;
	if (document.search.collection.value  != "all") {
		document.search.pcount.value = 10;
	} else {
		document.search.pcount.value = 3;
	}
	document.search.submit();
}

function clearQuery(obj) {
	if (obj.checked == true) document.search.query.value = "";
}

// set default input value
function setDefaultUI() {
	// query null 값 처리
	var inputObj = search.query;
	if (inputObj.value == "") inputObj.value = defaultInput;
	//background="images/dw_top2_tab_01.gif"
	// tab UI 모양 변경
	var tabIdOpt = search.collection.options
	var collection = search.ti.value;
	for (var i = 0; i < tabIdOpt.length; i++) {
		var tabObj = document.getElementById(tabIdOpt[i].value);
		if (collection == tabIdOpt[i].value) {
			tabObj.style.backgroundImage = "url(images/dw_top2_tab_01.gif)";
			tabObj.className = null;
		} else {
			tabObj.style.backgroundImage = "url(images/dw_top2_tab_02.gif)";
			tabObj.className = "table_lk";
		}
	}
}

// move tab
function moveTab(collection) {
	
	
	
	var frm = search;
	
	if (frm.query.value == "" || frm.query.value == defaultInput) {
		alert(defaultInput);
		return;
	}
	frm.collection.value = collection;
	frm.SFidx.value = 0;
	if (collection != "all") {
		frm.pcount.value = 10;
	} else {
		frm.pcount.value = 3;
	}

	if( frm.vPlinkClassID ) {	
		frm.vPlinkClassID.value = "";
	}
	
	PageAction();// 페이지 처리 
	
	frm.sort.value = "";
	frm.order.value = "";
	frm.submit();

}

// move tab
function moveTab(collection, EMPNO) {
	
	
	
	var frm = search;
	if (frm.query.value == "" || frm.query.value == defaultInput) {
		alert(defaultInput);
		return;
	}
	frm.collection.value = collection;
	frm.SFidx.value = 0;
	if (collection != "all") {
		frm.pcount.value = 10;
	} else {
		frm.pcount.value = 3;
	}
	
	if( frm.vPlinkClassID ) {	
		frm.vPlinkClassID.value = "";
	}

/*
	if(tabId == 'MAIL')
	{
		if(EMPNO == '9891302' || EMPNO == '0093745')
		{
			frm.sort.value = "";
			frm.order.value = "";
			frm.submit();
		}
		else
		{
			alert('준비중입니다.');
			return;
		}
	}
*/
	
	PageAction();// 페이지 처리 
	
	frm.sort.value = "";
	frm.order.value = "";
	frm.submit();

}

function moveMore(colId) {
	var frm = document.search;
	//if (frm.query.value == "") frm.query.value = frm.rq.value;
	frm.collection.value = colId;
	frm.SFidx.value = 0;
	frm.pcount.value = 10;
	frm.sort.value = "";
	frm.order.value = "";
	frm.submit();
}

function goPage(SFidx){
	var frm = document.search;
	//if (frm.query.value == "") frm.query.value = frm.rq.value;
	frm.SFidx.value = SFidx;
	frm.submit();
}

function sortResult(field) {
    var frm = document.search;
    if (frm.query.value == "") frm.query.value = frm.rq.value;
    frm.SFidx.value = 0;
    frm.sort.value = field;
    if (frm.order.value == 0) frm.order.value = 1;
    else if (frm.order.value == 1) frm.order.value = 0;
    frm.submit();
}

function ShopsortResult(field, sortid) {
    var frm = document.search;
    
    frm.sort.value = field;
    frm.order.value=sortid;
	
    
    frm.submit();
}


var pharosLogin = false;
function linkPharos(id, nid) {
	var url = "http://152.149.66.85/DWConstLib/BaseWeb/PublicWeb/SearchWeb/PgDetail.aspx?ctrNo="+id+"&NodeId="+nid;
	if (!pharosLogin){
		var frm = document.pharos_frm;
		frm.target = "pharos";
		frm.submit();
		window.setTimeout("window.open('"+url+"', 'pharos')",500);
		pharosLogin = true;
	} else {
		window.open(url, "pharos");
	}
}

function clearDefault(obj){
	if (obj.value == defaultInput) {
		obj.value = "";
	}
}

//--------------------------------------------------------------------------------
// url 주소로 새창 열기
// ex)
//--------------------------------------------------------------------------------
function page_open(url) {
//alert(url);
	var wSize  = 800;
	var hSize = 600;

  	x = screen.width;
	y = screen.height;
	
	wid = (x-800) / 2;
	hei = (y-600) / 2;
	var win2=window.open(url,'win2','toolbar=no,menubar=no,directories=no,location=no,status=no,resizable=yes,scrollbars=yes, top='+hei+',left='+wid + ',width=' + wSize + ',height=' + hSize);

	win2.focus();
}


//첨부 파일 레이어 마우스 
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)


var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
 var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
 var parentEl=what.offsetParent;
 while (parentEl!=null){
  totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
  parentEl=parentEl.offsetParent;
 }
 return totaloffset;
}

function showhide(obj, e, visible, hidden){
 if (ie5||ns6)
  dropmenuobj.style.left=dropmenuobj.style.top=-500
 if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
  obj.visibility=visible
 else if (e.type=="click")
  obj.visibility=hidden
}

function iecompattest(){
 return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
 var edgeoffset=0
 if (whichedge=="rightedge"){
 var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
  dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
 if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
  edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
 }
 else{
 var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
  dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
 if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
  edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
 }
 return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
 if (window.event) event.cancelBubble=true
 else if (e.stopPropagation) e.stopPropagation()
 if (typeof dropmenuobj!="undefined") //hide previous menu
  dropmenuobj.style.visibility="hidden"
  clearhidemenu()
 if (ie5||ns6){
  obj.onmouseout=delayhidemenu
  dropmenuobj=document.getElementById(dropmenuID)
 if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
  dropmenuobj.onmouseover=clearhidemenu
  dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
  showhide(dropmenuobj.style, e, "visible", "hidden")
  dropmenuobj.x=getposOffset(obj, "left")
  dropmenuobj.y=getposOffset(obj, "top")
  dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
  dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
 }
 return clickreturnvalue()
}

function clickreturnvalue(){
 if ((ie5||ns6) && !enableanchorlink) return false
 else return true
}

function contains_ns6(a, b) {
 while (b.parentNode)
 if ((b = b.parentNode) == a)
 return true;
 return false;
}

function dynamichide(e){
 if (ie5&&!dropmenuobj.contains(e.toElement))
  delayhidemenu()
 else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
 delayhidemenu()
}

function delayhidemenu(){
 delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu(){
 if (typeof delayhide!="undefined")
  clearTimeout(delayhide)
}



//레이어 숨기기,보이기3
//layer : layer id
function show_hidden3(layer)
{
	if(layer == 'buttonclick')
	{
		if(divsearchbar_check.style.display == '')
		{
			divsearchbar_check.style.display = '';
			//divsearchbar.style.display = 'none';
		}
		else
		{
			//divsearchbar.style.display = '';
			divsearchbar_check.style.display = '';
		}
	}
/*
	else
	{
		if(layer.id=='divsearchbar')
		{
			divsearchbar_check.style.display = '';
			divsearchbar.style.display = 'none';
		}
		else
		{
			divsearchbar_check.style.display = 'none';
			divsearchbar.style.display = '';
		}	
	}
*/
}

//레이어 숨기기,보이기2
//layer : layer id, button : button id
function show_hidden2(layer)
{
	if(layer.style.display == '')
	{
		layer.style.display = 'none';		
	}
	else
	{
		layer.style.display = '';
	}
}


function show_menu_layer(layer)
{
	layer.style.display = '';
}

function hidden_menu_layer(layer)
{
	layer.style.display = 'none';
}

//레이어 숨기기,보이기
//layer : layer id, button : button id
function show_hidden1(layer,button)
{
	if(layer.style.display == '')
	{
		layer.style.display = 'none';		
		button.src = "images/btn_open.gif";
	}
	else
	{
		layer.style.display = '';
		button.src = "images/btn_close.gif";
	}
}

//검색창 레이어 관련
function click_collectino_layer(id,name){
	divsearch1.innerHTML=name;
	document.search.collection.value = id;
	show_hidden2(divsearchbar);
}

function click_collectino_layer2(id,name){
	divsearch1.innerHTML=name;
	document.search.collection.value = id;
	show_hidden2(divsearchbar_check);
}

var expDays = 1; // 만료기간 (7일)
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
var ShowCount = 0;
var countWord = 14; // 저장갯수

function input_cookie1(object){

	if(object.checked)
	{
		SetCookie (object.name, 'y')
	}
	else
	{
		SetCookie (object.name, 'n')
	}
}

//체크박스 전체선택,전체해제
function input_cookie_all(){

	var bChecked;
	for (x=1;x<=11;x++) 
	{ 
		if(document.all("tab_check"+x).checked == false)
		{
			bChecked = true;
		}
	} 
	if(bChecked){
		for(i=1; i<=11; i++)
		{
			SetCookie('tab_check'+i,'y');		
			document.all("tab_check"+i).checked = true;
		}	
	}else{
		for(i=1; i<=11; i++)
		{
			SetCookie('tab_check'+i,'n');		
			document.all("tab_check"+i).checked = false;
		}	
	}
}
//체크박스 전체선택,전체해제
function input_cookie_all2(){

	var bChecked;
	for (x=4;x<=6;x++) 
	{ 
		if(document.all("tab_check"+x).checked == false)
		{
			bChecked = true;
		}
	} 
	if(bChecked){
		for(i=4; i<=6; i++)
		{
			SetCookie('tab_check'+i,'y');		
			document.all("tab_check"+i).checked = true;
		}	
	}else{
		for(i=4; i<=6; i++)
		{
			SetCookie('tab_check'+i,'n');		
			document.all("tab_check"+i).checked = false;
		}	
	}
}


function input_cookie_all_reset(){

	for(i=1; i<=11; i++)
	{
		SetCookie('tab_check'+i,'n');		
		document.all("tab_check"+i).checked = false;
	}	
}

function realWordItemsCount(){
	var NummyWordItems = GetCookie('myWord');
	var i;
	var k;
	var myWordItem;
	if (NummyWordItems == null) {
		NummyWordItems = 0;
	}	

	ShowCount = 0; 
	k=0;
	for (i=NummyWordItems; i >= 0; i--) {
		myWordItem = GetCookie('myWordItem'+i);
		if (myWordItem != null) {
			k++;
		}		
	}
	//alert(k);
	return k;
}

function trim(str) {
  var count = str.length;
  var len = count;                
  var st = 0;
			
  while ((st < len) && (str.charAt(st) <= ' ')) {
	 st++;
  }
  while ((st < len) && (str.charAt(len - 1) <= ' ')) {
	 len--;
  }                
  return ((st > 0) || (len < count)) ? str.substring(st, len) : str ;   
}

function compareWord(str){
	var NummyWordItems = GetCookie('myWord');
	var i;
	var k;
	var myWordItem;
	if (NummyWordItems == null) {
		NummyWordItems = 0;
	}	

	ShowCount = 0; 
	k=0;
	for (i=NummyWordItems; i >= 0; i--) {
		myWordItem = GetCookie('myWordItem'+i);
		if (myWordItem != null ) {
			k++;
			if (trim(str) == trim(myWordItem)){
				return false;				
				break;
			}
		}		
	}

	return true;
}

function ListmyWordItems() {
	var NummyWordItems = GetCookie('myWord');
	var i;
	var k;
	var myWordItem;
	if (NummyWordItems == null) {
		NummyWordItems = 0;
	}	

	ShowCount = 0; 
	k=0;
	for (i=NummyWordItems; i >= 0; i--) {
		myWordItem = GetCookie('myWordItem'+i);
		if (myWordItem != null) {
			k++;
			if(k < 10){
				PrintItem(myWordItem, i);
			}
		}		
	}
}

function DeleteItem(Count) {
	DeleteCookie('myWordItem'+Count);
}


/*
function PrintItem (myWordItem, Count) {
	ShowCount++;
	document.write("<tr><td colspan=\"2\" style=\"padding:4 4 4 4\"><a href=\"#\" class=\"gray30\">"+myWordItem+"</a>&nbsp;&nbsp;");
	document.write("<img src=\"/search/imgs/btn_x.gif\" width=\"11\" height=\"11\" border=\"0\" align=\"absmiddle\" onclick=\"DeleteItem(" + Count + ")\"></td></tr>");
}
*/

function PrintItem (myWordItem, Count) {
	ShowCount++;
	myWordItem=myWordItem.replace('&','&amps;');
	myWordItem=myWordItem.replace('<','&lt;');
	myWordItem=myWordItem.replace('>','&gt;');
	myWordItem=myWordItem.replace('#','&#35;');
	myWordItem=myWordItem.replace('(','&#40;');
	myWordItem=myWordItem.replace(')','&#41;');
	
	
	//document.write("<tr><td width=\"7\" height=\"17\" align=\"left\" valign=\"top\"><img src=\"/images/search/icon_red_cross.gif\"></td>");
	//document.write("<td class=\"red\"><a href=\"#gokey\" onclick=\"myWordSubmit('"+myWordItem+"');\">"+myWordItem+"</td></tr>");
	document.write("<tr><td align='left' valign='top'></td><td  height='17' align='left' valign='top' width=5><img src='http://img.market.cyworld.nate.com/front/images/search/icon_red_cross.gif'></td>"); 
	document.write("<td><a href=\"#gokey\" style='color:FF6664; font-size:11px;' onclick=\"myWordSubmit('"+myWordItem+"');\">"+myWordItem+"</a> <span class=gray_666s></span> </td></tr>");
}

function AddItem() {	
	var NummyWordItems = GetCookie('myWord');
	var i;
	var myWordItem;
	if (NummyWordItems == null) {
		NummyWordItems = 0;
	}
	myWordItem = document.mainsearch.query.value;
	
	if (compareWord(myWordItem)){
		NummyWordItems++;
		SetCookie('myWordItem'+NummyWordItems, myWordItem, exp);
		SetCookie('myWord',NummyWordItems, exp);
	}
}

var taip = '152.149.59.5';

function set() {
	VisitorName = prompt("WHO");
	SetCookie ('VisitorName', VisitorName, exp);
	SetCookie ('WWHCount', 0, exp);
	SetCookie ('WWhenH', 0, exp);
}

function getCookieVal (offset) {  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1) endstr = document.cookie.length;  
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg) return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	}
	return null;
}

function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) +  ((domain == null) ? "" : ("; domain=" + domain)) +    ((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


var sRepeat=null; 

function doScrollerIE(dir, src, amount) { 
	if (amount==null) amount=10; 
	if (dir=="up") 
	document.all[src].scrollTop-=amount; 
	else 
	document.all[src].scrollTop+=amount; 
	if (sRepeat==null) 
	sRepeat = setInterval("doScrollerIE('" + dir + "','" + src + "'," + amount + ")",100); 
	return false 
} 


window.document.onmouseout = new Function("clearInterval(sRepeat);sRepeat=null"); 
window.document.ondragstart = new Function("return false"); 




function parentmenu( menu , coll ) {

	var frm = document.search;
	
	
	
	if (typeof frm.menu != "undefined") {
		//document.getElementById("menu").value = menu ;
		frm.menu.value = menu ;
	}
	
	
	frm.collection.value = coll;
	frm.SFidx.value = 0;
	frm.pcount.value = 3 ;
	
	
	PageAction();
		
	frm.sort.value = "";
	frm.order.value = "";
	frm.submit();
}


// 페이지 링크 
function PageAction(){
	
	if (typeof document.search.ThisPage != "undefined") {
		var frm = document.search;
		
		var val_collection = frm.collection;
		var val_menu = frm.menu;
		var ThisPage = frm.ThisPage;
	
		if( ThisPage.value == 'kids' || ThisPage.value == 'teen'  ) 
		{
			if( val_collection.value == 'all' &&  (val_menu.value == 'menu_shop' || val_menu.value == 'menu_all' ) ) 
			{
				if( ThisPage.value == 'kids') {frm.action = '/jsp/kids/search/search_kids.jsp';}
				else if( ThisPage.value  == 'teen') {frm.action = '/jsp/teen/search/search_teen.jsp';}
			}else {
				if( ThisPage.value  == 'kids') {frm.action = '/jsp/kids/search/search_kids_scn.jsp';}
				else if( ThisPage.value  == 'teen') {frm.action = '/jsp/teen/search/search_teen_scn.jsp';}
			}
		}
	}
}


function PopMenu( ejkgb , coll ) {

	var frm = document.search;
	//document.getElementById("menu").value = menu ;
	//if( ejkgb != "" )
		frm.vPejkGB.value = ejkgb;
		//document.getElementById("vPejkGB").value = ejkgb ;
		
	frm.collection.value = coll;
	frm.SFidx.value = 0;
	frm.pcount.value = 3 ;
		
	frm.sort.value = "";
	frm.order.value = "";
	frm.submit();
}


function chgViewSearch(val){
	var frm = document.search;
	
	frm.vUviewSearch.value = val.value;
	
	frm.submit();
}



function goMoreKey( type ){

	var cateopen = document.getElementById("cateopen");
	var cateclose = document.getElementById("cateclose");
	var count = document.getElementById("CateCountVal").value;
	
	if( type == 'show' ) {
		cateopen.style.display = 'none';cateclose.style.display = '';
	}else {
		cateopen.style.display = '';cateclose.style.display = 'none';
	}
	if( count > 8 ) {
		for( i = 9; i < count ; i++ ) {
			document.getElementById("MoreKey_"+i).style.display = (type == 'show' ? '' : 'none');	
		} 
	}
}



//리스트 개수 변경
function chgViewCount(val)
{
	
	//var searchView =  eval('document.searchFrm5.'+val.name);
	
    var searchFrm = document.search;
	var sViewCount = val.value ;
	
	
	searchFrm.pcount.value = sViewCount;
	searchFrm.viewcount.value = sViewCount;
	//searchFrm.vPplace.value = "list";

	// 재 검색 방지
	/*
	if (searchFrm.vPreSearch.value == "2")
	{
		searchFrm.vPnoReSearch.value = "1";
	} else {
		searchFrm.vPnoReSearch.value = "3";
	}
	*/

	// 현재 페이지가 국내도서, 외국도서, 음반, DVD, GIFT 일 경우 카테고리별 전체 개수 유지
	//var sCategory = searchFrm.vPstrCategory.value ;
	//if (sCategory == "KOR" || sCategory == "ENG" || sCategory == "MUC" || sCategory == "DVD" || sCategory == "GFT"){
	/*	searchFrm.vPkorBookTotcnt.value =  document.searchGroup.KorbookTotCnt.value;
		searchFrm.vPengBookTotcnt.value =  document.searchGroup.EngbookTotCnt.value;
		searchFrm.vPmusicTotcnt.value =  document.searchGroup.MusicTotCnt.value;
		searchFrm.vPdvdTotcnt.value =  document.searchGroup.DvdTotCnt.value;
		searchFrm.vPgiftTotcnt.value =  document.searchGroup.GiftTotCnt.value; */
	//}
	
	//searchFrm.vPstartno.value =  "0";
	searchFrm.submit();
}

// 보기옵션 변경
function chgViewOption(val)
{
	
	if( val.value == "" )return;
	
	var searchFrm = document.search;
	
	
	
	searchFrm.viewoption.value = val.value;
	
	// 재 검색 방지
	/*
	if (searchFrm.vPreSearch.value == "2")
	{
		searchFrm.vPnoReSearch.value = "1";
	} else {
		searchFrm.vPnoReSearch.value = "3";
	}
	*/

	// 현재 페이지가 국내도서, 외국도서, 음반, DVD, GIFT 일 경우 카테고리별 전체 개수 유지
	//var sCategory = searchFrm.vPstrCategory.value ;
	//if (sCategory == "KOR" || sCategory == "ENG" || sCategory == "MUC" || sCategory == "DVD" || sCategory == "GFT"){
	/*	searchFrm.vPkorBookTotcnt.value =  document.searchGroup.KorbookTotCnt.value;
		searchFrm.vPengBookTotcnt.value =  document.searchGroup.EngbookTotCnt.value;
		searchFrm.vPmusicTotcnt.value =  document.searchGroup.MusicTotCnt.value;
		searchFrm.vPdvdTotcnt.value =  document.searchGroup.DvdTotCnt.value;
		searchFrm.vPgiftTotcnt.value =  document.searchGroup.GiftTotCnt.value; */
	//}
	
	//searchFrm.vPstartno.value =  "0";
	searchFrm.submit();
}


// 팝업 검색
function SearchSlt(coll, ejkgb, text) {

	var frm = document.search;

	//document.getElementById("vPejkGB").value = ejkgb ;
	frm.menu.vPejkGB = ejkgb;
	document.getElementById("search_select").innerHTML = text;

	frm.collection.value = coll;
	frm.SFidx.value = 0;
	frm.pcount.value = 10 ;
		
	frm.sort.value = "";
	frm.order.value = "";
	//frm.submit();
}



//Tran 검색
function TranSearchSlt( menu ,coll, ejkgb, text) {

	var frm = document.search;
	
	frm.menu.value = menu;
	frm.menu.vPejkGB = ejkgb;
	
	document.getElementById("word").innerHTML = text;
	
	PageAction();

	frm.collection.value = coll;
}


//북로그 탭 메뉴 
function BlogTabControl( coll, text ){
	
	var frm = document.search;
	
	document.getElementById("word").innerHTML = text;
	frm.collection.value = coll;
}


// 팝업 
function TP_Popup(url, name, left, top, width, height) 
{ 
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+', scrollbars=yes'); 
} 
/*
 * TP_Popup('/join/join_write.jsp','join','100','100','780','500')
 * */


function GlobalLinkTag( query  ,menu, coll ) {
	
	var frm = document.search;
	
	frm.query.value = query;
	
	if (typeof frm.menu != "undefined") {
		//document.getElementById("menu").value = menu ;
		frm.menu.value = menu ;
	}
	frm.collection.value = coll;
	
	frm.submit();
}


function main_searchCon(){

	 $("#cat_word").hide();
}


function ResultCountColtrol( ActionPage, menu, coll, query ){
	
	var frm = document.search;
	
	if (typeof frm.menu != "undefined") {
		
		frm.menu.value = menu ;
	}
	
	frm.collection.value = coll;
	frm.SFidx.value = 0;
	frm.pcount.value = 3 ;
	frm.sort.value = "";
	
	frm.order.value = "";
	frm.query.value = query;
	
	if( ActionPage == 'teen') { 
		frm.action = '/jsp/teen/search/search_teen.jsp';
	}else if ( ActionPage == 'kids' ) {
		frm.action = '/jsp/kids/search/search_kids.jsp';
	}else if ( ActionPage == 'blog' ) {
		frm.action = '/jsp/blog/search/blog.jsp';
	}
	
	//frm.action = '';
	frm.submit();
	
	
}

function ScrDate(type) { 
	
	var f = document.search;
	
	if( type == 'ALL' ){ 
		f.scrstartdate.value = '';
		f.screnddate.value = '';
		document.getElementById("qscrstartdate").value = '';
		document.getElementById("qscrenddate").value = '';
	}
	if( type == 'WEEK' ) {
		f.scrstartdate.value = f.TempWEEK.value;
		f.screnddate.value = f.TempDATE.value;
		document.getElementById("qscrstartdate").value = f.TempWEEK.value;
		document.getElementById("qscrenddate").value = f.TempDATE.value;
	}
	if( type == 'MONTH' ) {
		f.scrstartdate.value = f.TempMONTH.value;
		f.screnddate.value = f.TempDATE.value;
		document.getElementById("qscrstartdate").value = f.TempMONTH.value;
		document.getElementById("qscrenddate").value = f.TempDATE.value;
	}
}


