 var j=1, timer, slotnum;
function tabChg(obj){
	//clearTimeout(timer);
	for(var i=1;i <= 3;i++)
	{
		getobj('tab_'+i.toString(10)).style.color = '#000';
		getobj('tab_'+i.toString(10)).style.backgroundImage = 'url(/images/main/right_topbg.gif)';
		getobj('right'+i.toString(10)).style.display = 'none';
	}
	getobj('right'+obj.id.substring(4).toString(10)).style.display = 'block';
	obj.style.color = 'orange';
	obj.style.backgroundImage = 'url(/images/main/right_topbg_.gif)';
}

function tabAutoChg(objStr){
	var obj = getobj(objStr);
	if(j < 3)
		j++;
	else
		j=1;

	for(var i=1;i <= 3;i++)
	{
		getobj('tab_'+i.toString(10)).style.color = '#000';
		getobj('tab_'+i.toString(10)).style.backgroundImage = 'url(/images/main/right_topbg.gif)';
		getobj('right'+i.toString(10)).style.display = 'none';
	}
	getobj('right'+obj.id.substring(4).toString(10)).style.display = 'block';
	obj.style.color = 'orange';
	obj.style.backgroundImage = 'url(/images/main/right_topbg_.gif)';

	timer = setTimeout("tabAutoChg('tab_"+j.toString(10)+"')",3000);
}

function mainInit(){
	//tabAutoChg('tab_1');
	if(parent.frames['daum_bar'])
		parent.location.replace('http://www.nawayo.com/');
	initPage();
//	if(str_img_url && str_clk_url){
//		getobj("mainbanner").src = str_img_url;
//		getobj("mainbannerurl").href = str_clk_url;
//	}
}

function chgSlot(fileName,num){
	getobj('slotmenu1').style.backgroundImage = 'url(/images/main/slot_menu1.jpg)';
	getobj('slotmenu2').style.backgroundImage = 'url(/images/main/slot_menu2.jpg)';
	getobj('slotmenu3').style.backgroundImage = 'url(/images/main/slot_menu3.jpg)';
	getobj('slotmenu4').style.backgroundImage = 'url(/images/main/slot_menu4.jpg)';
	getobj('slotmenu'+num).style.backgroundImage = 'url(/images/main/slot_menu'+num+'_over.jpg)';
	var url='/Slot/' + fileName + '.asp';
	var xmlHttp = newXMLHttpRequest();
	if (xmlHttp){
		xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange = function(){
			if (xmlHttp.readyState == 4){
				if (xmlHttp.status == 200){
					var xmlHttpData = xmlHttp.responseText;
					getobj('slotevent').innerHTML = xmlHttpData;
					}
			}
		}
		xmlHttp.send(null);
	}
}
function chgSlot3(fileName,num){
	var num2;
	if (slotnum != num){
		if (num == 3)
			num2 = 4;
		else
			num2 = num;
		getobj('slotmenu1').style.backgroundImage = 'url(/images/main/slot_menu1.jpg)';
		getobj('slotmenu2').style.backgroundImage = 'url(/images/main/slot_menu2.jpg)';
		getobj('slotmenu3').style.backgroundImage = 'url(/images/main/slot_menu4.jpg)';
		getobj('slotmenu'+num).style.backgroundImage = 'url(/images/main/slot_menu'+num2+'_over.jpg)';
		var url='/Slot/' + fileName + '.asp';
		var xmlHttp = newXMLHttpRequest();
		if (xmlHttp){
			xmlHttp.open("GET",url,true);
			xmlHttp.onreadystatechange = function(){
				if (xmlHttp.readyState == 4){
					if (xmlHttp.status == 200){
						var xmlHttpData = xmlHttp.responseText;
						getobj('slotevent').innerHTML = xmlHttpData;
						}
				}
			}
			xmlHttp.send(null);
		}
		slotnum = num;
	}
}

function tabAutoChg3(objStr){
	var obj = getobj(objStr);
	if(j < 2)
		j++;
	else
		j=1;

	for(var i=1;i <= 2;i++)
	{
		getobj('tab_'+i.toString(10)).style.color = '#000';
		getobj('tab_'+i.toString(10)).style.backgroundImage = 'url(/images/main/right_topbg.gif)';
		getobj('right'+i.toString(10)).style.display = 'none';
	}
	getobj('right'+obj.id.substring(4).toString(10)).style.display = 'block';
	obj.style.color = 'orange';
	obj.style.backgroundImage = 'url(/images/main/right_topbg_.gif)';

	timer = setTimeout("tabAutoChg3('tab_"+j.toString(10)+"')",3000);
}

//css , default.asp고칠것(onload,slot mouseover).., 3