﻿function ViewSchoolVod(v_idx)
{
  var url = '/tss/eduinfo/VodPlayer.aspx?v_idx=' + v_idx;
  document.domain = "studymania.com";
	window.open(url,"SchoolVodView","left=0,top=0,toolbar=0,scrollbars=no,directories=0,status=0,menubar=0,width=682,height=650");
}

function ViewSolveVod(s_idx) {
    var url = '/tss/eduinfo/VodPlayer.aspx?s_idx=' + s_idx;
    document.domain = "studymania.com";
    window.open(url, "SchoolVodView", "left=0,top=0,toolbar=0,scrollbars=no,directories=0,status=0,menubar=0,width=682,height=650");    
}
  
function PopSchool(idx)
{
  document.domain = "studymania.com";
  window.open('/tss/eduinfo/school/hompy.aspx?menu=0&s_idx='+idx +'&openerUrl=' + encodeURI(document.location), 'School_Frame', 'status=no, resizable=no, scrollbars=no,width=930,height=700')
}
  
function PopSchool2(menu,idx)
{	 
  document.domain = "studymania.com";
  window.open('/tss/eduinfo/school/hompy.aspx?menu='+menu+'&s_idx='+idx +'&openerUrl=' + encodeURI(document.location), 'School_Frame', 'status=no, resizable=no, scrollbars=no,width=930,height=700');
}

function PopSchool3(menu,idx,pidx)
{
  document.domain = "studymania.com";
  window.open('/tss/eduinfo/school/hompy.aspx?menu='+menu+'&s_idx='+idx+'&p_idx='+pidx +'&openerUrl=' + encodeURI(document.location), 'School_Frame', 'status=no, resizable=no, scrollbars=no,width=930,height=700')
}

function fn_search()
{
  var s_type = document.getElementById("s_type").value;
  var s_area = document.getElementById("s_area").value;
  var s_key = document.getElementById("s_key").value;
    
  location.href= "schoollist.aspx?stype=" + s_type + "&area=" + s_area + "&keywd=" + s_key;
}
  
function fn_EncodeUrl(str)
{
  var strret = str;    
  strret = escape(strret.replace("외국어고등학교", "외고"));
    
  return strret;
}

function VodGetTagScript(param0){
	var sTag = ''
		+ '<OBJECT classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 '
		+ '			height="100%" id=MediaPlayer style="LEFT: 0px; TOP: 0px" type=application/x-oleobject '
		+ '			width="100%" standby="Loading Microsoft Windows Media Player components...">'
		+ '			<param NAME="Filename" value="' + param0 + '">'
		+ '			<param NAME="transparentAtStart" VALUE="True">'
		+ '            <param NAME="transparentAtStop" VALUE="True">'
		+ '            <param NAME="AnimationAtStart" VALUE="False">'
		+ '            <param NAME="AutoStart" VALUE="True">'
		+ '            <param NAME="AutoRewind" VALUE="True">'
		+ '            <param NAME="SendMouseClickEvents" VALUE="True">'
		+ '            <param NAME="DisplaySize" VALUE="4">'
		+ '            <param NAME="AutoSize" VALUE="0">'
		+ '            <param NAME="AutoResize" VALUE="0">'
		+ '            <param NAME="ShowDisplay" VALUE="False">'
		+ '            <param NAME="ShowStatusBar" VALUE="True">'
		+ '            <param NAME="ShowControls" VALUE="true">'
		+ '            <param NAME="ShowAudioControls" VALUE="1">'
		+ '            <param NAME="ShowTracker" VALUE="True">'
		+ '            <param NAME="ShowPositionControls" VALUE="1">'
		+ '            <param NAME="Enabled" VALUE="1">'
		+ '            <param NAME="EnableContextMenu" VALUE="0">'
		+ '            <param NAME="EnablePositionControls" VALUE="1">'
		+ '            <param NAME="EnableFullScreenControls" VALUE="0">'
		+ '            <param NAME="StartPosition" VALUE="0">'
		+ '            <param NAME="Mute" VALUE="0">'
		+ '            <param NAME="Rate" VALUE="1">'
		+ '            <param NAME="SAMILang" VALUE="">'
		+ '            <param NAME="SAMIStyle" VALUE="Small Print">'
		+ '            <param NAME="SAMIFileName" VALUE="">'
		+ '            <param name="captioningID" VALUE="caption">'
		+ '            <param NAME="ClickToPlay" VALUE="1">'
		+ '            <param NAME="CursorType" value="1">'
		+ '            </OBJECT>'
		+ '';
	document.write (sTag);
}

function allblur() {
 for (i = 0; i < document.links.length; i++)
      document.links[i].onfocus = document.links[i].blur;
}

function displaySize (size) {
    switch (size) {
	case 1:
		parent.resizeTo(381,428);
		break;
	case 3:
		document.getElementById("MediaPlayer").DisplaySize = size;
	case 0:
    	parent.resizeTo(682,650);
    	break;
    case 4:
    	parent.resizeTo(762,550);
    	break;
    case 5:
    	parent.resizeTo(962,700);
    	break;
    }
}

function f_center_win()
{
   var li_a_width  = window.screen.availWidth;   // 윈도우가 이용할수 있는 전체 가로크기
   var li_a_height = window.screen.availHeight;  // 윈도우가 이용할수 있는 전체 세로크기
   var li_width    = window.document.body.clientWidth;  // 현재보고 있는문서 body의 가로크기
   var li_height   = window.document.body.clientHeight; // 현재보고 있는문서 body의 세로크기
   
   // 정가운데로 윈도우를 이동한다.
   window.moveTo((li_a_width - li_width)/2,(li_a_height - li_height)/2)   
}

//롤링
isRoll = true;
OVER = 1;

function fn_TxtRoll(DID, TNAME, HEIGHT, DELAY, SPEED, THEIGHT, CNT, START)
{	  	  
  var div_tag = $get(DID);	  
  var tag;	 
  	  
  if(OVER > 0 && DID == "rolling") THEIGHT++;	  
  	  
  if(CNT > 1) HEIGHT_ = HEIGHT * CNT;
  else HEIGHT_ = HEIGHT;	  	  
  
  if(THEIGHT < HEIGHT_) 
  {
	  if(START != 1) 
	  {
		  div_tag.style.top = -THEIGHT;
		  setTimeout("fn_TxtRoll('" + DID + "', '" + TNAME + "', " + HEIGHT + ", " + DELAY + ", " + SPEED + ", " + THEIGHT + ", " + CNT + ", 0);", SPEED);
	  }
	  else
	  {
		  setTimeout("fn_TxtRoll('" + DID + "', '" + TNAME + "', " + HEIGHT + ", " + DELAY + ", " + SPEED + ", " + THEIGHT + ", " + CNT + ", 0);", DELAY);
	  }
  }
  else
  {
	  tag = div_tag.getElementsByTagName(TNAME);
	  if(tag.length > 0)	for(i=0;i<CNT;i++) div_tag.appendChild(tag[0]);
	  div_tag.style.top = 0;
	  setTimeout("fn_TxtRoll('" + DID + "', '" + TNAME + "', " + HEIGHT + ", " + DELAY + ", " + SPEED + ", 0, " + CNT + ", 0);", DELAY);
  }
  return true;
}

// 마우스 오버 레이어
var cursor = {x:0, y:0};
  
function fn_SetXY()
{
  e = window.event;
  
  if (e.pageX || e.pageY) {
      cursor.x = e.pageX;
      cursor.y = e.pageY;
  } 
  else {
      var de = document.documentElement;
      var b = document.body;
      cursor.x = e.clientX + 
          (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
      cursor.y = e.clientY + 
          (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
  }
}

// 특정 레이어를 프린트
var initBody 
var pArea
  
function beforePrint()
{ 
  initBody = document.body.innerHTML; 
  document.body.innerHTML = pArea.innerHTML;    
} 
  
function afterPrint()
{ 
  document.body.innerHTML = initBody; 
}

function fn_print(id)
{ 
  pArea = document.getElementById(id);    
  window.print();
}

// 지도 레이어 닫기
function fn_CloseMap()
{
  document.getElementById("div_map").style.display = "none";
}

// 지도에서 지역클릭
function fn_Search(area)
{
  location.href = "/tss/eduinfo/schoollist.aspx?area=" + area;
}

// 플래쉬 뿌리기
function viewFlash(flashname, width, height)
{
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>");
	document.write("<param name='movie' value='"+flashname+"'>");
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='wmode' value='transparent'>");
	document.write("<param name='bgcolor' value='#ffffff'>");
	document.write("<param name='SCALE' value='#noborder'>");
	document.write("<embed src='"+flashname+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed></object>");
}

// 브라우져
function isMSIE()
{
  return navigator.appName == "Microsoft Internet Explorer" ? true : false;
}