﻿/////////////////// SSL 보안사이트 적용  ///////////////////////////////
mylocation = location.href;
mypath = location.pathname;
pagename = mypath.split("/");
ssl_url= "https://www.stx.co.kr";
web_url= "http://www.stx.co.kr";
var fullpath;
if (((pagename[1]=="Front")&&(pagename[3]=="CS_00100_01.aspx"))    
	||((pagename[1]=="Front")&&(pagename[3]=="Group_00507.aspx"))	) // -->https(SSL SITE)로 접속해야 하는 페이지
{
	webgubun = /http:/;
	if (location.protocol=="http:"){ //http로 접속시 https로 강제 이동시킴
		fullpath= mylocation.split(web_url);
		location.href=ssl_url + fullpath[1];
	}else{//https로 접속시 
	}
	
}else{ // -->http(보통웹)로 접속해야 하는 페이지
	webgubun = /https:/;
	if (location.protocol=="https:"){ //https로 접속시 http로 강제 이동시킴
		fullpath= mylocation.split(ssl_url);
		location.href=web_url + fullpath[1];
	}else{//http로 접속시 
	}
}
/////////////////// SSL 보안사이트 적용  ///////////////////////////////






var targets = new Array( 'div','td','tr','li','ul','h1','h2','h3','h4','h5','h6','span', 'input','p');
var sizes = new Array( '10pt','12pt','14pt', '16pt');
var lineHeights = new Array( '18px','20px','22px', '24px');
var startSize = 0;

function ts( target, inc ) {
 if (!document.getElementById) return
 
 var d = document, cEl = null, size = startSize, i, j, cTags;

 size += inc;
 if ( size < 0 ){ //폰트 크기를 0 이하로 내릴 수 없게 설정
  size = 0;
 }
 if ( size > 3 ){ //폰트 크기를 5 이상(20pt)으로 올릴 수 없게 설정
  size = 3;
 }

 startSize = size; 

 if ( !( cEl = d.getElementById( target ) ) )
 {
  cEl = d.getElementsByTagName( target )[ 0 ];
 }

 cEl.style.fontSize = sizes[ size ];

 for ( i = 0 ; i < targets.length ; i++ ) 
 {
  cTags = cEl.getElementsByTagName( targets[ i ] ); //getElementsByTagName을 사용하면 배열로 받아짐
  for ( j = 0 ; j < cTags.length ; j++ )
  {   
   cTags[ j ].style.fontSize = sizes[ size ];   
   cTags[ j ].style.lineHeight = lineHeights[size];
  }//for  
 }//for
 
}


// Trim
var TRIM_PATTERN = /(^\s*)|(\s*$)/g; // 내용의 값을 빈공백을 trim하기 위한것(앞/뒤)
String.prototype.trim = function() 
{
    return this.replace(TRIM_PATTERN, "");
}

var sw = screen.availWidth;
var sh = screen.availHeight;


function CopyRSS(arg)
{
    var RssURL = arg;
    window.clipboardData.setData('Text', RssURL);
    alert('RSS주소가 복사되었습니다.');
}



// 윈도우 오픈
function openWindowCenter(url,name,width,height,scrollbars) {
	var posLt = (screen.availWidth-width)/2;
	var posTp = (screen.availHeight-height)/2;
	var pop = window.open(url,name,"top="+posTp+",left="+posLt+",width="+width+",height="+height+",scrollbars="+scrollbars);
	if(pop) {pop.focus();}
}

function popupFlash(url,name) {
	openWindowCenter(url,name,480,550,'no');
}

function popupChallenge() {
	openWindowCenter('/Front/Challenge/challenge.aspx','Challenge',1000,700,'no');
}

function linkLeftFlash() {
	var _type = arguments[0];
	var url = '';
	if( _type == 0 )	url = "/Front/Group/Group_00401.aspx";
	else				url = "/Front/Story/Story_00100.aspx";
	
	location.href = url;
}

