document.domain='teen.yahoo.com';

var _isIE=(navigator.userAgent.match(/Gecko/))?false:true; 
var _isIE7=(navigator.userAgent.match(/MSIE\s+7/i))?true:false; 
var _isXp=(navigator.userAgent.indexOf('Windows NT 5.1') > 0)?true:false; 

function win_resize() 
{ 
    var bw  = document.body.clientWidth; 
    var bh  = document.body.clientHeight; 

    if (!_isIE)
    {
        window.resizeTo(bw+10, bh+49);
    } 
    else if (_isIE7)
    {
        window.resizeTo(bw+10, bh+80);
    } 
    else if (_isXp && !_isIE7)
    {
        window.resizeTo(bw+10, bh+60);
    } 
    else
    {
        window.resizeTo(bw+10, bh+29);
    } 
} 

function goLogin()
{
    document.location.replace("https://login.yahoo.com/config/login?.intl=kr&.src=yahooligans&.done="+document.URL);
}

function goLogout()
{
    document.location.replace("http://login.yahoo.com/config/login?logout=l&.intl=kr&.src=yahooligans&.direct=1&.direct=1&.done="+document.URL);
}

function move_login()
{
	alert('로그인을 해주세요');
}

function move_sugarcast(user)
{
    if(user != '')
    {
        try
        {
            window.sugar_win.focus();
        }
        catch(error)
        {
            var width = 800;
            var height = 620;
                                
            var top  = (screen.height - height) / 2; 
            var left = (screen.width - width) / 2; 
         
            sugar_win = window.open('/sugarcast3.html', 'SUGARCAST_SCHOOL', 'width='+width+', height='+height+', top='+top+', left='+left+', menubar=0, toolbar=0, directories=0, status=0, location=0, resizable=0, scrollbars=0');
        }
    }
    else
    {
        alert('로그인을 해주세요');
    }
}

function old_sugarcast2(user)
{
    if(user != '')
    {
            var width = 800;
            var height = 620;
                                
            var top  = (screen.height - height) / 2; 
            var left = (screen.width - width) / 2; 
         
            sugar_win = window.open('http://kr.sugar2.teen.yahoo.com/sugarcast.html', 'OLDGAME_WIN', 'width='+width+', height='+height+', top='+top+', left='+left+', menubar=0, toolbar=0, directories=0, status=0, location=0, resizable=0, scrollbars=0');
    }
    else
    {
        alert('로그인을 해주세요');
    }
}

function mini_game(user)
{
    if(user != '')
    {
            var width = 800;
            var height = 600;
                                
            var top  = (screen.height - height) / 2; 
            var left = (screen.width - width) / 2; 
         
            sugar_win = window.open('http://kr.sugar2.teen.yahoo.com/sugarcast.html','MINIGAME_WIN', 'width='+width+', height='+height+', top='+top+', left='+left+', menubar=0, toolbar=0, directories=0, status=0, location=0, resizable=0, scrollbars=0');
    }
    else
    {
        alert('로그인을 해주세요');
    }
}



function move_hompy()  
{
    var width = 990;
    var height = 675;
    
    var top  = (screen.height - height) / 2; 
    var left = (screen.width - width) / 2;     

    window.open('http://kr.blog.yahoo.com/sugarchange', 'HOMPY_WIN', 'width='+width+', height='+height+', top='+top+', left='+left+', menubar=0, toolbar=0, directories=0, status=0, location=0, resizable=1, scrollbars=1');    
}




function SwfEmbeded(get_swf, get_width, get_height, get_id)
{
    if(navigator.appVersion.indexOf("MSIE") != -1) 
    {
        var object_str = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.0.32.18' width='"+get_width+"' height='"+get_height+"' id='"+get_id+"' name='"+get_id+"'><param name='allowScriptAccess' value='never' /><param name='movie' value='"+get_swf+"'><param name='quality' value='high'></object>";
    }
    else
    {
        var object_str = "<embed id='"+get_id+"' name='"+get_id+"' src='"+get_swf+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer'type='application/x-shockwave-flash' width='"+get_width+"' height='"+get_height+"' allowScriptAccess='never'></embed>";
    }

    document.write(object_str);
}

function SwfEmbeded_wmode(get_swf, get_width, get_height, get_id)
{
    if(navigator.appVersion.indexOf("MSIE") != -1) 
    {
        var object_str = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.0.32.18' width='"+get_width+"' height='"+get_height+"' id='"+get_id+"' name='"+get_id+"'><param name='allowScriptAccess' value='never' /><param name='movie' value='"+get_swf+"'><param name='wmode' value='transparent'><param name='quality' value='high'></object>";
    }
    else
    {
        var object_str = "<embed id='"+get_id+"' name='"+get_id+"' src='"+get_swf+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer'type='application/x-shockwave-flash' width='"+get_width+"' height='"+get_height+"' allowScriptAccess='never' wmode='transparent'></embed>";
    }

    document.write(object_str);
}

function SwfEmbeded_wmode2(get_swf, get_width, get_height, get_id)
{
    if(navigator.appVersion.indexOf("MSIE") != -1) 
    {
        var object_str = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.0.32.18' width='"+get_width+"' height='"+get_height+"' id='"+get_id+"' name='"+get_id+"'><param name='allowScriptAccess' value='never' /><param name='movie' value='"+get_swf+"'><param name='wmode' value='transparent'><param name='quality' value='high'></object>";
    }
    else
    {
        var object_str = "<embed id='"+get_id+"' name='"+get_id+"' src='"+get_swf+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer'type='application/x-shockwave-flash' width='"+get_width+"' height='"+get_height+"' allowScriptAccess='never' wmode='transparent'></embed>";
    }

    window.open(get_swf,get_id,'menubar=no,status=no,location=no,directories=no');
}
