if( !CheckBrowser() )
{
	alert("AB-ROAD는 FireFox 및 Internet Explore 6.0 이상에 최적화 되어 있습니다." );
	window.location="http://www.abroad.co.kr";
}

function CheckBrowser()
{
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) || (agt.indexOf("mozilla") != -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_firefox= (is_ie && (is_major == 5) && (agt.indexOf("mozilla") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =((is_ie && !is_ie3 && !is_ie4 && !is_ie5) || (!is_ie && is_firefox));
    return is_ie5_5up;
}

function hp_dn(a)
{
	return false;
}

function hp_cm()
{
	//alert("Copyright ⓒ AB-ROAD\n본 콘텐츠는 저작권법에 보호되어 있어\n마우스 오른쪽 버튼을 사용할 수 없습니다.\n\n콘텐츠 문의 : \park@abroad.co.kr" );
	return false
}

function hp_de(e)
{
	return(e.target.tagName!=null&&e.target.tagName.search('^(INPUT|TEXTAREA|BUTTON|SELECT)$')!=-1)
}

function hp_md(e)
{
	mac = navigator.userAgent.indexOf('Mac') != -1;
	if( document.all )
	{
		if( event.button==2||(mac&&(event.ctrlKey||event.keyCode==91)) )
		{
			//alert("Copyright ⓒ AB-ROAD\n본 콘텐츠는 저작권법에 보호되어 있어\n마우스 오른쪽 버튼을 사용할 수 없습니다.\n\n콘텐츠 문의 : \park@abroad.co.kr" );
			return(false);
		}
	}
	else
	{
		if(e.which==3||(mac&&(e.modifiers==2||e.ctrlKey)))
		{
			//alert("Copyright ⓒ AB-ROAD\n본 콘텐츠는 저작권법에 보호되어 있어\n마우스 오른쪽 버튼을 사용할 수 없습니다.\n\n콘텐츠 문의 : \park@abroad.co.kr" );
			return false;
		}
		else if(e.which==1)
		{
			window.captureEvents(Event.MOUSEMOVE);
			window.onmousemove=hp_dn
		}
	}
}

function hp_mu(e)
{
	if(e.which==1)
	{
		window.releaseEvents(Event.MOUSEMOVE);
		window.onmousemove=null
	}
}

if( navigator.appName.indexOf('Internet Explorer') == -1|| (navigator.userAgent.indexOf('MSIE') != -1 &&document.all.length != 0))
{
	if(document.all)
	{
		mac = navigator.userAgent.indexOf('Mac') != -1;
		version=parseFloat('0'+navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE')+5),10);

		if( !mac&&version>4 )
		{
			// Disable right mounse butten(>IE5.0)
			document.oncontextmenu=hp_cm
		}
		else
		{
			document.onmousedown=hp_md;
			document.onkeydown=hp_md;
		}
		// Disable Selection
		document.onselectstart=hp_dn
	}
	else if(document.layers)
	{
		window.captureEvents(Event.MOUSEDOWN|Event.modifiers|Event.KEYDOWN|Event.MOUSEUP);
		window.onmousedown=hp_md;
		window.onkeydown=hp_md;
		window.onmouseup=hp_mu
	}
	else if( document.getElementById && !document.all )
	{
		document.oncontextmenu=hp_cm;
		document.onmousedown=hp_de
	}
}



function GetKey( encrypt_str )
{
    var ct = hexToByteArray( encrypt_str );
    var kt = rijndaelDecrypt( ct, ckey, 'ECB' );

    var plaintext = "";
    for( var j=0 ; j<kt.length ; j++ )
        plaintext += String.fromCharCode( kt[j] );

    return plaintext.substring( 0, 3 );
}

