document.domain = 'daum.net';

//hyphen top page request tab changer
function topTabInit(){
	//request
	var requesting = document.getElementById('requesting_tab');
	var requested = document.getElementById('requested_tab');
	
	//daum foundation
	var youth_tab = document.getElementById('tab_youthvoice');
	var itcan_tab = document.getElementById('tab_itcanus');
	var olly_tab = document.getElementById('tab_olly');

	addEvent(requesting,'onclick',function(){topTabChange(1)});
	addEvent(requested,'onclick',function(){topTabChange(2)});
	addEvent(youth_tab,'onclick',function(){dfTabChange('youth')});
	addEvent(itcan_tab,'onclick',function(){dfTabChange('itcan')});
	addEvent(olly_tab,'onclick',function(){dfTabChange('olly')});
}

function topTabChange(type){
	var requesting_tab = document.getElementById('requesting_tab');
	var requested_tab = document.getElementById('requested_tab');

	var requesting = document.getElementById('requesting');
	var requested = document.getElementById('requested');

	if(type == 1){
		requesting_tab.style.backgroundImage = 'url("http://image.request.daum.net/v1/img/hyphen/tab_hope_01over.gif")';
		requested_tab.style.backgroundImage = 'url("http://image.request.daum.net/v1/img/hyphen/tab_hope_02off.gif")';
		requesting.style.display = 'block';
		requested.style.display = 'none';
	}else{
		requesting_tab.style.backgroundImage = 'url("http://image.request.daum.net/v1/img/hyphen/tab_hope_01off.gif")';
		requested_tab.style.backgroundImage = 'url("http://image.request.daum.net/v1/img/hyphen/tab_hope_02over.gif")';
		requesting.style.display = 'none';
		requested.style.display = 'block';
	}
}

function dfTabChange(type){
	var youth_tab = document.getElementById('tab_youthvoice');
	var itcan_tab = document.getElementById('tab_itcanus');
	var olly_tab = document.getElementById('tab_olly');

	var youth = document.getElementById('cnt_youthvoice');
	var itcan = document.getElementById('cnt_itcanus');
	var olly = document.getElementById('cnt_olly');


	switch (type) {
		case 'youth':
			youth_tab.style.backgroundPosition = '0 0';
			itcan_tab.style.backgroundPosition = '-188px -38px';
			olly_tab.style.backgroundPosition = '-374px -38px';
			youth.style.display = 'block';
			itcan.style.display = 'none';
			olly.style.display = 'none';
			break;

		case 'itcan':
			youth_tab.style.backgroundPosition = '0 -38px';
			itcan_tab.style.backgroundPosition = '-188px 0';
			olly_tab.style.backgroundPosition = '-374px -38px';
			youth.style.display = 'none';
			itcan.style.display = 'block';
			olly.style.display = 'none';
			break;

		case 'olly':
			youth_tab.style.backgroundPosition = '0 -38px';
			itcan_tab.style.backgroundPosition = '-188px -38px';
			olly_tab.style.backgroundPosition = '-374px -0';
			youth.style.display = 'none';
			itcan.style.display = 'none';
			olly.style.display = 'block';
			break;
		default:
			break;
	}
}