/*
	È«±â¹ü [ bluesky@anyculture.com ]
*/
function Tcheck(target, cmt, astr, lmin, lmax) {
        var i
        var t = target.value
        if (t.length < lmin || t.length > lmax) {
                if (lmin == lmax) alert(cmt + '´Â ' + lmin + 'ÀÚ ÀÌ¾î¾ß ÇÕ´Ï´Ù');
                else alert(cmt + '´Â ' + lmin + ' ~ ' + lmax + 'ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
                target.focus()
                return true
        }

        if (astr.length > 1) {
                for (i=0; i<t.length; i++)
                        if(astr.indexOf(t.substring(i,i+1))<0) {
				alert(cmt + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù');
                                target.focus()
                                return true
                        }
        }
        return false

}                      

function Tvalue(obj,len,msg) {
   if ( obj.value.length >= len ) return false
   if ( obj.name == "file" || obj.name == "filename"){
	alert ('ÆÄÀÏÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À.');
   } else if ( obj.name == "cate_s" || obj.name == "cate_m"){
	alert ('Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À.');
   } else{	
	alert (msg + ' ' + len + '±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À.' );
   }
   obj.focus()
   return true 

}

// À©µµ¿ì OPEN Script
function pop(pPage,name,Opt) {
	var popUpWin;

	popUpWin = window.open(pPage,name,Opt);
	popUpWin.focus();
}

// Scrolling
	var scrollerheight=170;                // ½ºÅ©·Ñ·¯ÀÇ ¼¼·Î 
	var html,total_area=0,wait_flag=true;
        
	var bMouseOver = 1;
	var scrollspeed = 1;                // Scrolling ¼Óµµ         
	var waitingtime = 3000;                // ¸ØÃß´Â ½Ã°£
	var s_tmp = 0, s_amount = 170;
	var startPanel=0, n_panel=0, i=0;
	var scroll_content=new Array();
	
function startscroll() { // ½ºÅ©·Ñ ½ÃÀÛ
	i=0;
	for (i in scroll_content)
		n_panel++;
                        
	n_panel = n_panel -1 ;
	startPanel = Math.round(Math.random()*n_panel);
	if(startPanel == 0) {
		i=0;
		for (i in scroll_content) 
			insert_area(total_area, total_area++);
	} else if(startPanel == n_panel) {
		insert_area(startPanel, total_area);
		total_area++;
		for (i=0; i<startPanel; i++) {
			insert_area(i, total_area);
			total_area++;
		}
	} else if((startPanel > 0) || (startPanel < n_panel)) {
		insert_area(startPanel, total_area);
		total_area++;
		for (i=startPanel+1; i<=n_panel; i++) {
			insert_area(i, total_area);
			total_area++;
		}
		for (i=0; i<startPanel; i++) {
			insert_area(i, total_area);
			total_area++;
		}
	}
	window.setTimeout("scrolling()",waitingtime);
}

function scrolling() { // ½ÇÁ¦·Î ½ºÅ©·Ñ ÇÏ´Â ºÎºÐ
	if (bMouseOver && wait_flag) {
		for (i=0;i<total_area;i++) {
			tmp = document.getElementById('scroll_area'+i).style;
			tmp.top = parseInt(tmp.top)-scrollspeed;
			if (parseInt(tmp.top) <= -scrollerheight) {
				tmp.top = scrollerheight*(total_area-1);
			}
			if (s_tmp++ > (s_amount-1)*scroll_content.length) {
				wait_flag=false;
				window.setTimeout("wait_flag=true;s_tmp=0;",waitingtime);
			}
		}
	}
	window.setTimeout("scrolling()",1);
}

function insert_area(idx, n) {
	html='<div style="left: 0px; width: 100%; position: absolute; top: '+(scrollerheight*n)+'px" id="scroll_area'+n+'">\n';
	html+=scroll_content[idx]+'\n';
	html+='</div>\n';
	document.write(html);
}

function setShotPosition( DIV_id, e ) {
    if (document.all) {
        DIV = eval ( "document.all." + DIV_id );
        DIV.style.left = -55;
        //DIV.style.left = e.offsetX + 40;
    } else if (document.getElementById) {
        DIV = eval ( "document.getElementById('" + DIV_id + "')");
        DIV.style.top  = e.pageY;
        DIV.style.left = e.pagex;
    }
    //DIV.style.zIndex = ++document.formPdsList.zIndex.value ;
}

function ShowShot( DIV_id ) {
    var ie = ( document.all     ) ? 1 : 0;
    var ns6 = document.getElementById && !document.all ? 1 : 0;
    var DIV = null;
    if ( ie  ) {
         eval(DIV_id + ".filters.RevealTrans.apply()");
         document.all[DIV_id].style.visibility = "visible";
         eval(DIV_id+ ".filters.RevealTrans.play()");
        //DIV = eval ( "document.all." + DIV_id );
        //DIV.style.visibility="visible";
         BtnShot = eval( "document.all." + "BtnShot" + DIV_id.substr(DIV_id.indexOf("_")) );
         BtnShot.href = "javascript:HideShot('" + DIV_id + "')";
    }
    if ( ns6 ) {
        DIV = eval ( "document.getElementById('" + DIV_id + "')");
        DIV.style.visibility="visible";
        BtnShot = eval( "document.getElementById('" + "BtnShot" + DIV_id.substr(DIV_id.indexOf("_")) + "')");
        BtnShot.href = "javascript:HideShot('" + DIV_id + "')";
    }
}

function HideShot( DIV_id ) {
    var ie = ( document.all     ) ? 1 : 0;
    var ns6 = document.getElementById && !document.all ? 1 : 0;
    var DIV = null;
    if ( ie  ) {
         eval(DIV_id + ".filters.RevealTrans.apply()");
         document.all[DIV_id].style.visibility = "hidden";
         eval(DIV_id+ ".filters.RevealTrans.play()");
        //DIV = eval ( "document.all." + DIV_id );
        //DIV.style.visibility="hidden";
         BtnShot = eval( "document.all." + "BtnShot" + DIV_id.substr(DIV_id.indexOf("_")) );
         BtnShot.href = "javascript:ShowShot('" + DIV_id + "')";
    }
    if ( ns6 ) {
        DIV = eval ( "document.getElementById('" + DIV_id + "')");
        DIV.style.visibility="hidden";
        BtnShot = eval( "document.getElementById('" + "BtnShot" + DIV_id.substr(DIV_id.indexOf("_")) + "')");
        BtnShot.href = "javascript:ShowShot('" + DIV_id + "')";
    }
}

var globopObject;
var opIndex=0;
var cleared=true;
var direction=10;

function dynOpacity(opObject,stop)
{
if (stop) 
{
clearInterval(window.tm);
cleared=true;
opIndex=10;
return;
}
globopObject=opObject;
if (opIndex>110) direction=-4;
if (opIndex<0) direction=4;
opIndex+=direction;
globopObject.style.filter='alpha(opacity:' + opIndex + ')';
if (cleared)
{
window.tm=setInterval("dynOpacity(globopObject,false);",1);
cleared=false;
}
}

function handleevent()
{

if (event.type=="mouseover")
   if(event.srcElement.tagName=="IMG") 
   	   if (event.srcElement.parentElement.tagName=="A" && event.srcElement.className == "photo")	
   		{
		dynOpacity(event.srcElement,false);
		}
if (event.type=="mouseout")
   if(event.srcElement.tagName=="IMG") 
   		{
		event.srcElement.style.filter="";
		dynOpacity(event.srcElement,true);	
		}
}
document.onmouseover=handleevent;
document.onmouseout=handleevent;

