/*===============================================*/
/*  */
/*===============================================*/

//
var LayFlag = "";
var vNum = getBrowserVersion();
var bName = navigator.appName.charAt(0);

// init
function doLayer(flag){
	initM();
	if(flag == 1){
		LayFlag = 1;
	}
}

function getBrowserVersion(){
	str = navigator.appName.toUpperCase();
	version = 0;
	appVer  = navigator.appVersion;
	if (str.indexOf("NETSCAPE") >= 0){
		s = appVer.indexOf(" ",0);
		version = eval(appVer.substring(0,s));
		if (version >= 5) version++;
	}
	if (str.indexOf("MICROSOFT") >= 0){
		appVer  = navigator.userAgent;
		s = appVer.indexOf("MSIE ",0) + 5;
		e = appVer.indexOf(";",s);
		version = eval(appVer.substring(s,e));
	}
	return version;
}

function HideNavi(l) {
	if(LayFlag == 1){
		if( bName == "M"){
			document.all[l].style.visibility = "hidden";
		}else{
			if( vNum < 5 ){
				document.layers[l].visibility = "hide";
			}else if( vNum >= 5 ){
				document.getElementById(l).style.visibility = "hidden";
			}
		}
	}
}

function ShowNavi(l){
	if(LayFlag == 1){
		if( bName == "M"){
			document.all[l].style.visibility = "visible";
		}else{
			if( vNum < 5 ){
				document.layers[l].visibility = "show";
			}else if( vNum >= 5 ){
				document.getElementById(l).style.visibility = "visible";
			}
		}
	}
}

function imgC(obj)
{
	var fpath = obj.src;
	if( fpath.match(/_on/) ){
		obj.src = fpath.replace(/_on/,'');
	}else{
		if( fpath.match(/png/) ){
			obj.src = fpath.replace(/.png/,'_on.png');
		}
		if( fpath.match(/jpg/) ){
			obj.src = fpath.replace(/.jpg/,'_on.jpg');
		}
		if( fpath.match(/gif/) ){
			obj.src = fpath.replace(/.gif/,'_on.gif');
		}
	}
}

function imgCM( obj )
{
	if( key != obj.name )
	{
		imgC(obj);
	}
}
function imgCS( obj )
{
	if( keys != obj.name )
	{
		imgC(obj);
	}
}

function imgCN(imgPath,key){
	obj = document.images[key];
	on_image = new Image();
	on_image.src = imgPath;
	obj.src = on_image.src;
}

//
function initM()
{
	obj = document.images[key];
	if( obj )
	{
		imgC(obj);
	}

}



function tPagePrint(){
	if((navigator.platform == "Mac68k" || navigator.platform == "MacPPC") && navigator.appName == "Microsoft Internet Explorer"){
	}
	else{
		print();
	}
}
function BindYear()
{
   var iYear = new Date().getFullYear();
   for(var i=iYear;i>1899;i--)
   {
      document.getElementById("birthYear").options.add(new Option(i, i));
    }
}
function append(o,v){   
      var option=document.createElement("option");   
      option.value=v;   
      option.innerText=v;   
      o.appendChild(option);   
} 

function CheckYear(obj)
{
      var iYear = new Date().getFullYear();
      var iMonth = new Date().getMonth();
      var objMonth = document.getElementById("birthMonth");
      var objDay = document.getElementById("birthDay");
      var option_M = objMonth.options[0];
      objMonth.options.length=0;
      objMonth.options.add(option_M); 
            
      var option_D = objDay.options[0];
      objDay.options.length=0;
      objDay.options.add(option_D);
      if(obj!=-1)
      {
         if(obj!=iYear)
         {
            for(var i=1;i<=12;i++)
            {
                if(i<10)
                {
                    i="0"+i;
                 }
                 document.getElementById("birthMonth").options.add(new Option(i, i));
                }
             }
             else
             {
                 for(var i=1;i<=iMonth;i++)
                 {
                     if(i<10)
                     {
                         i="0"+i;
                      }
                     document.getElementById("birthMonth").options.add(new Option(i, i));
                  }
               }
           }
}
function CheckMonth(obj)
        {
            var iYear = document.getElementById("birthYear").value;
            var iMonth = document.getElementById("birthMonth").value;
            var objDay= document.getElementById("birthDay");
            var option_f = objDay.options[0];
            objDay.options.length=0;
            objDay.options.add(option_f); 
            
            if(iMonth==1||iMonth==3||iMonth==5||iMonth==7||iMonth==8||iMonth==10||iMonth==12)
            {
                for(var j=1;j<=31;j++){
                      if(j<10)
                      {
                          j="0"+j;
                      }
                            append(objDay,j);   
                    } 
            }
            if(iMonth==4||iMonth==6||iMonth==9||iMonth==11)
            {
                for(var j=1;j<=30;j++){
                	if(j<10)
                    {
                        j="0"+j;
                    }  
                            append(objDay,j);   
                    } 
            }
            if(iMonth==2)
            {
                if (iYear % 4 == 0 && (iYear % 100 != 0 || iYear % 400 == 0))
                {
                    for(var j=1;j<=29;j++)
                    {
                    	if(j<10)
                        {
                            j="0"+j;
                        }
                        append(objDay,j);   
                    }
                }
                else
                {
                    for(var j=1;j<=28;j++)
                    {
                    	if(j<10)
                        {
                            j="0"+j;
                        }
                        append(objDay,j);   
                    }
                }
            }
}
        function CheckDay(obj)
        {
        }
