﻿//셀렉트박스 스크립트
 setActiveSub=function(ele)
 {
  ele.style.backgroundImage="url(/arabic/img/img_bg_select02.gif)"; // 화살표가 아래로 된 것
  if(ele.lastChild.tagName == "DIV"){
   ele.lastChild.style.display='block';
  }
 }
 setDeactiveSub=function(ele)
 {
  ele.style.backgroundImage="url(/arabic/img/img_bg_select.gif)"; // 화살표가 왼쪽으로 된 것
  if(ele.lastChild.tagName == "DIV"){
   ele.lastChild.style.display='none';
  }
 }
 toggleSub=function(ele)
 {
  var par = ele.parentNode;
  var parele = par.childNodes;
  var i = 0 , imax = parele.length;
  for(i = 0 ; i < imax ; i++){
   if(parele[i] != ele){
    setDeactiveSub(parele[i]);
   }
  }
  if(ele.lastChild.tagName == "DIV"){
   if(ele.lastChild.style.display  == "none" ){
    setActiveSub(ele);
   } else {
    setDeactiveSub(ele);
   }
  }
 }
 
//롤오버시 칼라 이미지
 function activate() { 
      picture = event.srcElement; 
      if (picture.getAttribute("ROLLOVER") != null) { 
          picture.className = "active"; 
      } 
} 
function deactivate() { 
      picture = event.srcElement; 
      if (picture.getAttribute("ROLLOVER") != null) { 
          picture.className = "inactive"; 
      } 
} 

//포토 그래픽뉴스
	function show_tab(ShowStr){
		if(ShowStr == 'photo'){
			document.all.tabimg1.src = '/arabic/img/img_news_phototab01.gif';
			document.all.tabimg2.src = '/arabic/img/img_news_phototab02a.gif';
			document.getElementById('photo').style.display="";
			document.getElementById('graphic').style.display="none";
		}
		if(ShowStr == 'graphic'){
			document.all.tabimg1.src = '/arabic/img/img_news_phototab01a.gif';
			document.all.tabimg2.src = '/arabic/img/img_news_phototab02.gif';
			document.getElementById('photo').style.display="none";
			document.getElementById('graphic').style.display="";
		}
	}
	
//콩 링크
function GetCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}

function downLoad() {

             this.location.href='http://img.kbs.co.kr/kong/download_v3/download.php';
}

//청취자수신보고
function fn_submitCHK(){
	var frm = document.frm;
	if(frm.name.value ==""){
		alert("اكتب اسمك");
		frm.name.focus();
		return;
	}
	if(frm.email.value == ""){
		alert("اكتب العنوان الالكتروني");
		frm.email.focus();
		return;
	}else if(mailCheck(frm.email.value)){
		alert("اكتب العنوان الالكتروني الصحيح"); 
		frm.email.focus();
		return;
	}
	
	if(frm.country.value == ""){
		alert("اختر الدولة");
		frm.country.focus();
		return;
	}
	var chk = 0;
	for(i=0;i<frm.listen_path.length;i++){
		if(frm.listen_path[i].checked == true){
			chk++;
		}
	}
	if(chk == 0){
		alert("اختر طريقة الاستماع الى البرامج");
		frm.listen_path[0].focus();
		return;
	}
	
	var birth_year = frm.birth_year.value;
	var birth_month = frm.birth_month.value;
	var birth_day = frm.birth_day.value;
	if(birth_year !="" && birth_month != "" && birth_day != ""){
		frm.birth_date.value = birth_year+"-"+birth_month+"-"+birth_day;
	}
	frm.action = "/korean_old(070521)/about/about_report_proc.php";
	frm.submit();
}

// 화면 이동 자바스크립트용
function xgo(url) {
	location.replace(url);
}
function fn_RadioPlay(url){
	window.open(url,'aod','width=333,height=324,left=0,top=0');
}
 // **************************************
function goPageLink1(list_count,link_count,num_str,enc_str,fname){
//	Frm = document.+fname;
//alert(Frm);
	Frm.list_count.value = list_count; 
	Frm.link_count.value = link_count;
	Frm.num_str.value = num_str;
	Frm.enc_str.value = enc_str;
	Frm.submit();
}
  // **************************************

function print_pop(no,lang,key){
	open_pop = window.open("/news_print.htm?lang="+lang+"&No="+no+"&Category="+key,"WORLDKBSNEWS","status=no,scrollbars=yes,toolbar=yes,resizable=yes,menubar=yes,width=600,height=445,left=20,top=20");
}