// 2006³â 2¿ù 15ÀÏ Windows Updater°ü·Ã ÇÃ·¹½¬ object »ý¼ºÀ» À§ÇÑ Æã¼Ç
function printFlashObject(flash_src,name,width,height,option_param_tag)/*{{{*/
{
  obj_html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+width+"' height='"+height+"' id='"+name+"' align='middle'>\
  <param name='allowScriptAccess' value='always' />\
  <param name='movie' value='"+flash_src+"' />\
  <param name='quality' value='high' />\
  <param name='bgcolor' value='#ffffff' />\
  <param name='wmode' value='transparent'>\
  <param name='menu' value='false'>";

  obj_html = obj_html + option_param_tag;

  obj_html = obj_html + "<embed src='"+flash_src+"' wmode='transparent' quality='high' bgcolor='#ffffff' width='"+width+"' height='"+height+"' name='"+name+"' align='middle' allowscriptaccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
  </object>";

  document.write(obj_html);
}/*}}}*/


// ¹Ìµð¾îÇÃ·¹ÀÌ¾î ½ºÅ©¸³Æ®
function printPlayerObject(file_src,name,width,height,file_start,option_param_tag){
  obj_html = "<object CLASSID=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 width='"+width+"' height='"+height+"' id='"+name+"' />\
  <param name='URL' value='"+file_src+"' />\
  <param name='AutoStart' value='"+file_start+"'>";
  obj_html = obj_html + option_param_tag;
  obj_html = obj_html + "</object>";
  document.write(obj_html);
}

function openCommunityPopup()
{
 window.open('http://file.pmang.kr/images/pmang/gamepub/police/community.html', '_policy', 'width=670,height=495,resizable=no,scrollbars=no,scrolling=no' );
}

//ÅÇ
function tabMove(name,num) {
	if(!document.getElementsByName(name)) return;
	
	var TabGroup = document.getElementsByName(name);
	var TabThis = num-1;
	
	for(i=0; i<TabGroup.length; i++) {
		var TabName = name+(i+1);
		var TabContents = document.getElementById(TabName);
		if (TabContents) {
			if(i==TabThis) {
				TabGroup[TabThis].className = "on";
				TabContents.style.display = "block";
			}
			else {
				TabGroup[i].className = "";
				TabContents.style.display = "none";
			}
		}
	}
}

// ·¹ÀÌ¾î º¸±â
function layerView(layer) {
	if(document.getElementById(layer)) 	document.getElementById(layer).style.display = "block";
}

// ·¹ÀÌ¾î ´Ý±â 
function layerHide(layer) {
	if(document.getElementById(layer)) 	document.getElementById(layer).style.display = "none";
}

// 2006³â 2¿ù 15ÀÏ Windows Updater°ü·Ã ÇÃ·¹½¬ object »ý¼ºÀ» À§ÇÑ Æã¼Ç
function printFlashObject(flash_src,name,width,height,option_param_tag)/*{{{*/
{
  obj_html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+width+"' height='"+height+"' id='"+name+"' align='middle'>\
  <param name='allowScriptAccess' value='always' />\
  <param name='movie' value='"+flash_src+"' />\
  <param name='quality' value='high' />\
  <param name='bgcolor' value='#ffffff' />\
  <param name='wmode' value='transparent'>\
  <param name='menu' value='false'>";

  obj_html = obj_html + option_param_tag;

  obj_html = obj_html + "<embed src='"+flash_src+"' wmode='transparent' quality='high' bgcolor='#ffffff' width='"+width+"' height='"+height+"' name='"+name+"' align='middle' allowscriptaccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
  </object>";

  document.write(obj_html);
}/*}}}*/


// ¹Ìµð¾îÇÃ·¹ÀÌ¾î ½ºÅ©¸³Æ®
function printPlayerObject(file_src,name,width,height,file_start,option_param_tag){
  obj_html = "<object CLASSID=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 width='"+width+"' height='"+height+"' id='"+name+"' />\
  <param name='URL' value='"+file_src+"' />\
  <param name='AutoStart' value='"+file_start+"'>";
  obj_html = obj_html + option_param_tag;
  obj_html = obj_html + "</object>";
  document.write(obj_html);
}

//Å¬·¡½ºÂüÁ¶
function getElementsByClass(searchClass,node,tag) {
    var classElements = new Array();
    if ( node == null )
        node = document;
    if ( tag == null )
        tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
    for (i = 0, j = 0; i < elsLen; i++) {
        if ( pattern.test(els[i].className) ) {
            classElements[j] = els[i];
            j++;
        }
    }
    return classElements;
}
//ÅÇ
function tabMove(name,num) {
	if(!document.getElementsByName(name)) return;
	
	var TabGroup = document.getElementsByName(name);
	var TabThis = num-1;
	
	for(i=0; i<TabGroup.length; i++) {
		var TabName = name+(i+1);
		var TabContents = document.getElementById(TabName);
		if (TabContents) {
			if(i==TabThis) {
				TabGroup[TabThis].className = "on";
				TabContents.style.display = "block";
			}
			else {
				TabGroup[i].className = "";
				TabContents.style.display = "none";
			}
		}
	}
}

// ·¹ÀÌ¾î º¸±â
function layerView(layer) {
	if(document.getElementById(layer)) 	document.getElementById(layer).style.display = "block";
}

// ·¹ÀÌ¾î ´Ý±â 
function layerHide(layer) {
	if(document.getElementById(layer)) 	document.getElementById(layer).style.display = "none";
}

// Å©¶ó¿î¼¥ ·Ñ¸µ
function crownShop(offset) {
	var current = 0;
	
	var list = getElementsByClass('crw_list');
	if (list.length <= 1) return;
	
	for ( var i=0; i<list.length; i++ ) {
		if ( list[i].style.display != 'none') current = i;
		list[i].style.display = 'none';
	}
	
	if (offset < 0) {
		if ( current == 0) current = list.length-1;
		else current--;
	}
	else if (offset > 0) {
		if ( current == (list.length-1)) current = 0;
		else current++;
	}
	list[current].style.display = 'block';
}

PREV = -1;
NEXT = 1;

var iRun = true;
window.attachEvent ("onload",itemRolling);
function itemRolling(){
	if(iRun){
		var time = 4000;
		var timer = setTimeout("crownShop(NEXT);", time);
	}
}