/*
IE Flash ActiveContent Activation Script
Author: Faisal Iqbal (chall3ng3r)
Blog: http://www.orison.biz/blog/chall3ng3r/

Feel free to modify or distribute.
*/
 
/*
Method: FlashObject
 Param1: SWF path
 Param2: Movie width
 Param3: Movie height
 Param4: BGColor
 Param5: Flashvars (Optional)
*/
function OpenPopUp(theURL, winName, features) { //v2.0
  window.open(theURL, winName, features);
}
function FlashObject(swf, width, height, bgcolor, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
 		strFlashTag += 'width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
  	if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="best"/>';
  	if(bgcolor != null) {strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>'};
//        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
  	strFlashTag += '<param name="menu" value="false"/>';
  	strFlashTag += '<param name="salign" value="LT"/>';
   	//strFlashTag += '<param name="salign" value="T"/>';
  	strFlashTag += '<param name="scale" value="noscale"/>';
 	// strFlashTag += '<param name="wmode" value="transparent"/>';
  	//strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
	strFlashTag += '<param name="allowScriptAccess" value="always"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
  	strFlashTag += 'menu="false" ';
  	strFlashTag += 'scale="noscale" ';
  	strFlashTag += 'salign="LT" ';
 	//strFlashTag += 'wmode="transparent" ';
  	//strFlashTag += 'allowScriptAccess="sameDomain" ';
  	strFlashTag += 'allowScriptAccess="always" ';
        //if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}
function FlashObjectNew(swf, width, height)
{
    var strFlashTag = new String();
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
 		strFlashTag += 'width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
 		strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
 		strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}
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];}
}

	
// °ø¹é ¹®ÀÚ padding
function spacePadding(n, sVal) {
	var nCount = n - (sVal.length % n);
	for (i=0 ; i<nCount ; i++) 
		sVal += ' ';
	return sVal;
}

// trim ÇÔ¼ö
function trim(str) {
	return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}


// img ÅÂ±× »çÁø Æø °íÁ¤ ºñÀ²À¯Áö
function resizeImg(targetID, size) {
	var img = document.getElementById(targetID);
	
	if (!img) return;
	
	if (img.width > size) {
		img.height = Math.round(img.height * size / img.width);
		img.width = size;
	}
}

// img ÅÂ±× »çÁø Æø, ³ôÀÌ ºñÀ²À¯Áö
function resizeImgWH(targetID, w, h) {
	var img = document.getElementById(targetID);

	if (!img) return;

	if (img.width > w) {
		img.height = Math.round(img.height * w / img.width);
		img.width = w;
	}

	if (img.height > h) {
		img.width = Math.round(img.width * h / img.height);
		img.height = h;
	}
}

// ÆÀ ÄÚµå
function teamName(teamCode){
	var tname;
	
	switch(teamCode){
		case "HT":
			tname = "KIA";
			break;
		case "SK":
			tname = "SK";
			break;
		case "OB":
			tname = "µÎ»ê";
			break;
		case "LT":
			tname = "·Ôµ¥";
			break;
		case "SS":
			tname = "»ï¼º";
			break;
		case "WO":
			tname = "³Ø¼¾";
			break;
		case "LG":
			tname = "LG";
			break;
		case "HH":
			tname = "ÇÑÈ­";
			break;
		case "KR":
			tname = "ÇÑ±¹";
			break;	
		case "TW":
			tname = "´ë¸¸";
			break;	
		case "JP":
			tname = "ÀÏº»";
			break;	
		case "CN":
			tname = "Áß±¹";
			break;	
		case "VE":
			tname = "º£³×";
			break;	
		case "WE":
			tname = "West";
			break;		
		case "EA":
			tname = "East";
			break;			
		default :
	}
	return tname;
}

// schedule2.asp¿¡¼­ »ç¿ë
function teamName2(teamCode){
	var tname2;
	
	switch(teamCode){
		case "HT":
			tname2 = "KIA";
			break;
		case "SK":
			tname2 = "SK";
			break;
		case "OB":
			tname2 = "µÎ»ê";
			break;
		case "LT":
			tname2 = "·Ôµ¥";
			break;
		case "SS":
			tname2 = "»ï¼º";
			break;
		case "WO":
			tname2 = "³Ø¼¾";
			break;
		case "LG":
			tname2 = "LG";
			break;
		case "HH":
			tname2 = "ÇÑÈ­";
			break;
		case "KR":
			tname2 = "ÇÑ±¹";
			break;	
		case "TW":
			tname2 = "´ë¸¸";
			break;	
		case "JP":
			tname2 = "ÀÏº»";
			break;	
		case "CN":
			tname2 = "Áß±¹";
			break;	
		case "VE":
			tname2 = "º£³×";
			break;	
		case "WE":
			tname2 = "¿þ½ºÅÏ¸®±×";
			break;		
		case "EA":
			tname2 = "ÀÌ½ºÅÏ¸®±×";
			break;			
		default :
	}
	return tname2;
}