function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MoveClub() {    
    var ClubName = document.all.myClub.options[document.all.myClub.selectedIndex].value;    
    if( ClubName == '' ) return false;
    var url = "http://club.schoolmusic.co.kr/" + ClubName;    
    window.open(url,'_top','menubar=yes,location=yes,status=yes,toolbar=yes,resizable=yes,scrollbars=yes;');
     return true;
}
	
function Message_Win(ref) {
        var window_left = (screen.width-640)/2;
        var window_top = (screen.height-480)/2;
        window.open(ref,"MessageWin",'width=550,height=400,status=no,scrollbars=yes,top=' + window_top + ',left=' + window_left + ''
);
}

function Postal_Window2(ref) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(ref,"checkIDWin",'width=550,height=400,status=no,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}
function Postal_Window(ref) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(ref,"checkIDWin",'width=550,height=400,status=no,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}
function fork() {
        var alert_msg="¿ä·É\n\n1. Ç×¸ñ Áß ÇÏ³ª¸¦ Ã¼Å©ÇÕ´Ï´Ù.\n2. ´Ù½Ã ÅõÇ¥ÇÏ±â¸¦ ´©¸¥´Ù.";
        var checkedButton = "";
        var i;
        for (i = 0; i < document.Pollcheck.checknum.length ; i++)
        {
                if (document.Pollcheck.checknum[i].checked)
                {
                        checkedButton = i+1;
                        checkedButton=document.Pollcheck.checknum[i].value;
                }
        }
        if(checkedButton=="")
        {
                alert(alert_msg);
                return;
        }
		if(checkedButton=="other")
		{
			if(document.Pollcheck.other_text.value=="")
			{
				alert("±âÅ¸ ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä!");
				document.Pollcheck.other_text.focus();
				return;
			}
		}
        document.Pollcheck.submit();
}

var text = "www.schoolmusic.co.kr" // ÁÖ¼Ò ¹Ù²Ù½Ã°í
var speed = 200 // ¼Óµµ ¹Ù²Ù½Ã°í, ¼ýÀÚ°¡ Å¬¼ö·Ï ´À·ÁÁý´Ï´Ù.
var x = 0
function bb() {
var a = text.substring(0,x)
var b = text.substring(x,x+1).toUpperCase()
var c = text.substring(x+1,text.length)
window.status = a + b + c
if (x == text.length) {
x = 0
}
else {
x++
}
setTimeout("bb()",speed)
}
bb();

function show_hidden_div(div_no,on_off)
{
	if(on_off=='on')
		eval("document.all.m_img_"+div_no+".style.display='block';");
	else
		eval("document.all.m_img_"+div_no+".style.display='none';");

}
	  function  trim(str)
{
    for(var  i  =  0  ;  i<str.length  &&  str.charAt(i)==" "  ;  i++  )  ;
    for(var  j  =str.length;  j>0  &&  str.charAt(j-1)==" "  ;  j--)  ;
    if(i>j)  return  "";  
    return  str.substring(i,j);  
}

function search_g(total_goods,state)
{

	keyword=trim(Form.keyword.value);
	value_str="ÀüÃ¼ "+total_goods+"°³ »óÇ°";
	if(state=="onblur")
	{
		if(keyword=="")
		{
			Form.keyword.style.color="#cccccc";
			Form.keyword.value=value_str;
		}
		else
			Form.keyword.style.color="";
	}
	else if(state=="onfocus")
	{
		if(keyword==value_str && Form.keyword.style.color=="#cccccc")
		{
			Form.keyword.value="";
			Form.keyword.style.color="";
		}
	}
}


function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
   if(image.width>600){
    ImgD.width=600;
   }
}
}


// ¹è³Ê ½ºÅ©¸³Æ®
if(document.all) var app="win"; else var app="other";

function slide(start_wd,position,op_name,max)
{
	this.s_d=start_wd;
	this.prv_banner;
	this.current_banner=this.s_d+"1";
	this.next_banner;
	this.prv_op=100;
	this.cur_op=0;
	this.m_process;
	this.auto_i=2;
	this.pos=position;
	this.op_name=op_name;
	this.max=max;
	this.icon_path="http://www.schoolmusic.co.kr/banner/icon/";
	if(document.all) this.app="win"; else this.app="other";

this.slide_show=function ()
{


	if(this.prv_op>0){
		this.prv_op=this.prv_op-10;
		this.cur_op=this.cur_op+10;
		if(app=="win")
		{
			document.getElementById(this.prv_banner).style.filter="alpha(opacity="+this.prv_op+")";
			document.getElementById(this.current_banner).style.filter="alpha(opacity="+this.cur_op+")";
			//document.getElementById("text").innerHTML="sss"+this.prv_op;
		}
		else
		{
			document.getElementById(this.prv_banner).style.opacity=this.prv_op*0.01;
			document.getElementById(this.current_banner).style.opacity=this.cur_op*0.01;
			//document.getElementById("text").innerHTML="sss"+this.prv_op;			
		}
	}
	else{
		document.getElementById(this.prv_banner).style.display="none";
		this.prv_banner=this.current_banner;

		clearInterval(this.m_process);
		this.m_process=0;

	}

}

this.change_banner=function (next_banner)
{


	this.next_banner=next_banner;

	if(this.m_process>0){
	clearInterval(this.m_process);
	
	document.getElementById(this.prv_banner).style.display="none";
	}
	
	
	if(this.next_banner!=this.current_banner){

	this.prv_banner=this.current_banner;
	this.current_banner=this.next_banner;

	this.prv_op=100;
	this.cur_op=0;
	document.getElementById(this.current_banner).style.display="block";

	if(this.pos=="main"){
		document.getElementById("s_"+this.current_banner).style.filter="";
		document.getElementById("s_"+this.prv_banner).style.filter="progid:DXImageTransform.Microsoft.BasicImage(grayScale=1)";
	}
	else if(this.pos=="right"){
		document.getElementById("s_"+this.current_banner).src=this.icon_path+this.current_banner+"_on.jpg";
		document.getElementById("s_"+this.prv_banner).src=this.icon_path+this.prv_banner+".jpg";
	}
	//this.slide_show();
	this.m_process = setInterval(this.op_name+".slide_show()", 20);


	 }
	 
}

this.auto_show=function ()
{
	
	if(this.auto_i>this.max) this.auto_i=1;
	this.change_banner(this.s_d+this.auto_i);
	
   // document.getElementById("text").innerHTML=auto_i;
	this.auto_i++; 
}

}