function $( tagID )
{
	obj = window.document.getElementById( tagID );
	//window.alert( tagID );
	return	obj;
}

function	stripHTML( strHTML ){
	var re = /(<([^>]+)>)/gi;
	return	strHTML.replace( re , '' );
}


function changeHotTab( tabId , intTags ) {
	var tabIndex = tabId.toString().charAt( 8 );
    // make sure only one tab and panel is visible
    excludeTabs( tabId , intTags );
    // set tab and panel visible
    turnTabOn( tabId );
}

function turnTabOn( tabId ) {
    // tab
    $(tabId).className = "tab_r";
    //var str = $(tabId).innerHTML.stripTags().strip();
	var str = stripHTML( $(tabId).innerHTML );
    $(tabId).innerHTML = "<em></em>" + str;

    // tabbed panel
    $(tabId).className = "tab_r";
}

function turnTabOff( tabId ) {
    $(tabId).className = "";
    //var str = $(tabId).innerHTML.stripTags().strip();
	var str = stripHTML( $(tabId).innerHTML );
    $(tabId).innerHTML = "<b></b>" + str;

    // tabbed panel
    $(tabId).className = "tab_empty";
}

function excludeTabs( tabId , intTag ) {
	//window.alert( tabId );
    var	aryTags = tabId.split( '.' );
	var	strTagPrefix = '';
	for( intAc = 0 ; intAc < aryTags.length - 1 ; intAc++ )
	{
		strTagPrefix += aryTags[intAc] + '.';
	}
	
	for( intAc = 0 ; intAc < intTag ; intAc++ )
	{
		turnTabOff( strTagPrefix + intAc );
	}
}

function	changeAD( intIndex , intNums )
{
	for( intAc = 0 ; intAc < intNums ; intAc++ )
	{
		if( intAc == intIndex )
			$('ADArea.'+intAc).style.display = '';
		else
			$('ADArea.'+intAc).style.display = 'none';
	}
}

function	changeInnerDiv( strPrefix , intIndex , intTotal )
{
	for( intAc = 0 ; intAc < intTotal ; intAc++ )
	{
		if( intAc == intIndex )
			$( strPrefix + '.' + intAc ).style.display = '';
		else
			$( strPrefix + '.' + intAc ).style.display = 'none';
	}
}
function	initInnerDiv( strPrefix )
{
	$( strPrefix + '.0' ).style.display = '';
}
function	changePromote( intIndex )
{
	for( intAc = 0 ; intAc < intNums ; intAc++ )
	{
		if( intAc == intIndex )
			$('hotNewsArea.'+intAc).style.display = '';
		else
			$('hotNewsArea.'+intAc).style.display = 'none';
	}
}

function	changeFlash( intIndex , intNums )
{
	for( intAc = 0 ; intAc < intNums ; intAc++ )
	{
		if( intAc == intIndex )
			$('flash.'+intAc).style.display = '';
		else
		{
			$('flash.'+intAc).style.display = 'none';
		}
	}
}

function	WTC( strCTR , strType , strType2 , strType3 )
{
	if( ! strCTR )	strCTR = 'na';
	if( ! strType )	strType = 'na';
	if( ! strType2 )	strType2 = 'na';
	if( ! strType3 )	strType3 = 'na';
	
	dcsMultiTrack ('DCS.dcsuri','/CTR.dat','DCSext.WTlayout_block',strCTR,'DCSext.WTlayout_type',strType,'DCSext.WTlayout_type2',strType2,'DCSext.WTlayout_type3',strType3);
}
function callUp( data_ary )
{
	//alert('data_ary.length = ' + data_ary.length + ' / data_ary = ' + data_ary.toString());
	//aryData = data_ary.toString.split( ',' );
	WTC( data_ary[0] , data_ary[1] , data_ary[2] , data_ary[3] );
	return;
	//return for AS 2.0 ExternalInterface.call
}

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_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_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];}
}

