var Browser = 
{
	a : navigator.userAgent.toLowerCase()
}

Browser =
{
	ie: false,
	ie6: Browser.a.indexOf( "msie 6" ) != -1,
	ie7: Browser.a.indexOf( "msie 7" ) != -1,
	ie8: Browser.a.indexOf( "msie 8" ) != -1,
	opera: !!window.opera,
	safari: Browser.a.indexOf( "safari" ) != -1,
	safari3: Browser.a.indexOf( "applewebkit/5" ) != -1,
	mac: Browser.a.indexOf( "mac" ) != -1,
	chrome: Browser.a.indexOf( "chrome" ) != -1,
	firefox: Browser.a.indexOf( "firefox" ) != -1
}

var showProp = "top";
var showValue = "80px";
var hideProp = "top";
var hideValue = "-1000px";
var ie = true;
function getBrowserType()
{
	if( Browser.chrome )
	{
		ie = false;
	}
	else if( Browser.firefox )
	{
		ie = false;
		//alert( "firefox" );
	}
	else if( Browser.ie6 )
	{
		//alert( "ie6" );
	}
	else if( Browser.ie7 )
	{
		//alert( "ie7" );
	}
	else if( Browser.ie8 )
	{
		//alert( "ie7" );
	}
	else if( Browser.opera )
	{
		ie = false;
		//alert( "opera" );
	}
	else if( Browser.safari )
	{
		ie = false;
		//alert( "safari" );
	}
	else if( Browser.safari3 )
	{
		ie = false;
		//alert( "safari3" );
	}
	else if( Browser.mac )
	{
		ie = false;
		//alert( "mac" );
	}
	else
	{
		//alert( "maybe ie" );
	}
}
getBrowserType();

//플래시객체찾기
function getMovie( id ) 
{
	var obj = document.getElementById( id );
	if( typeof obj != 'object' ) 
	{
		if( navigator.userAgent.indexOf("Safari") == -1 && navigator.userAgent.indexOf("firefox") != -1 )
			obj = obj.getElementsByTagName( 'object' )[0];
	}
	return obj;
	
	
/*
	if (navigator.appName.indexOf("Microsoft") != -1)
		return window[id];
	else
		return document[id];
*/
}	

var rnb;
var main;
var isIndexComplete = false;
var isRnbComplete = false;
function onLoadComp( type )
{
	switch( type )
	{
		case "index":
			isIndexComplete = true;
			main = ( ie ) ? getMovie( "main_ie" ) : getMovie( "main" );
			break;
		
		case "rnb":
			isRnbComplete = true;
			rnb = ( ie ) ? getMovie( "rnb_ie" ) : getMovie( "rnb" );
			break;
	}
	
	if( isIndexComplete == true && isRnbComplete == true )
	{
		main.onComplete();
	}
		
}


function xmlDataToRightNavi($data)
{
	rnb.xmlDataToRightNavi($data);
}

function receivedXMLData($code)
{
	main.xmlLoadedListener($code);
}

function setRightNavi($type, $num)
{
	rnb.changeRightNavi($type, $num);
}

function changeRightNavi($type, $num)
{
	showRightNavi();
	rnb.changeRightNavi($type, $num);
}

function hideRightNavi()
{
	rnb.hideThisNavi();
	if( !ie )
	{
		var objRnb= document.getElementById( "rightNavi" );
		objRnb.style[ hideProp ] = hideValue;
	}
}

function showRightNavi()
{
	if( !ie )
	{
		var objRnb = document.getElementById( "rightNavi" );
		objRnb.style[ showProp ] = showValue;
	}
	rnb.showThisNavi();	
}

function showreelHide()
{
	main.showreelHide();
}


function resizeElement( $id, $pixel )
{
	if($pixel > 980 )
	{
		var obj = document.getElementById( $id );
		obj.style["height"] = $pixel + "px";
	}
	else
	{
		var obj2 = document.getElementById( $id );
		obj2.style["height"] =  "100%";
	}
}

function rightNaviSubMenuChange($id, $bool, $shortCutIdx)
{
	rnb.changeSubMenu($id, $bool, $shortCutIdx);
}

function subNextPageSetToIndex($jdx, $type)
{
	main.subNextPageSetFromRnb($jdx, $type);
}

function aaaa($data)
{
	alert($data);
}

function thumbnailClick($listNum, $sortNum)
{
	if( !ie )
	{
		var objRnb= document.getElementById( "rightNavi" ); 
		objRnb.style[ hideProp ] = hideValue;
	}
	hideRightNavi();
	main.thumbnailMode($listNum, $sortNum);
}

function thumbnailModeOff()
{	
	showRightNavi();
/*
	if( !ie )
	{
		var objRnb = document.getElementById( "rightNavi" );
		objRnb.style[ showProp ] = showValue;
	}
*/
}

function sortMenuChangeToIndex($listNum, $sortNum)
{
	main.sortMenuChangeToIndex($listNum, $sortNum);
}

function mainPageCompanyControl($idx)
{
	main.menuChange($idx);
}

function indexSortToRightNavi($listNum, $sortNum)
{
	rnb.sortMenuChangeToRightNavi($listNum, $sortNum);
}

function showreelClick()
{
	main.showreelShow();
}

function mPointClick()
{
	main.mPointClick();
}

function shortCutCaseStudy($idx)
{
	main.shortCutCaseStudy($idx);
}

function shortCutRecruit()
{
	main.shortCutRecruit();
}

function rightNaviInit()
{
	rnb.naviInit();
}

function testFunc( str )
{
	//alert( str );
}

var popWin;
var recruitURL = "/popup/recruit_popup.html";
function popWin( url, width, height )
{
	popWin = window.open( url, "recruit_notice", "width=" + width + ", height=" + height + "scrollbars=no, location=no, toolbar=no, status=no, menubar=no"  );
}

//채용안내창 팝업띄우기
function showPopup()
{
	popWin( recruitURL, 500, 770 );	
}

