function GetObject( id )
{
	return document.getElementById(id);
}

function SetLogin( type )
{
	GetObject('loginType').value=type;
	if(type==1)
	{
	    GetObject('login0').className='';
	    GetObject('login1').className='select';
	    GetObject('loginReg').href='/Company/Company_Login.aspx';
	}
	else
	{
	    GetObject('login0').className='select';
	    GetObject('login1').className='';
	    GetObject('loginReg').href='/Personal/Personal_Login.aspx';
	}
}

function SetLoginType()
{
    for(var i=0; i<2; i++)
    {
	    GetObject('login'+i).className='';
    }
	    GetObject('login'+GetObject('loginType').value).className='select';
}

function ChangNum( obj )
{
	var dateObj=new Date();
	obj.src=obj.src.split('?')[0]+'?num='+dateObj.getSeconds()+dateObj.getMilliseconds();
}

function SetTab ( id1, id2, num, count )
{
	for(var i=0; i<count; i++)
	{
		GetObject(id1+i).className='';
		GetObject(id1+i+id2).style.display='none';
	}
	GetObject(id1+num).className='select';
	GetObject(id1+num+id2).style.display='block';
}

function SetObjAlternatingClassStyle(id, htmlTag, attribute, class1, class2)
{
	var Objs = document.getElementById(id).getElementsByTagName(htmlTag);
	var Tag = true;
	if (Objs != null)
	{
		if (Objs.length != null)
		{
			for(i=0;i<Objs.length;i++)
			{
				if(Objs[i].getAttribute(attribute)!=null){
					if(Tag)
					{
						Objs[i].className=class1;
						Tag = false;
					}
					else
					{
						Objs[i].className=class2;
						Tag = true;
					}
				}
			}
		}
	}
}

//ÏÔÊ¾¹ã¸æ
function ShowAd(type, path, width, height, link, title)
{
    var adHtml='';
    if(type==1)
    {
        adHtml='<img src="'+path+'" alt="'+title+'" width="'+width+'" height="'+height+'" />';
        if(link!='')
        {
            adHtml='<a href="'+link+'" target="_blank">'+adHtml+'</a>';
        }
    }
    else if(type==2)
    {
	    adHtml='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'"><param name="movie" value="'+path+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+path+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object>';
    }
    document.write(adHtml);
}

