//from HEAD

function MM_preloadImages() { 
  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() { 
  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) { 
  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() { 
  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];}
}

function openpopup(theURL,winName,features) { 
  var x = window.open(theURL,winName,features);
  x.focus();
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function doSitePopup(externalURL){
	   window.open(externalURL,'externalpage');
	   MM_openBrWindow('/linkpop.html','externallink','width=250,height=150');
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function jumpTo(targ,selObj,restore){ //v3.0
//  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  window.open(selObj.options[selObj.selectedIndex].value,'_blank','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=517,height=500');
  if (restore) selObj.selectedIndex=0;
}
function popUpSummary()
{
window.open ('login_revenueSummary.htm', '_blank','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=1000,height=500')
}
function popUpMotorola(){window.open ('login_Motorola.htm', '_blank','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=720,height=300')}




///////////////////////////////////////////////////////////////////////////FAQ - General

// define the different tip categories
var cat1 = "";
var cat2 = "";
var cat3 = "";
var cat4 = "";
var cat5 = "";
var cat6 = "";
var cat7 = "";
var cat8 = "";
var cat9 = "";
var cat10 = "";
var cat11 = "";
var cat12 = "";
var cat13 = "";
var cat14 = "";
		
// and their  hyperlinks
var cat1url = "";
var cat2url = "";
var cat3url = "";
var cat4url = "";
var cat5url = "";
var cat6url = "";
var cat7url = "";
var cat8url = "";
var cat9url = "";
var cat10url = "";
var cat11url = "";
var cat12url = "";
var cat13url = "";
var cat14url = "";

// and the blurb for linking through
var cat1blurb = "";
var cat2blurb = "";
var cat3blurb = "";
var cat4blurb = "";
var cat5blurb = "";
var cat6blurb = "";
var cat7blurb = "";
var cat8blurb = "";	
var cat9blurb = "";	
var cat10blurb = "";	
var cat11blurb = "";	
var cat12blurb = "";	
var cat13blurb = "";	
var cat14blurb = "";	

/*
	array containing content for questions & answers. [0] = question [1] = answer
	(all strings should have special characters escaped)
*/		

var recenttips = new Array (
 ["What is the age requirement for entry to MPYO?","You must be a Malaysian citizen living in Malaysia who is, or will be between 14 to 26 years old as at 1 January 2006. However, exceptions to the age requirement may be made at the discretion of MPYO.",4],
 ["Do I have to acquire ABRSM Grade 6 distinction or equivalent before I apply?","No. It is not compulsory for applicants to have acquired the grade as long as the applicants can perform in the audition to a comparable standard.", 4],
 ["How much does it cost to audition?","There is no audition fee for MPYO. However, you must attend your scheduled audition at your own expense.", 4],
 ["Do I have to pay to join MPYO?","If you are selected for MPYO, there is a one-time, non-refundable registration fee of RM250 for each member per season, payable upon your acceptance of a position in MPYO.<br><br>For rehearsals, MPYO will pay minimum travel expenses to and from Kuala Lumpur amounting to:<br>KL and Klang Valley - Return bus fare<br>Peninsular Malaysia - Return bus fare<br>Sabah and Sarawak - Return airfare<br><br>However, you will be expected to find and pay for your own accommodation in KL.<br><br>MPYO will cover the cost of travel, accommodation and meals for tours and music camps.",4]
 );

/*
	function to display the answers content and toggle any
	previously visible answer to hidden.
*/	
var active = null;
function toggleanswer(num)
{
	var answer = document.getElementById("a"+num);
	if(answer.style.display == "inline")
	{
		answer.style.display = "none"
		document.getElementById("arrow"+num).src = "images/img_arrow_up.jpg";
		active = null;				
	}
	else	
	{
		answer.style.display = "inline";
		document.getElementById("arrow"+num).src = "images/img_arrow_down.jpg";
		(active!=null) ? toggleanswer(active) : void(null);
		active = num;
	}
}	

/*
	function to take question & answers content from an array and build
	html elements, returns code string
*/
function maketips(obj)
{
	var code = "";			
	var j = 0;
	if(testos.indexOf("mac")==-1 && !document.layers)
	{
		for(i=0; i<obj.length; i++)
		{
			j = i + 1;
			code += "<div id=\"question\">";
			code += "	<span class=\"arrow\"><img src=\"images/img_arrow_up.jpg\" width=\"16\" height=\"18\" border=\"0\" id=\"arrow" + j + "\"></span>";
			code += "	<span class=\"question\"><a href=\"javascript:toggleanswer(" + j + ")\">" + obj[i][0] + "</a><br></span>";
			code += "	<span class=\"answer\" id=\"a" + j + "\">" + obj[i][1];
			(eval("cat"+obj[i][2]+"blurb")!=null) ? code += "<br>" + eval("cat"+obj[i][2]+"blurb") +"&nbsp;</span>" : code += "</span>";
			code += "</div><br>";
		}
	}
	else if(document.all || document.layers)
	{
		var linkcode;
		code += "<table border=\"0\" width=\"600px\" cellpadding=\"0\" cellspacing=\"0\">";
		for(i=0; i<obj.length; i++)				
		{
			j = i + 1;
			if(!document.layers)
				linkcode = "<a href=\"javascript:toggleanswer(" + j + ")\">";										
			else
				linkcode = "<a href=\"/protected/expert/" + eval("cat"+obj[i][2]+"url") + "#tip" + j + "\">";										
				
			// the question hyperlink
			code += "<tr class=\"question\">";
			code +=	"	<td width=\"10\"><img src=\"images/img_arrow_up.jpg\" id=\"arrow" + j + "\" width=\"16\" height=\"18\" alt=\"\" border=\"0\"></td>";
			code += " <td width=\"598\">" + linkcode + obj[i][0] + "</a></td>";
			code += "</tr>";					
			// and the answer (if NOT netscape 4.x)
			if(!document.layers)
			{
				code +=	"<tr class=\"answer\" id=\"a" + j + "\">";
				code +=	"<td width=\"20\"><img src=\"/images/spacer.gif\" width=\"12\" height=\"1\"></td>";
				code +=	"<td width=\"598\"><span class=\"answertext\">" + obj[i][1];
				(eval("cat"+obj[i][2]+"blurb")!=null) ? code += "<br>" + eval("cat"+obj[i][2]+"blurb") +"&nbsp;</span></td>" : code += "<br><br></span></td>";			
				code +=	"</tr>";
			}
			// and a blank row
			//code += "<tr class=\"gap\">";
			//code += "<td><img src=\"/images/assets/spacer.gif\" width=\"20\" height=\"1\"></td>";
			//code += "<td><img src=\"/images/assets/spacer.gif\" width=\"100\" height=\"1\"></td>";
			//code += "</tr>";													
		}
		code += "</table>";
	}
	else if(document.getElementById)
	{
		for(i=0; i<obj.length; i++)
		{
			j = i + 1;
			code += "<div id=\"question\">";
			code += "	<span class=\"arrow\"><img src=\"images/img_arrow_up.jpg\" width=\"5\" height=\"12\" border=\"0\" id=\"arrow" + j + "\"></span>";
			code += "	<span class=\"question\"><a href=\"javascript:toggleanswer(" + j + ")\">" + obj[i][0] + "</a></span>";
			code += "	<span class=\"answer\" id=\"a" + j + "\">" + obj[i][1];
			(eval("cat"+obj[i][2]+"blurb")!=null) ? code += "<br>" + eval("cat"+obj[i][2]+"blurb") +"&nbsp;</span>" : code += "<br><br></span>";	
			code += "</div>";
		}
	}
				
	return code;
}		

var testos = navigator.platform.toLowerCase();

// create the different CSS code needed for each platform		

// pc ie, mozilla, netscape 6.x mac/pc
var domcss = "<style type=\"text/css\">\n";
domcss += "div#question { border-bottom:0px solid silver; width:500px; padding-top:0px;padding-bottom:0px; }\n";
domcss += "div span { font-family:tahoma,verdana; font-size:11px; color:#4f4f4f;}\n";
domcss += "div span.arrow { float:left; width:25px; }\n";
domcss += "div span.question a { position:relative; font-weight:bold; color:#5AA62E; text-decoration:underline; display:block}\n";
domcss += "div span.question a:hover { text-decoration:underline; }\n";
domcss += "div span.answer { position:relative; padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; width:100%; display:none; }\n";
domcss += "div span.answer a { color:#4f4f4f;font-weight:bold }\n";
domcss += "div span.answer a:hover { text-decoration:none; }\n";
domcss += "div hr { color:#ededed; }\n";
domcss += "</style>";

// netscape 4.x
var ns4css = "<style type=\"text/css\">\n";
ns4css    += "td { font-family:verdana; font-size:11pt }\n";	
ns4css    += "td a { color: #4f4f4f }\n";		
ns4css    += "</style>";

// mac ie
var maccss = "<style type=\"text/css\">\n";
maccss    += "td {  text-align:left; font-family:verdana; font-size:9pt; }\n";	
maccss	  += "tr.question a { text-align:left; text-decoration:none; font-weight:bold; color:#5A9943; }\n";
maccss    += "tr.question a:hover { text-decoration:underline }\n";
maccss    += "tr.answer { display:none; }\n";
maccss    += "tr.gap { border-top:1px solid #4f4f4f; margin-bottom:4px };\n";
maccss    += "</style>";

// insert the appropriate css code
(testos.indexOf("mac")!=-1) ? ((document.all) ? document.write(maccss) : document.write(domcss)) : ((document.layers) ? document.write(ns4css) : document.write(domcss));
if(document.getElementById && !document.all)
	document.write("<style>span.question a { left:15px }</style>");	
	
///////////////////////////////////////////////////////////////////////////end      FAQ - General
