// Get Data from URL Parsing
function __newsParseGet()
{
	var tmp, pattern1, pattern2, i, keyval = new Array(), e, _get = new Array();

	pattern1 = /\?/;
	if(!pattern1.test(location.href)) {
		return true;
	}

	tmp = location.href.replace(/^.*\?/, "");

	if(tmp == "") {
		return true;
	}

	tmp = tmp.split("&");

	pattern1 = /^([^=]+)=?(.*)$/;
	pattern2 = /^(.*)\[(\d*)\]$/;
	for(i = 0; i < tmp.length; i ++) {
		if(!pattern1.test(tmp[i])) {
			window.alert("error");
		}
		keyval[0] = RegExp.$1;
		keyval[1] = RegExp.$2;
		if(pattern2.test(keyval[0])) {
			if(RegExp.$2 == "") {
				try {
					_get[RegExp.$1].push(keyval[1]);
				} catch(e) {
					_get[RegExp.$1] = new Array();
					_get[RegExp.$1][0] = keyval[1];
				}
			} else {
				try {
					_get[RegExp.$1][RegExp.$2] = keyval[1];
				} catch(e) {
					_get[RegExp.$1] = new Array();
					_get[RegExp.$1][RegExp.$2] = keyval[1];
				}
			}
		} else {
			_get[keyval[0]] = keyval[1];
		}
	}

	return _get;
}


// C1 C2 °ª °¡Á®¿À±â
function __getChannel()
{
	var data    = new Array();
		data    = __newsParseGet();
	var channel = new Array();

	// Ã¤³Î Á¤º¸ Ã¼Å©
	if( typeof(data['c1']) == "undefind" || typeof(data['c2']) == "undefind" )
		return channel;

	var c1 = trim(data['c1']);
	var c2 = trim(data['c2']);

	// Ã¤³Î Á¤º¸ Ã¼Å©
	if( c1 == "" || c2 == "" )
		return channel;

	channel[0] = c1;
	channel[1] = c2;

	return channel;
}

function __newsMakeGoogleAdSense()
{
	var google_ad_slot;

	var channel = new Array();
		channel = __getChannel();

	// Ã¤³Î Á¤º¸ Ã¼Å©
	if( channel.length == 0 )
		return;

	var c1 = trim(channel[0]);
	var c2 = trim(channel[1]);

	// Ã¤³Î Á¤º¸ Ã¼Å©
	if( c1 == "" || c2 == "" )
		return;

	google_ad_slot = "";

	// korea collection
	// world collection
	if( c1 == "01" )
	{
		if( c2 == "01" )
			google_ad_slot = "8600205773";
		if( c2 == "02" )
			google_ad_slot = "8156772700";
	}

	// 02 01 fashion hot trend
	// 02 02 fashion styling
	// 02 03 fashion brand news
	// 02 04 fashion luxury
	// 02 05 fashion people
	if( c1 == "02" )
	{
		if( c2 == "01" )
			google_ad_slot = "8222130614";
		if( c2 == "02" )
			google_ad_slot = "9643227852";
		if( c2 == "03" )
			google_ad_slot = "5045286932";
		if( c2 == "04" )
			google_ad_slot = "7847435641";
		if( c2 == "05" )
			google_ad_slot = "5224768461";
	}

	// 03 01 beauty hot trend
	// 03 02 beauty styling
	// 03 03 beauty brand news
	if( c1 == "03" )
	{
		if( c2 == "01" )
			google_ad_slot = "3232023996";
		if( c2 == "02" )
			google_ad_slot = "7050800643";
		if( c2 == "03" )
			google_ad_slot = "1594505756";
	}

	// 04 01 entertainment tv
	// 04 02 entertainment movie
	// 04 03 entertainment music
	// 04 04 entertainment culture
	// 04 05 entertainment photo
	// 04 06 entertainment vod
	if( c1 == "04" )
	{
		if( c2 == "01" )
			google_ad_slot = "4256815409";
		if( c2 == "02" )
			google_ad_slot = "1804602383";
		if( c2 == "03" )
			google_ad_slot = "9433474708";
		if( c2 == "04" )
			google_ad_slot = "8650261954";
		if( c2 == "05" )
			google_ad_slot = "0876524027";
		if( c2 == "06" )
			google_ad_slot = "2926262129";
	}


	// 05 01 life wedding
	// 05 02 life leisure
	// 05 03 life e-life
	// 05 04 life love&sex
	// 05 05 life economy
	if( c1 == "05" )
	{
		if( c2 == "01" )
			google_ad_slot = "6185203786";
		if( c2 == "02" )
			google_ad_slot = "8493523000";
		if( c2 == "03" )
			google_ad_slot = "2303684007";
		if( c2 == "04" )
			google_ad_slot = "4243718096";
		if( c2 == "05" )
			google_ad_slot = "6188209807";
	}


	// 06 01 sports golf
	// 06 02 sports football
	// 06 03 sports baseball
	// 06 04 sports other
	if( c1 == "06" )
	{
		if( c2 == "01" )
			google_ad_slot = "5014002075";
		if( c2 == "02" )
			google_ad_slot = "8337295337";
		if( c2 == "03" )
			google_ad_slot = "6451491061";
		if( c2 == "04" )
			google_ad_slot = "3086875087";
	} 


	if( google_ad_slot != "" )
	{
		document.write('<p style="margin:30 0 0 0">');
		document.write('<IFRAME id="googlead01" src="/inc/google/view.php?google_ad_slot=' + google_ad_slot + '&width=468&height=60" width="468" height="60" scrolling="no" frameborder="no" border="0"></IFRAME>');
		document.write('</p>');
	}
}

__newsMakeGoogleAdSense();

