window.status="MYKOfan";

function Drama()
{
	document.getElementById('drama').src = 'images/rollover_drama_home.gif';
}
function Homee()
{
	document.getElementById('myko').src = 'images/rollover_home.gif';
}
function Fancafe()
{
	document.getElementById('fan').src = 'images/rollover_fancafe.gif';
}
function RDrama()
{
	document.getElementById('drama').src = 'images/normal_drama.gif';
}
function RHomee()
{
	document.getElementById('myko').src = 'images/normal_home.gif';
}
function RFancafe()
{
	document.getElementById('fan').src = 'images/normal_fancafe.gif';
}
//Script for div show hide------------------------------------------------>

function HomeMenuH()
{
	document.getElementById("home_option").style.visibility="hidden";
	Homee();
}
function HomeMenuV()
{
	document.getElementById("home_option").style.visibility="visible";
	FanMenuH();
	DramaMenuH();	
}

function DramaMenuH()
{
	document.getElementById("drama_option").style.visibility="hidden";
	RDrama();
}
function DramaMenuV()
{
FanMenuH();
	HomeMenuH();
	RHomee();
	document.getElementById("drama_option").style.visibility="visible";
	
	
}
function FanMenuH()
{
	document.getElementById("fan_option").style.visibility="hidden";
	RFancafe();
}
function FanMenuV()
{
DramaMenuH();
	HomeMenuH();
	RHomee();
	document.getElementById("fan_option").style.visibility="visible";
	
}

//end script for div shop hiede---------------------------------------------->
//script for Plus & minus buttons------------------------------------------------------------------->


function temp(obj)
{
	obj.src = 'images/rollover_Plus.gif';
}
function temp2(obj)
{
	obj.src = 'images/Plus.gif';
}
function tempe(obj)
{
	obj.src = 'images/rollover_Minus.gif';
}
function tempe2(obj)
{
	obj.src = 'images/Minus.gif';
}
//end script for pluse & minus buttons------------------------------------------------------------->
//scritp for a menu buttons------------------------------------------------------------------------>
function me(obj)
{
	
	if(obj == 'home')
	{
		document.getElementById(obj).src = 'images/rollover_home.gif';
	}
	if(obj == 'drama')
	{
		document.getElementById(obj).src = 'images/rollover_drama_home.gif';
	}
	if(obj == 'fan')
	{
		document.getElementById(obj).src = 'images/rollover_fancafe.gif';
	}
	//if(obj == 'Plus')
//	{
//		document.getElementById(obj).src = 'images/rollover_Plus.gif';
//	}
//	if(obj == 'Minus')
//	{
//		document.getElementById(obj).src = 'images/rollover_Minus.gif';
//	}
	
}
function me1(obj)
{
	if(obj == 'home')
	{
		document.getElementById(obj).src = 'images/normal_home.gif';
	}
	if(obj == 'drama')
	{
		document.getElementById(obj).src = 'images/normal_drama.gif';
	}
	if(obj == 'fan')
	{
		document.getElementById(obj).src = 'images/normal_fancafe.gif';
	}
	//if(obj == 'Plus')
	//{
		//document.getElementById(obj).src = 'images/Plus.gif';
	//}
	//if(obj == 'Minus')
//	{
//		document.getElementById(obj).src = 'images/Minus.gif';
//	}
	
}
//end script for menu buttons----------------------------------------------------------------------------->

//script for on load at home pages--------------------------------------------------------->

function Test()
{
	alert("Test the Script")
}
function AllHidden()
{
	FanMenuH();
	HomeMenuH();
	DramaMenuH();	
	RFancafe();
	RDrama();
	RHomee();
	}
function AtHome()
{
    HomeMenuV();
	FanMenuH();
	DramaMenuH();
	RFancafe();
	RDrama();
	Homee();
	}
function AtDrama()
{
	DramaMenuV();
	Drama();
	}
function AtFan()
{
	FanMenuV();
	Fancafe();
	}
	
//end script for onload at home pages--------------------------------------------------->


//script for mouse over image------------------------------------------------------------->

function DramaImG(obj)
{
		//obj.style.width="95%"
		obj.style.width="70px";
		obj.style.height="66px";
	//alert("color change")
}
function DramaImge(obj)
{
		//obj.style.width="100%"
		obj.style.width="65px";
		obj.style.height="61px";
	//alert("color change")
}
//Episode page details-------------------------------------------------------------->
function Highlight()
{
	obj.style.visibility="true";
}	
function Highlight2()
{
	obj.style.visibility="false";
}
function ArchiveBorder(obj)
{
	obj.style.border="2px solid #FF6803";
}
function ArchiveBorder2(obj)
{
	obj.style.border="2px solid #999999";
}
	
	
	
hex=255 // Initial color value.

function fadetext_plus(val, cnt)
{	
	temp_plus = cnt;
	if(hex>0) 
	{ 		
		hex-=11; // increase color darkness		
		document.getElementById(val).style.color="rgb("+hex+","+hex+","+hex+")";
		document.getElementById(val).innerHTML = temp_plus;
		setTimeout("fadetext_plus('"+val+"','"+temp_plus+"')",50); 
	}
	else
	{
		document.getElementById(val).innerHTML = temp_plus;
		hex=255; //reset hex value
	}
}

function fadetext_Minus(val, cnt1)
{	
	temp3 = cnt1;

	if(hex>0) 
	{ 		
		hex-=11; // increase color darkness	
		
		document.getElementById(val).style.color="rgb("+hex+","+hex+","+hex+")";
		document.getElementById(val).innerHTML = temp3;
		setTimeout("fadetext_Minus('"+val+"','"+temp3+"')",50); 
		
	}
	else
	{
		
		document.getElementById(val).innerHTML = temp3;
		hex=255; //reset hex value
	}
}
//for bookmark the site

function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
//Limit Charactors
function taLimit(srcElement) {
	var taObj=srcElement;
	if (taObj.value.length==taObj.maxLength*1) return false;
}

function taCount(srcElement,visCnt) { 
	var taObj=srcElement;
	if (taObj.value.length>taObj.maxLength*1) taObj.value=taObj.value.substring(0,taObj.maxLength*1);
	//alert(document.getElementById(visCnt).textContent);
	
	var SpanElement = document.getElementById(visCnt);
	if(document.all){
     if (SpanElement) {SpanElement.innerText=taObj.maxLength-taObj.value.length;}
} else{
    if (SpanElement) {SpanElement.textContent=taObj.maxLength-taObj.value.length;}
}
}
function URLEncode(SearchText)
            {
	            // The Javascript escape and unescape functions do not correspond
	            // with what browsers actually do...
	                var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	                var HEX = "0123456789ABCDEF";

	                var plaintext = SearchText;
	                var encoded = "";
	                for (var i = 0; i < plaintext.length; i++ ) {
		            var ch = plaintext.charAt(i);
	                if (ch == " ") {
		                    encoded += "+";				// x-www-urlencoded, rather than %20
		            } 
		            else if (SAFECHARS.indexOf(ch) != -1) {
		                encoded += ch;
		            } else {
		                var charCode = ch.charCodeAt(0);
			            if (charCode > 255) {
			            /*alert( "Unicode Character '" 
                        + ch + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );*/
				            encoded += plaintext.charAt(i);
			        } else {
				        encoded += "%";
				        encoded += HEX.charAt((charCode >> 4) & 0xF);
				        encoded += HEX.charAt(charCode & 0xF);
			   }
		    }
	    } // for
	    return encoded;
    }
    function URLDecode(SearchText)
        {
           // Replace + with ' '
           // Replace %xx with equivalent character
           // Put [ERROR] in output if %xx is invalid.
           var HEXCHARS = "0123456789ABCDEFabcdef"; 
           var encoded = SearchText;
           var plaintext = "";
           var i = 0;
           while (i < encoded.length) {
               var ch = encoded.charAt(i);
	           if (ch == "+") {
	               plaintext += " ";
		           i++;
	           } else if (ch == "%") {
			        if (i < (encoded.length-2) 
					        && HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 
					        && HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				        plaintext += unescape( encoded.substr(i,3) );
				        i += 3;
			        } else {
				        /*alert( 'Bad escape combination near ...' + encoded.substr(i) );
				        plaintext += "%[ERROR]";*/
				        i++;
			        }
		        } else {
		           plaintext += ch;
		           i++;
		        }
	        } // while
           return plaintext;
        }