function initXmlHttp(){try{xmlHttp=new XMLHttpRequest();xmlHttp.overrideMimeType("text/html");}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){return;}}}return xmlHttp;}
function ajaxCall(divId, url) {
	var div = document.getElementById(divId);
	if (div == null){return;}
	var xmlHttp = initXmlHttp();
	prepareXmlHttp(xmlHttp, div);
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
function prepareXmlHttp(xmlHttp, div) {
	div.innerHTML="<img src='/images/ajax-loader.gif' alt='Loading - please wait' class='loader' />";
	xmlHttp.onreadystatechange = function(){if (xmlHttp.readyState == 4) {
		div.innerHTML = xmlHttp.responseText;
		if (document.c && document.c.but) document.c.but.disabled=false;
		if (document.f && document.f.s) document.f.s.disabled=false;
	}}
}

function bookmarksite(title, url) {
	if (window.sidebar) window.sidebar.addPanel(title, url,"");
	else window.external.AddFavorite(url, title);
}


function getPages() {
	return Array("overview", "description", "outline", "discounts", "whatyouget", "guarantee", "enquire");
}

function coursePage(id, page) {
	setPageContent(id, page);
	var pages = getPages();
	for (var i = 0; i < pages.length; i++) {
		document.getElementById("tab_" + pages[i] + "_" + id).style.backgroundImage = "";
		document.getElementById("tab_" + pages[i] + "_" + id).style.color = '#FFFFFF';
	}
	var tab = document.getElementById("tab_" + page + "_" + id);
	tab.style.color='#5A5A5A';
	tab.style.backgroundImage= "url('/images/course_outline_box/tab-hover.gif')";
	for (var i = 0; i < pages.length; i++) {
		var p = pages[i];
		document.getElementById(p + "_" + id).style.display = (p==page) ? "":"none";
	}
}

function setPageContent(id, page) {
	if (page == "guarantee") setGuaranteePageContent(id);
	if (page == "discounts") setDiscountsPageContent(id);
	if (page == "whatyouget") setWhatYouGetPageContent(id);
}

function setDiscountsPageContent(id) {
	document.getElementById("discounts1_" + id).innerHTML = "<p>At Academy Class, we strive to provide you with high quality training at \"value for money\" prices. Academy Class has launched some very special and unique training savings plans for its customers. The savings make Academy Class's training courses for creative's and developers more affordable and flexible for a wider range of organisations and individuals.</p>";
	document.getElementById("discounts2_" + id).innerHTML = "<p><strong>Book in Advance and Get an Early Bird Discount with 30% Off Standard Price*</strong><br/>We've looked at the airlines and this seems to work for them so why not training? Book any Academy Class course 3 months in advance and we'll give you this for 30% less than the standard price.</p><p><strong class='terms'>*(20% off Jumpstart courses. Cannot be used on top of any other discount / offer or with ANY Creative License Package or Off Peak classes)</strong></p><p><strong>Group bookings</strong><br/>Discounts apply to bookings of two or more people from one organisation: 10% off for two people, 15% for three etc.</p>";
	document.getElementById("discounts3_" + id).innerHTML = "<p><strong>Training Vouchers</strong><br />Academy Class vouchers are an effective way to save on your training costs, ensuring the maximum benefit from all training investment. Designed to suit an organisation's long-term training needs, Vouchers are an excellent opportunity.</p><p><strong>Education, Charity &amp; Freelance Discounts</strong><br />If you work for a charity, educational establishment or work freelance or an independent basis, and are funding your training yourself, you can claim a 15%*discount on any of our open courses. <span class='terms'>*(cannot be used on top of any other discount / offer or with any Creative License Package or Off-Peak classes)</span></p>";
}

function setGuaranteePageContent(id) {
	document.getElementById("guarantee1_" + id).innerHTML = "<h3>The Academy Class Guarantee</h3><p>Did you know that Academy Class is also 100% committed to ensuring you understand the concepts we teach in all our classroom-based courses and that you have met the course objectives? We understand that you rely on us to get a good grasp the key concepts taught in our training.  We also realise that if you don't fully understand the content when you leave, the money and time you'd spend repeating the same course is a cost your business could do without. We believe that our high-quality training courses will meet and exceed your expectations and enable you learn the concepts you need to know, first time. And we want you to be confident that we'll support you through your learning experience by proving our commitment to delivering a high-quality &amp; easily-understood course. That's why we've introduced the Academy Class Guarantee.</p><h3>Here's How it Works</h3><p>We make an upfront commitment to you that you'll be comfortable with what you learn in our classes. If you don't feel that you've grasped the concepts and can put the training into practice, we invite you to repeat the same course within a 6 month period absolutely free of charge*. Academy Class's Guarantee, means you can rest assured that if you're</p>";
	document.getElementById("guarantee2_" + id).innerHTML = "<p>Still uncertain about what you've learned, you can come back free of charge* and sit the class again. It's that simple.</p><h3>Want to know more about the Academy Class Guarantee?</h3><p>To find out more about our training courses or the Academy Class Guarantee, contact us on 0800 0438889.</p><h3>*Academy Class Guarantee Terms and Conditions</h3><p>Guarantee offer is only made to the original person attending a Academy Class classroom training course and is not transferable. Attendees returning for a repeat sitting of a course must bring their original manual and materials for use on the day. Bookings for a repeat sitting of a classroom course must be made via the Academy Class Hotline 0800 0438889 and are subject to availability. Guarantee offer is valid for 6 months from the date of the original classroom course, after which date it becomes null and void. Students should be aware that there is always a chance that they will be “bumped” into the next class if it were to fill up with paying students. Even if you are bumped, we do guarantee that you will be afforded 1 retake of your training class.</p>";
}

function setWhatYouGetPageContent(id) {
	document.getElementById("whatyouget1_" + id).innerHTML = "<h3>Here's what you get on an Academy Class</h3><p><strong>Course Materials</strong><br />We typically supply detailed course notes or a reference text or in some cases both. Either way, we try to provide sufficient supporting material so that you can return to your work place with sufficient confidence to permit further learning. Catering</p><p><strong>We like to look after our customers with:</strong><br />Luncheon Vouchers so you can get lunch of your choice at one of the local cafes. Fresh fruit Posh coffee and tea and good biscuits Sweets - sugar and spice and all things nice Chilled water</p><p><strong>90 DAY Support</strong><br />There's nothing worse than leaving a course and feeling left on your own. We like to ensure our customers have all the support and backup they need including: 90 days unlimited support by phone, or email A free re-sit of this course on any scheduled date in the future</p>";	
}

function toggleDates(town, id, page) {
	var d = document.getElementById(town + "_" + id + "_" + page);
	d.style.display=(d.style.display=="none")?"":"none";
}

function highlightTab(tab, id) {
	var pages = getPages();
	for (var i = 0; i < pages.length; i++) {
		var t = document.getElementById("tab_" + pages[i] + "_" + id);
		if (pages[i] == tab) {
			t.style.background="url('/images/course_outline_box/tab-hover.gif') repeat-x";
			t.style.color="#5A5A5A";
		} else {
			t.style.backgroundImage = "";
			t.style.color = '#FFFFFF';
		}
	}
}

function submitSearch(e) {
	var code;
	if (!e) var e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	if (code == 13) run_search();
}
function run_search() {
	document.location="/search?q=" + escape(document.getElementById("searchbox").value);
}

function currentEvents() {
	document.getElementById("events_current").style.display="";
	document.getElementById("events_expired").style.display="none";
}
function expiredEvents() {
	document.getElementById("events_current").style.display="none";
	document.getElementById("events_expired").style.display="";
}

function submitSubscription(e) {
	var code;
	if (!e) var e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	if (code == 13) subscribe();
}

function subscribe() {
	var name = document.getElementById("txtName").value;
	var email = document.getElementById("txtEmail").value;
	var url = "/newsletter_subscribe?name=" + escape(name) + "&email=" + escape(email);
	ajaxCall("subscribe_result", url);
}

function livechat_window() {
	var newWindow=window.open('http://livechat.boldchat.com/aid/5003711352951458688/bc.chat?url=' + escape(document.location.href), 'Chat', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480');
	newWindow.focus();
	newWindow.opener=window;
}

function enquire_now(id) {
	var name = document.getElementById("name_" + id).value;
	var email = document.getElementById("email_" + id).value;
	var enquiry = document.getElementById("enquiry_" + id).value;
	var phone = document.getElementById("phone_" + id).value;
	var location = document.getElementById("location_" + id).value;
	var enquire_all = document.getElementById("enquire_all_" + id).checked;
	var url = "/course_enquire?course=" + id + "&name=" + escape(name) + "&email=" + escape(email) + "&enquiry=" + escape(enquiry) + "&phone="+escape(phone)+"&location="+escape(location);
	if (enquire_all) url += "&enquire_all=" + enquire_all;
	ajaxCall("enquire_result_" + id, url);
}
