setGnbImg = function(menuCnt) {
//	var onImg	= "http://img.gomtv.com/telly/images/tving_top_menu_"+menuCnt+"_on.jpg";
	
	$("#gnbImg"+menuCnt).attr({
		"src" : "http://img.gomtv.com/telly/images/tving_top_menu_"+menuCnt+"_on.jpg"
	});
	$("#gnbImg"+menuCnt).mouseout(function() {
		$("#gnbImg"+menuCnt).attr({
		"src" : "http://img.gomtv.com/telly/images/tving_top_menu_"+menuCnt+"_on.jpg"
		});
	});
}

var allChannelShowState	= false;
ShowAllChannel = function() {
	if(allChannelShowState) {
		$("#flash").css({
			"visibility":"visible"
		});
		$("#allChannelArea").css({
			"display":"none"
		});

		allChannelShowState	 = false;
	} else {
		var offset	= $('#tving_main_menu').offset();
		$("#allChannelArea").css({
			"display":"block",
			"position":"absolute",
			"left"	: offset.left + "px",
			"top"	: parseInt(offset.top + 40) + "px",
			"height" : "1px"
		});
		$("#allChannelArea").animate({ 
			"height" : "400px"
		}, 300 );
//		if($("#allChannelArea").html() == "") {
		if(1) {
			$.get("http://tving.gomtv.com/module/allChannel.gom", function(data) {
				$("#allChannelArea").html(data);
			});
		}



		$("#flash").css({
			"visibility":"hidden"
		});
		allChannelShowState	= true;

	}
}

function Login(){
	var returl = document.URL;
	if(returl == "http://pcbang.tving.com/" || returl == "http://www.tving.com/") {
		returl	= "http://tving.gomtv.com";
	}
	returl = escape(returl);
	document.location.href = 'http://private.gomtv.com/tving/login.gom?returl=' + returl;
}

function adultLogin()
{
	var returl = document.URL;
	returl = escape(returl);
	document.location.href = 'http://private.gomtv.com/cgi-bin/adultCheck.cgi?returl=' + returl;
}
function LogOut(){
	RealLogOut();
}

function RealLogOut(){
	var returl=document.URL;
	returl=escape( returl );
	var url='http://private.gomtv.com/cgi-bin/logout.cgi?returl='+returl;
	document.location.replace( url );
}


setFlashHeight	= function(cmd) {
//	alert(cmd);
	$("#flashMenuContainer").css("height", cmd);
	try
	{
		$("#flashGnb").css("height", cmd);		

	}
	catch (e)
	{
	}
}

/*
function setFlashHeight(height){
	var flashDiv = document.getElementById("flashMenuContainer");
	var tabDiv = document.getElementById("tab");
	flashDiv.style.height = height + "px";

}
*/
callTurnOn	= function() {
	location.href="http://tving.gomtv.com/channel.gom?id="+GCookie.get("turnon");
}
