//-- chn_script.js
//-- 2007-11-09

//-- OPEN POPUP
function go_sms()
{
	window.open('/smsweb/index.html','StrategicManagementSocietyMembers','resizable=1,width=800,height=670,left=200,top=170,scrollbars=yes'); 
}

function go_idx()
{
	var j_url='/stat/chnIdx.html';
	window.open(j_url,'SERIChina_','status=no,scrollbars=yes,resizable=false,width=980,height=700,left=20,top=20');
}


function swfView(width, height, url, fvalues, id) 
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie" value="'+url+'" />');
	document.write('<param name="Flashvars" value="'+fvalues+'"/>');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<embed src="'+url+'" wmode="transparent" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="call" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

//-- OPEN NEW WIN --
function open_win(url)
{
	window.open(url,'SERICHINA_DB','status=no, scrollbars=yes,resizable=no,width=940,height=650,x=1,y=1');        
}

// 08 folder - organization popup
function MM_openBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

//index - layer display
function showNotice(show)
{
	if(show == "1"){
		Notice1.style.display = '';
		Notice2.style.display = 'none';
		Notice3.style.display = 'none';
		//Notice4.style.display = 'none';

	}else if(show == "2"){
		Notice1.style.display = 'none';
		Notice2.style.display = '';
		Notice3.style.display = 'none';
		//Notice4.style.display = 'none';

	}else if(show == "3"){
		Notice1.style.display = 'none';
		Notice2.style.display = 'none';
		Notice3.style.display = '';
		//Notice4.style.display = 'none';
	}
/*
	}else if(show == "4"){
		Notice1.style.display = 'none';
		Notice2.style.display = 'none';
		Notice3.style.display = 'none';
		Notice4.style.display = '';
	}
*/
}

//move document location
function go(curl)
{
	this.location = curl;
}


function MM_preloadImages() 
{ //v3.0
  var d=document; 
  
  if(d.images)
  {
  	if(!d.MM_p) 
  		d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
    for(i=0; i<a.length; i++)
    {
  	  if (a[i].indexOf("#")!=0)
    	{ 
    		d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
    	}
    }
  }
}

function MM_swapImgRestore() 
{ //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) 
{ //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() 
{ //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//popup media content
function media_view_open(p_mdmenu, p_mdkey, p_aud)
{
	var j_url;
		
	j_url='/viewer/scViewer.html?p_mdmenu='+p_mdmenu+'&p_mdkey='+p_mdkey + '&p_mode='+p_aud;
	window.open(j_url,'MediaViewer','status=no,scrollbars=no,resizable=no,width=850,height=580,left=10,top=10');
}


//quick menu link
function quick_link(j_idx) {
	switch(j_idx){
		case '01': go('/04/gnBrdL.html?c_menu=0108'); break;
		case '02': go('/04/gnBrdL.html?c_menu=0109'); break;
		case '03': go('/04/gnBrdL.html?c_menu=0601'); break;
		case '04': go('/kcjstat/asiaStat.html'); break;
		case '05': go_idx(); break;
		case '06': window.open('http://www.seriworld.org/seriquarterly/wldQMain.html'); break;
	}
}

//upload file
function uploadDone(j_seq, j_filename)
{
	var originalname = eval("document.frm.p_originalname"+j_seq);
	var delfile = eval("document.frm.p_delfile"+j_seq);	//ÆÄÀÏ»èÁ¦ ¿©ºÎ
		
	originalname.value = j_filename;
	delfile.value = 'N';		
}

/*
//the number of attached files
function setFileNum(j_num)
{ 
	document.frm.p_filenum.value = j_num;	
}
*/

function deleteFile(j_seq)
{	
	var delfile = eval("document.frm.p_delfile"+j_seq);
	
	delfile.value = 'Y';	
}

//show file uploader layer
function showFileUploader(j_val)
{
	var div = eval("Uploader"+j_val);
	//var more = eval("more"+j_val-1);
	
	div.style.display = '';
	//more.value = '';
}

function check_null(g_obj,g_msg,g_focus,g_msggb){

	if(!fnTrim(g_obj.value)){
		if (g_msggb == 1){
		  alert(g_msg + '???????!');
		}else{
		  alert(g_msg + '??) ???????');
		}
		if(g_focus)
		g_obj.focus();
		return false;
	}else{
	  return true;
	}
}
 
function fnTrim(chStr) {
	var nStrCheck; 
	nStrCheck = chStr.indexOf(" ");     
	while (nStrCheck != -1) { 
		chStr = chStr.replace(" ", ""); 
		nStrCheck  = chStr.indexOf(" "); 
	} 
	return chStr;
}