var gtitle = null;

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}
var prefsLoaded = false;
var defaultFontSize = 76;
var currentFontSize = defaultFontSize;

function revertStyles(){

	currentFontSize = defaultFontSize;
	changeFontSize(0);

}

function changeFontSize(sizeDifference){
	currentFontSize = parseInt(currentFontSize) + parseInt(sizeDifference * 5);

	if(currentFontSize > 100){
		currentFontSize = 100;
	}else if(currentFontSize < 60){
		currentFontSize = 60;
	}
	setFontSize(currentFontSize);
};

function setFontSize(fontSize){
	var stObj = (document.getElementById) ? document.getElementById('content_area') : document.all('content_area');
	document.body.style.fontSize = fontSize + '%';
	createCookie("jxt_font", fontSize, 60);
};
function setUserOptions(){
	if(!prefsLoaded){

		cookie = readCookie("jxt_font");
		currentFontSize = cookie ? cookie : defaultFontSize;
		setFontSize(currentFontSize);		
		prefsLoaded = true;
	}
}
function saveSettings()
{
  var title = getActiveStyleSheet();
  createCookie("fontSize", currentFontSize, 365);
}
function showContent(elemName,imgName, imgExpanded, imgCollapsed) {
	if (document.all || document.getElementById) {
		if (elemName.style.display == '') {
			elemName.style.display = 'none';
			imgName.src = imgCollapsed;
		}
		else {
			elemName.style.display = '';
			imgName.src = imgExpanded;
		}
	}
}
function ChangeIt(pairs) 
{
	var objID = "";
	for(i=0;i<pairs.length/2;i++)
	{
		objID = pairs[i*2].replace(/^\s+|\s+$/g,"");
		document.getElementById(objID).innerHTML = pairs[i*2+1];
	}
}
function ChangeIt2(c,spliter) 
{
	var objID = "";
	var pairs = document.getElementById(c).innerHTML.split(spliter);
	for(i=0;i<pairs.length/2;i++)
	{
		objID = pairs[i*2].replace(/^\s+|\s+$/g,"");
		document.getElementById(objID).innerHTML = pairs[i*2+1];
	}
}
function ChangeIt3(c,spliter) 
{
	var objID = "";
	var pairs = document.getElementById(c).innerHTML.split(spliter);
	for(i=0;i<pairs.length/2;i++)
	{
		objID = pairs[i*2].replace(/^\s+|\s+$/g,"");
		var el = document.getElementById(objID);
		el.getElementsByTagName("span")[0].innerHTML = pairs[i*2+1];
	}
}
function ChangeIt4(c,spliter)
{
	var objID = "";
	var pairs = document.getElementById(c).innerHTML.split(spliter);
	for(i=0;i<pairs.length/2;i++)
	{
		objID = pairs[i*2].replace(/^\s+|\s+$/g,"");
		var el = document.getElementById(objID);
		el.style.backgroundColor = pairs[i*2+1];
	}
}
function SHDiv(name,container,action) 
{
	var dv = document.getElementById(name);
	var dvc = document.getElementById(container);

	if(action)
	{
		dvc.innerHTML = dv.innerHTML
	}
	else
	{
		dvc.innerHTML = '';
	}
}
function _1(n,p){document.write('<object height="270" width="361" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">');document.write('<param NAME="_cx" VALUE="9525" />');document.write('<param NAME="_cy" VALUE="7144" />');document.write('<param NAME="FlashVars" VALUE="" />');document.write('<param NAME="Movie" VALUE="http://www.ielts-exam.net/'+p+'s/'+n+'" />');document.write('<param NAME="Src" VALUE="http://www.ielts-exam.net/'+p+'s/'+n+'" />');document.write('<param NAME="WMode" VALUE="Window" />');document.write('<param NAME="Play" VALUE="-1" />');document.write('<param NAME="Loop" VALUE="-1" />');document.write('<param NAME="Quality" VALUE="High" />');document.write('<param NAME="SAlign" VALUE="" />');document.write('<param NAME="Menu" VALUE="-1" />');document.write('<param NAME="Base" value="" />');document.write('<param NAME="AllowScriptAccess" VALUE="" />');document.write('<param NAME="Scale" VALUE="ShowAll" />');document.write('<param NAME="DeviceFont" VALUE="0" />');document.write('<param NAME="EmbedMovie" VALUE="0" />');document.write('<param NAME="BGColor" VALUE="" />');document.write('<param NAME="SWRemote" VALUE="" />');document.write('<param NAME="MovieData" VALUE="" />');document.write('<param NAME="SeamlessTabbing" VALUE="1" />');document.write('<param NAME="Profile" VALUE="0" />');document.write('<param NAME="ProfileAddress" VALUE="" />');document.write('<param NAME="ProfilePort" VALUE="0" />');document.write('<param NAME="AllowNetworking" VALUE="all" />');document.write('<param NAME="AllowFullScreen" VALUE="false" />');document.write('<font size="1" face="Arial, Helvetica, sans-serif" color="#FFFFFF"><embed src="http://www.ielts-exam.net/'+p+'s/'+n+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="361" height="270"></embed></font>');document.write('</object>');}
function mms(what, id) {
    document.write('<object id="' + id + '" name="av" width="330" height="69" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"><PARAM name="url" value="mms://67.19.64.134/IELTS/' + what + '"><PARAM name="showControls" value="true"><PARAM name="showDisplay" value="false"><PARAM name="autoStart" value="false"><PARAM name="showStatusBar" value="true"><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" Name="av" src="mms://67.19.64.134/IELTS/' + what + '" AutoRewind="false" AutoStart="false" ShowStatusBar="true" ShowDisplay="false"  Volume="-1" stretchToFit="true" height="330" width="69"></embed></object><noembed><a href="mms://67.19.64.134/IELTS/' + what + '">Play the clip in Windows Media Player</a></noembed>');
}
function mmv(what,id){if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)){document.write('<style type="text/css">');document.write('body {overflow: auto;}');document.write('</style>');}if ( navigator.appName == "Netscape" ){navigator.plugins.refresh();}var fHasWMP=0;var ssit_bIsMac5=((navigator.appVersion.indexOf("Macintosh") != -1) && (navigator.appVersion.indexOf("MSIE 5") != -1));var ssit_bIsOpera=(navigator.userAgent.indexOf("Opera") != -1);if ((navigator.userAgent.indexOf("MSIE")<0 ) || (ssit_bIsMac5) || (ssit_bIsOpera)){numPlugins = navigator.plugins.length;for (ssit_i = 0; ssit_i < numPlugins; ssit_i++){plugin = navigator.plugins[ssit_i];if (plugin.name.substring(0,20)=="Windows Media Player"){fHasWMP=1;}}}if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1) && (!ssit_bIsOpera)){document.writeln(' <script language="VBScript">  ');document.writeln(' on error resume next ');document.writeln(' fHasWMP2 =(NOT IsNull(CreateObject("MediaPlayer.MediaPlayer.1")))');document.writeln(' <\/script> ');}else fHasWMP2 = 0;var ssit_bIsMac = ((navigator.appVersion.indexOf("Macintosh") != -1) && ((navigator.appVersion.indexOf("MSIE") != -1) && (!ssit_bIsMac5)));if (fHasWMP || fHasWMP2){document.write ('<object id="'+id+'" name="av" width="330" height="245" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"><param name="FileName" value="mms://67.19.64.134/IELTS/'+what+'"><param name="ShowControls" value="1"><param name="ShowDisplay" value="0"><param name="AutoStart" value="0"><param name="ShowStatusBar" value="1"><embed type="application/x-mplayer2" src="mms://67.19.64.134/IELTS/'+what+'" id="'+id+'" name="av" ShowControls=1 ShowDisplay=0 AutoStart=0 ShowStatusBar=1 width="330" height="245"></embed></object><noembed><a href="mms://67.19.64.134/IELTS/'+what+'">Play the clip in Windows Media Player</a></noembed></object>');}else {document.write('<div class="downloadaudioPrompt" align="left"><font size="1"><b>This clip requires Windows Media Player.<br><br>');document.write('To download or upgrade your Windows Media Player for free, visit the <a href="http://www.microsoft.com/windows/windowsmedia/download/default.asp" class="downloadLink">Windows Media download</a> page<br><br>');document.write('Alternatively you can try to <a href="mms://67.19.64.134/IELTS/'+what+'" class="downloadLink">play the clip in the standalone player</a>.</b></font></div>');}}