var template = new Array();
var cover = new Array();

function setInitTemplate(index, name, filename, title, icon, content, tno, cno){
	template[index] = new Array();
	template[index]['name'] = name;
	template[index]['filename'] = filename;
	template[index]['title'] = title;
	template[index]['icon'] = icon;
	template[index]['content'] = content;
	template[index]['tno'] = tno;
	template[index]['cno'] = cno;
}
function setInitCover(index, vno, title, price, sfilename, name, cno){
	cover[index] = new Array();
	cover[index]['vno'] = vno;
	cover[index]['title'] = title;
	cover[index]['price'] = price;
	cover[index]['sfilename'] = sfilename;
	cover[index]['name'] = name;
	cover[index]['cno'] =cno;
}
// ÅÛÇÃ¸´ ½½¶óÀÌµå
var NOW_PAGE = 0;
var MAX = 4;
var TEM = 3;
function templateNext(way){
	if( way == 'next') {
		NOW_PAGE++;
		if(NOW_PAGE >= MAX) {
			NOW_PAGE = 0;	
		}			
		var start = (NOW_PAGE * TEM);
		for(var i=start;  i< start+TEM ; i++){
			changePpt(i);				
		}
	} else if ( way == 'prev') {
		NOW_PAGE--;
		if(NOW_PAGE < 0) {
			NOW_PAGE = (parseInt(MAX)-1);	
		}
		var start = (NOW_PAGE * TEM);
		for(var i=start;  i<start+TEM; i++){
			changePpt(i);				
		}
	}
}
function changePpt(index){
	if(index > 12) {
		index = index-12; 
	}
	
	var tmp = parseInt(index) % TEM ;
	
	document.getElementById("ppt_filename"+ tmp).src = "/data/img_template_cp_2nd/" + template[index]['filename'];
	document.getElementById("ppt_title"+ tmp).innerHTML = template[index]['title'];
	document.getElementById("ppt_icon"+ tmp).src = "/images/detail/"+ template[index]['icon'];
	document.getElementById("ppt_cont"+ tmp).innerHTML = template[index]['content'];
	document.getElementById("ppt_tno"+ tmp).href = "/template/view.html?tno=" + template[index]['tno'];
	document.getElementById("ppt_cate_link"+ tmp).innerHTML = template[index]['name'];
	document.getElementById("ppt_cate_link"+ tmp).href = "/template/index_down.html?cate=" + template[index]['cno'];
	
	
}
//cover ½½¶óÀÌµå
var NOW_COV = 0;
var CMAX = 3;
var COV = 5;
function coverNext(way){
	if( way == 'next') {
		NOW_COV++;
		if(NOW_COV == CMAX) {
			NOW_COV = 0;	
		}			
		var start = (NOW_COV * COV);
		for(var i=start;  i< start+COV ; i++){
			changeCover(i);				
		}
	} else if ( way == 'prev') {
		if(NOW_COV == 0) {
			NOW_COV = CMAX;	
		}
		NOW_COV--;
		var start = (NOW_COV * COV);
		for(var i=start;  i<start+COV; i++){
			changeCover(i);				
		}
	}
}
function changeCover(index){
	if(index >= COV) {
		var cvr = parseInt(index) % COV ;	
	} else {
		var cvr = parseInt(index); 
	}
	document.getElementById("cover_vno"+ cvr).href = "/cover/view.html?vno="+ cover[index]['vno'];
	document.getElementById("cover_title"+ cvr).innerHTML = cover[index]['title'];
	document.getElementById("cover_price"+ cvr).innerHTML =  cover[index]['price'] + "¿ø";
	
	document.getElementById("cover_sfilename"+ cvr).src = "/data/cover/thumb/middle/" + cover[index]['sfilename'];
	document.getElementById("cover_cate_link"+ cvr).innerHTML = cover[index]['name'];
	document.getElementById("cover_cate_link"+ cvr).href = "/cover/?cCode=" + cover[index]['cno'];
	
}

function changeTabLayer(tabname) {
	var tab_ppt = document.getElementById('ppt_on');
	var tab_cover =  document.getElementById('cover_on');
	var tab_ppt2 = document.getElementById('ppt_on2');
	var tab_cover2 =  document.getElementById('cover_on2');
	
	if(tabname == 'template' && tab_ppt) {
		tab_ppt.style.display = 'block';
		document.getElementById('ppt_btn').style.color = '#000000';
		document.getElementById('ppt_btn').style.fontWeight = 'bold';
		tab_cover.style.display = 'none';
		document.getElementById('cover_btn').style.color = '#666666';
		document.getElementById('cover_btn').style.fontWeight = 'normal';
	} else if (tabname == 'template' && tab_ppt2) {
		tab_ppt2.style.display = 'block';
		document.getElementById('ppt_btn2').style.color = '#000000';
		document.getElementById('ppt_btn2').style.fontWeight = 'bold';
		tab_cover2.style.display = 'none';
		document.getElementById('cover_btn2').style.color = '#666666';
		document.getElementById('cover_btn2').style.fontWeight = 'normal';
	} else if (tabname == 'cover' && tab_cover) {
		tab_ppt.style.display = 'none';
		document.getElementById('ppt_btn').style.color = '#666666';
		document.getElementById('ppt_btn').style.fontWeight = 'normal';
		tab_cover.style.display = 'block';
		document.getElementById('cover_btn').style.color = '#000000';
		document.getElementById('cover_btn').style.fontWeight = 'bold';
	} else if (tabname == 'cover' && tab_cover2) {
		tab_ppt2.style.display = 'none';
		document.getElementById('ppt_btn2').style.color = '#666666';
		document.getElementById('ppt_btn2').style.fontWeight = 'normal';
		tab_cover2.style.display = 'block';
		document.getElementById('cover_btn2').style.color = '#000000';
		document.getElementById('cover_btn2').style.fontWeight = 'bold';
	}
}




function menuMoreView() {
	document.getElementById('head_menu_more').style.display = 'block';
}
function meneMoreNone() {
	document.getElementById('head_menu_more').style.display = 'none';
}


function changeSearchLayer(type){
	if(type =="report"){
		$("#recom_report").css("display", "block");
		$("#recom_paper").css("display", "none");
		
		$("#recom_title_report").css("fontWeight", "bold");
		$("#recom_title_report").css("color", "#181818");
		
		$("#recom_title_paper").css("fontWeight", "normal");
		$("#recom_title_paper").css("color", "#666666");
	}else{
		$("#recom_paper").css("display", "block");
		$("#recom_report").css("display", "none");
		
		$("#recom_title_report").css("fontWeight", "normal");
		$("#recom_title_report").css("color", "#666666");
		
		$("#recom_title_paper").css("fontWeight", "bold");
		$("#recom_title_paper").css("color", "#181818");
	}
	
	
	
}


/*»ó¼¼ÆäÀÌÁö UTIL*/
	var timeTerm=1;
	var widthTerm=20;
	var active =false;
	var screenWidth = 500 ;
	var moveBtn=0;
	var maxPageNum=0;
	
	
	//¼±ÅÃ ÆäÀÌÁö °è»ê
	var movePage=5;
	var totalPage=0;
	var script_msg="";
	
	var ViewLayer="";
	var DocLayer="";
	
	var NowLeft=0;

	//¹Ì¸®º¸±â ¼³Á¤
	var PreviewMax = 3;	

	function NewLeft(){
		var choise_btn = ((moveBtn-1) *movePage)+1;
		
		
		if(moveBtn > 0){
			choiseDoc(choise_btn, script_msg, totalPage);
			if(!active){
				moveBtn--;
				NowLeft=0;
				moveSliding("right");	
			}
			moveBtnStatus();
		}
		
		
		
	}
	function NewRight(){
	
		var choise_btn = ((moveBtn+1) *movePage)+1;
		
		if(moveBtn < maxPageNum){
			choiseDoc(choise_btn, script_msg, totalPage);
			if(!active){
				moveBtn++;
				NowLeft=0;
				moveSliding("left");	
				
			}
			moveBtnStatus();
		}
	}
	
	function moveBtnStatus(){
		//ÀÌÀüº¸±â ¾øÀ½
		if(moveBtn ==0){
			document.getElementById('prev_btn').src="/images/report/view/bt_prev_off.gif";
			if(moveBtn == maxPageNum){
				document.getElementById('next_btn').src="/images/report/view/bt_next_off.gif";
			}else{
				document.getElementById('next_btn').src="/images/report/view/bt_next_on.gif";
			}
		}else{
			document.getElementById('prev_btn').src="/images/report/view/bt_prev_on.gif";
			if(moveBtn == maxPageNum){
				document.getElementById('next_btn').src="/images/report/view/bt_next_off.gif";
			}else{
				document.getElementById('next_btn').src="/images/report/view/bt_next_on.gif";
			}
		}
	}
	
	function moveSliding(option){
		
		//ÀÌµ¿ºÎºÐ
		if(option =="left"){
			DocLayer.style.marginLeft  = (parseInt(DocLayer.style.marginLeft) - widthTerm) + "px";	
		}else{
			DocLayer.style.marginLeft  = (parseInt(DocLayer.style.marginLeft) + widthTerm) + "px";
		}
		
		
		//°è»êºÎºÐ
		NowLeft = NowLeft + widthTerm;
		
		if(NowLeft >= screenWidth){
			active = false;
			clearTimeout(my_timedProcess);
			return;
		}else{
			try{
				active = true;	
				var my_timedProcess = setTimeout("moveSliding('"+option+"')", timeTerm);
				
			}catch(e){
				active = false;
			}
		}
	}
	
	function setFirstPage(type){
		
		if(type == "sero"){
			document.getElementById("detail1").style.background ="url('/images/report/view/bg_doc_on.gif')";
			document.getElementById("chose1").style.background ="url('/images/report/view/bg_choise_on.gif')";
		}else{
			document.getElementById("garo_detail1").style.background ="url('/images/report/view/bg_doc_garo_on.gif')";
			document.getElementById("garo_chose1").style.background ="url('/images/report/view/bg_choise_on.gif')";
		}
		
	}
	
	function openBlog(no){
		window.open("/report/pop_myblog.html?no="+no, "myblog", "scrollbars=no,width=576,height=372");
	}
	
function change_link(form){
	var uid = new Date().getTime();
	if(form.url.selectedIndex !=0){
		window.open(form.url.options[form.url.selectedIndex].value, uid, ""); 
	}
}




//·¹ÀÌ¾î
function showHelpLayer(obj){

	document.getElementById(obj).style.display = "block";
}

function closeHelpLayer(obj){
	document.getElementById(obj).style.display = "none";
}


//¹®¼­ ¼±ÅÃ
function choiseDoc(val, type, max){
	
	if(type =="sero"){
		for(var i=1 ; i<=max ; i++){
			if(i == val){
				document.getElementById("detail"+i).style.background ="url('/images/report/view/bg_doc_on.gif')";
				document.getElementById("chose"+i).style.background ="url('/images/report/view/bg_choise_on.gif')";
			}else{
				document.getElementById("detail"+i).style.background ="url('/images/report/view/bg_doc_off.gif')";
				document.getElementById("chose"+i).style.background ="url('/images/report/view/bg_choise_off.gif')";
			}
		}
		
	}else{
		for(var i=1 ; i<=max ; i++){
			if(i == val){
				document.getElementById("garo_detail"+i).style.background ="url('/images/report/view/bg_doc_garo_on.gif')";
				document.getElementById("garo_chose"+i).style.background ="url('/images/report/view/bg_choise_on.gif')";
			}else{
				document.getElementById("garo_detail"+i).style.background ="url('/images/report/view/bg_doc_garo_off.gif')";
				document.getElementById("garo_chose"+i).style.background ="url('/images/report/view/bg_choise_off.gif')";
			}
		}
	}
}
//¹Ì¸®º¸±â ¿­±â
function openPreview(val, type, max, dno, auth, where){
	
	choiseDoc(val, type, max);
	if(max <= PreviewMax){
		alert('3ÆäÀÌÁö ÀÌÇÏÀÇ \nÀÚ·á´Â ·¹Æ÷Æ® ¹Ì¸®º¸±â¸¦ \nÁ¦°øÇÏÁö ¾Ê½À´Ï´Ù.');
		return;
	}
	if(auth==0 && val >= PreviewMax){
		if(confirm('3 ÆäÀÌÁö ÀÌ»óÀº ·Î±×ÀÎ ¶Ç´Â ¹«·áÈ¸¿ø°¡ÀÔ ÈÄ º¸½Ç ¼ö ÀÖ½À´Ï´Ù.')){
			top.location.href = "/member/index.html?where="+where;	
		}
		return;
	}
	if(max < PreviewMax){
		window.open("/report/data/pop_preview_no.html?dno="+dno+"&file=pageno", "preview", "width=500,height=500,scrollbars=yes");
	}else{
		window.open("/report/data/pop_preview_zoom.html?dno="+dno+"&page="+val, "preview", "width=500,height=500,scrollbars=yes");	
	}
	

}

//¹Ì¸®º¸±â ¿­±â(ISO)
function openPreview_ISO(val, type, max, sno, auth, where){
	
	choiseDoc(val, type, max);
	if(max <= PreviewMax){
		alert('3ÆäÀÌÁö ÀÌÇÏÀÇ \nÀÚ·á´Â ·¹Æ÷Æ® ¹Ì¸®º¸±â¸¦ \nÁ¦°øÇÏÁö ¾Ê½À´Ï´Ù.');
		return;
	}
	if(auth==0 && val >= PreviewMax){
		if(confirm('3 ÆäÀÌÁö ÀÌ»óÀº ·Î±×ÀÎ ¶Ç´Â ¹«·áÈ¸¿ø°¡ÀÔ ÈÄ º¸½Ç ¼ö ÀÖ½À´Ï´Ù.')){
			top.location.href = "/member/index.html?where="+where;	
		}
		return;
	}
	if(max < PreviewMax){
		window.open("/iso/common/inc/pop_preview_no.html?sno="+sno+"&file=pageno", "preview", "width=500,height=500,scrollbars=yes");
	}else{
		window.open("/iso/common/inc/pop_preview_zoom.html?sno="+sno+"&page="+val, "preview", "width=500,height=500,scrollbars=yes");	
	}
	

}

//±¸¸ÅÈÄ±â ÀüÃ¼º¸±â
function showAllBuy(cnt){
	if(cnt <5 ){
		alert('±¸¸ÅÈÄ±â°¡ 5°Ç ¹Ì¸¸ÀÎ ÀÚ·áÀÔ´Ï´Ù.');
		return;
	}else{
		document.getElementById("buy_after_list_area_all").style.display="block";	
		document.getElementById("des_buy_more").style.display="none";	
		document.getElementById("des_buy_more_close").style.display="block";	
		
		
	}
}


//±¸¸ÅÈÄ±â ´Ý±â
function closeAllBuy(cnt){
	if(cnt <5 ){
		alert('±¸¸ÅÈÄ±â°¡ 5°Ç ¹Ì¸¸ÀÎ ÀÚ·áÀÔ´Ï´Ù.');
		return;
	}else{
		document.getElementById("buy_after_list_area_all").style.display="none";
		document.getElementById("des_buy_more_close").style.display="none";	
		document.getElementById("des_buy_more").style.display="block";	
		
	}
}

/*¿À´Ã º» ÀÚ·á*/
var MAX_TODAY_VIEW_NUM=5;

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}



function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}	

togather = function(){
	this.template_img = new Array(15);
	this.template_title = new Array(15);
	this.template_tno = new Array(15);
	this.template_key =1;
	
	togather.prototype.setPptValue = function(img, title, tno, key){
		this.template_img[key] = img;
		this.template_title[key] = title;
		this.template_tno[key] = tno;
	}
	
	togather.prototype.changeTPPage = function(type){
		
		if(type =="prev"){
			if(this.template_key == 1){
				return false;
			}else{
				var key = ((parseInt(this.template_key)-2) *3);
				this.changeAttribute(key);
				this.template_key--;		
			}
		}else{
			if(this.template_key == 5){
				return false;
			}else{
				var key = (parseInt(this.template_key) *3);
				//alert(key);
				this.changeAttribute(key);
				
				this.template_key++;		
			}
		}
		document.getElementById("tp_now_page").innerHTML = this.template_key;
	}
	
	togather.prototype.changeAttribute = function(key){
		
		var tmp=0;
		var tmp2=0;
		for(var i=0 ; i<3 ; i++){
			tmp = parseInt(key)+parseInt(i);
			tmp2 = parseInt(i) + 1;
			document.getElementById("link1_" + tmp2).href = "/template/view.html?tno="+this.template_tno[tmp];
			document.getElementById("link2_" + tmp2).href = "/template/view.html?tno="+this.template_tno[tmp];
			document.getElementById("img_" + tmp2).src = this.template_img[tmp] ;
			document.getElementById("title_" + tmp2).innerHTML=  this.template_title[tmp] ;
		}
	}
	
	
	this.cover_img = new Array(15);
	this.cover_title = new Array(15);
	this.cover_vno = new Array(15);
	this.cover_key =1;
	
	togather.prototype.setCoverValue = function(img, title, tno, key){
		this.cover_img[key] = img;
		this.cover_title[key] = title;
		this.cover_vno[key] = tno;
	}
	
	togather.prototype.changeCoverPage = function(type){
		
		if(type =="prev"){
			if(this.cover_key == 1){
				return false;
			}else{
				var key = ((parseInt(this.cover_key)-2) *5);
				this.changeCoverAttribute(key);
				this.cover_key--;		
			}
		}else{
			if(this.cover_key == 5){
				return false;
			}else{
				var key = (parseInt(this.cover_key) *5);
				//alert(key);
				this.changeCoverAttribute(key);
				
				this.cover_key++;		
			}
		}
		document.getElementById("cv_now_page").innerHTML = this.cover_key;
	}
	
	togather.prototype.changeCoverAttribute = function(key){
		
		var tmp=0;
		var tmp2=0;
		for(var i=0 ; i<5 ; i++){
			tmp = parseInt(key)+parseInt(i);
			tmp2 = parseInt(i) + 1;
			document.getElementById("c_link1_" + tmp2).href = "/cover/view.html?vno="+this.cover_vno[tmp];
			document.getElementById("c_link2_" + tmp2).href = "/cover/view.html?vno="+this.cover_vno[tmp];
			document.getElementById("c_img_" + tmp2).src = this.cover_img[tmp] ;
			document.getElementById("c_title_" + tmp2).innerHTML=  this.cover_title[tmp] ;
		}
	}
}

togather_a = new togather();

function chk_cbqnaFrm(cbfrm) {
	if (!cbfrm.title.value || cbfrm.title.value == "¿äÃ»Á¦¸ñÀ» 50ÀÚ ÀÌ³»·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.") {
		alert("¿äÃ»Á¦¸ñÀ» 50ÀÚ ÀÌ³»·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		cbfrm.title.value="";
		cbfrm.title.focus();
		return false;
	}

	return;
}

function chk_byte(obj,str_max)
{

   var ls_str     = obj.value; // ÀÌº¥Æ®°¡ ÀÏ¾î³­ ÄÁÆ®·ÑÀÇ value °ª
   var li_str_len = ls_str.length;  // ÀüÃ¼±æÀÌ

   // º¯¼öÃÊ±âÈ­
   var li_max      = str_max; // Á¦ÇÑÇÒ ±ÛÀÚ¼ö Å©±â
   var i           = 0;  // for¹®¿¡ »ç¿ë
   var li_byte     = 0;  // ÇÑ±ÛÀÏ°æ¿ì´Â 2 ±×¹Ü¿¡´Â 1À» ´õÇÔ
   var li_len      = 0;  // substringÇÏ±â À§ÇØ¼­ »ç¿ë
   var ls_one_char = ""; // ÇÑ±ÛÀÚ¾¿ °Ë»çÇÑ´Ù
   var ls_str2     = ""; // ±ÛÀÚ¼ö¸¦ ÃÊ°úÇÏ¸é Á¦ÇÑÇÒ¼ö ±ÛÀÚÀü±îÁö¸¸ º¸¿©ÁØ´Ù.

   for(i=0; i< li_str_len; i++)
   {
      // ÇÑ±ÛÀÚÃßÃâ
      ls_one_char = ls_str.charAt(i);

      // ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
      if (escape(ls_one_char).length > 4)
      {
         li_byte = li_byte+2;
      }
      // ±×¿ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
      else
      {
         li_byte++;
      }

      // ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
      if(li_byte <= li_max)
      {
         li_len = i + 1;
      }
   }
   
   // ÀüÃ¼±æÀÌ¸¦ ÃÊ°úÇÏ¸é
   if(li_byte > li_max)
   {
      alert( "¿äÃ»Á¦¸ñÀ» 50ÀÚ ÀÌ³»·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
      ls_str2 = ls_str.substr(0, li_len);
      obj.value = ls_str2;
      
   }
   obj.focus();   
}

/*paper*/
function prevImage(param)
{
    var _src="/images/paper/view";
    
    var prevImg1=document.getElementById("paper_prev_image_1");
    var prevImg2=document.getElementById("paper_prev_image_2");
    var prevBtn1=document.getElementById("paper_prev_btn_1");
    var prevBtn2=document.getElementById("paper_prev_btn_2");
    
    if (param==1) {
        prevImg1.style.display="block";
        prevImg2.style.display="none";
        
        prevBtn1.src=_src+"/paper_view_img1_on.gif";
        prevBtn2.src=_src+"/paper_view_img2_off.gif";
    } else {
        prevImg1.style.display="none";
        prevImg2.style.display="block";
        
        prevBtn1.src=_src+"/paper_view_img1_off.gif";
        prevBtn2.src=_src+"/paper_view_img2_on.gif";
    }
}

// Scroll Move Layer
var moveLayer=function(obj,floatT)
{
    this._obj=document.getElementById(obj);
    this._floatT=floatT;
    this._body=null;
    this._cnt=0;
    
    moveLayer.prototype.getBody=function()
    {
        if (document.documentElement.scrollTop>document.body.scrollTop) {
            return document.documentElement;
        } else {
            return document.body;
        }
    }
    
    moveLayer.prototype.getTop=function()
    {
        if (this._obj.style.top) {
            return parseInt(this._obj.style.top,10);
        } else {
            return this._obj.offsetTop;
        }
    }
    
    moveLayer.prototype.getMove=function()
    {     
        this._body=this.getBody();
        
        var _moveLayer=this;
        var _top=this.getTop();
        var _float=this._body.scrollTop+this._floatT;

//     if (_float<507) {
        if (_float<530) {
            //this._obj.style.top="10px";
            this._obj.style.top="60px";
            window.setTimeout(function() {_moveLayer.getMove();},30);
        } else  if (_float>1107) {
            this._obj.style.top="560px";
            window.setTimeout(function() {_moveLayer.getMove();},30);
        } else {
            var _move=Math.abs(_top-_float+500);
            _move=Math.ceil(_move/10);
            
            if ((_top+500)<_float) {
                this._obj.style.top=(_top+_move)+"px";
            } else {
                this._obj.style.top=(_top-_move)+"px";
            }
            
            window.setTimeout(function() {_moveLayer.getMove();},30);
        }
    }
}

function paperPreview()
{
	document.PAPER_PREVIEW.submit();
}
/*paper end*/


/*resume start*/
//Àå¹Ù±¸´Ï ´ã±â
function Cart_Buy(str){
	var str;
	var ff= document.cart;
	if(str=="ok"){
		ff.DP.value=str;
	}else{
		ff.DP.value="";
	}
	
	if(document.getElementById("code0").checked){
		document.getElementById("no1").value = document.getElementById("code0").value;
	}
	
	if(document.getElementById("code1").checked){
		document.getElementById("no2").value = document.getElementById("code1").value;
	}

	//return false;
	ff.submit();
	//return true;
}
/*resume End*/

/*cbqna*/
function openPreviewCbqna(val, type, max, no, auth){
	
	choiseDoc(val, type, max);
	window.open("/cbqna/common/inc/pop_preview_zoom.html?no="+no+"&page="+val, "preview", "width=500,height=500,scrollbars=yes");	

}
/*cbqna Enc*/


/*Àå¹Ù±¸´Ï ´ã±â ajax*/
function addCart(kind, no){
	$.ajax({
		url: "/detail/add_cart_post.html",
		data:"kind=" + kind + "&no="  + no,
		type:"POST",
		typeType:"xml",
		error: function(){
			alert('Àå¹Ù±¸´Ï ´ã±â ½ÇÆÐ');
		},
		success: function(xml){
			alert($(xml).find("msg").text());
		}
	});
}
