window.onresize= showWH;

function lightSub(obj,bool){
	try{
	if(bool){
		try{
			obj.style.cursor = "hand";
		}
		catch(e){}
		obj.style.color = "#FFFFFF";
		obj.style.backgroundColor = "#85AFD6";
	}
	else{
		try{
			obj.style.cursor = "pointer";
		}
		catch(e){}
		obj.style.color = "#000000";
		obj.style.backgroundColor = "#669BCC";
	}
	}catch(e){
	//alert(e.description)	
	}
}
function showWH(){
	try{
	h= screen.availHeight || screen.Height;
	w= screen.availWidth || screen.Width;


	cW=document.body.offsetWidth;
	cH=document.body.offsetHeight;

	w = cW;

	obj = document.getElementById("floated_dots");

	padding = 0 ;

	try{
		obj.style.width = w + "px";
	}
	catch(e){

		obj = document.getElementById("floated_dots_general");
		//obj.style.width = w + "px";
	}
	}catch(e){
	//alert(e.description)	
	}
}

function changeColour(obj,bool){
	try{
	if(bool){
		obj.style.backgroundColor = "#FFFFFF";
	}
	else{
		if (obj.name.indexOf("head_search") == -1)
		{
			obj.style.backgroundColor = "#DCECFA";
		}
		else{
			obj.style.backgroundColor = "#B3CDE6";
		}
	}
	}catch(e){
	//alert(e.description)	
	}
}

var bColor;
var bImage;

function changeMenuClass(obj,bool){
	try{
	objChild = obj.getElementsByTagName("a");
	objA = objChild[0];
	if(bool){
			
		bColor = obj.style.backgroundColor;
		bImage = obj.style.backgroundImage;

		try{
			obj.style.cursor = "hand";
		}
		catch(e){}
		obj.style.backgroundColor = "#FFFFFF";
		obj.style.backgroundImage = "url(images/furniture/icons/arrow_right_side_grey.gif)";
		objA.style.color = "#707579";
	}
	else{
		try{
			obj.style.cursor = "pointer";
		}
		catch(e){}
		obj.style.backgroundColor = bColor //"#E3E5E7";
		obj.style.backgroundImage = bImage //"url(images/furniture/icons/arrow_right_side.gif)"
		objA.style.color = "#000000";
	}
	}catch(e){
	//alert(e.description)	
	}
}

function highLightSearch(obj,bool){
	try{
	objChild = obj.getElementsByTagName("a");
	objA = objChild[0];

	if(bool){
		try{
			obj.style.cursor = "hand";
		}
		catch(e){}
		obj.style.backgroundColor = "#DFE7ED";
		objA.style.textDecoration = "underline";
	}
	else{
		try{
			obj.style.cursor = "pointer";
		}
		catch(e){}
		obj.style.backgroundColor = "#F4F5F5";
		objA.style.textDecoration = "none";
	}
	}catch(e){
	//alert(e.description)	
	}
}

function highLightFAQ(obj,bool){
	try{
	objChild = obj.getElementsByTagName("li");
	objLI = objChild[0];

	if(bool){
		obj.style.backgroundColor = "#DFE7ED";
		objLI.style.color = "#F5822A";
		objLI.style.listStyleImage = "url(images/furniture/icons/arrow_right_orange_nopad.gif)";

	}
	else{
		obj.style.backgroundColor = "#F4F5F5";
		objLI.style.color = "#002E57";
		objLI.style.listStyleImage = "url(images/furniture/icons/arrow_right_blue.gif)";
	}
	}catch(e){
	//alert(e.description)	
	}
}
function highLightCourse(obj,bool){
	try{
	objChild = obj.getElementsByTagName("li");
	objLI = objChild[0];
	objChild = obj.getElementsByTagName("span");
	objSpan = objChild[0];

	if(bool){
		try{
			obj.style.cursor = "hand"
		}
		catch(e){}
		obj.style.backgroundColor = "#DFE7ED";
		objSpan.className = "blue_title_underline_courses";
	}
	else{
		try{
			obj.style.cursor = "pointer";
		}
		catch(e){}
		obj.style.backgroundColor = "#F4F5F5";
		objSpan.className = "orange_title";
	}
	}catch(e){
	//alert(e.description)	
	}
}
function highLightCourseFeatured(obj,bool){
	try{
	objChild = obj.getElementsByTagName("li");
	objLI = objChild[0];

	if(bool){
		obj.style.backgroundColor = "#002E57";
	}
	else{
		obj.style.backgroundColor = "#2E4E6B";
	}
	}catch(e){
	//alert(e.description)	
	}
}
function highLightDownload(obj,bool){
	try{
	objChild = obj.getElementsByTagName("li");
	objLI = objChild[0];
	objChild = obj.getElementsByTagName("span");
	objSpan = objChild[0];

	if(bool){
		try{
			obj.style.cursor = "hand";
		}
		catch(e){}
		obj.style.backgroundColor = "#DFE7ED";
		objLI.style.color = "#F5822A";
		objLI.style.listStyleImage = "url(images/furniture/icons/arrow_right_nopad.gif)";
		objSpan.className = "blue_title_underline";
	}
	else{
		try{
			obj.style.cursor = "pointer";
		}
		catch(e){}
		obj.style.backgroundColor = "#F4F5F5";
		objLI.style.color = "#002E57";
		objLI.style.listStyleImage = "url(images/furniture/icons/arrow_right_orange_nopad.gif)";
		objSpan.className = "orange_title";
	}
	}catch(e){
	//alert(e.description)	
	}
}
function highLightLink(obj,bool){
	try{
	objChild = obj.getElementsByTagName("li");
	objLI = objChild[0];
	objChild = obj.getElementsByTagName("span");
	objSpan = objChild[0];

	if(bool){
/*		try{
			obj.style.cursor = "hand"
		}
		catch(e){}*/
		obj.style.backgroundColor = "#DFE7ED";
		objLI.style.color = "#F5822A";
		objSpan.className = "blue_title_underline";
	}
	else{
		/*try{
			obj.style.cursor = "pointer"
		}
		catch(e){}*/
		obj.style.backgroundColor = "#F4F5F5";
		objLI.style.color = "#002E57";
		objSpan.className = "orange_title";
	}
	}catch(e){
	//alert(e.description)	
	}
}

var imgClass ;
var lstObj ;
function showImage(obj,bool){

	try{
	objChild = obj.getElementsByTagName("img");
	objImg = objChild[0];

	if(typeof(lstObj) != "object"){
		lstObj = objImg;
	}
	else{
		if(lstObj != objImg)
		lstObj.className;
		switch(imgClassNow){
			case "left":
				newClass = "left_opaque";
				break;
			case "none":
				newClass = "opaque";
				break;
			case "right":
				newClass = "right_opaque";
				break;
		}
			lstObj.className = newClass;
			lstObj = objImg;
	}

	objChild = obj.getElementsByTagName("div");
	objSpan = objChild[1];

	objChild = obj.getElementsByTagName("a");
	objAnchor = objChild[0];

	imgClassNow  = objImg.className;
	switch(imgClassNow){
		case "left_opaque":
			newClass = "left";
			break;
		case "opaque":
			newClass = "none";
			break;
		case "right_opaque":
			newClass = "right";
			break;
	}


	if(bool){
		try{
			obj.style.cursor = "hand";
		}
		catch(e){}
		objSpan.style.color = "#000000";
		objAnchor.style.color = "#F5822A";
		objAnchor.style.textDecoration = "underline";
		objImg.className = newClass;
		objImg.style.border = "1px solid #000000";
		imgClass = imgClassNow;
	}
	else{
		try{
			obj.style.cursor = "pointer";
		}
		catch(e){}
		objSpan.style.color = "#9EA6B2";
		objImg.className = imgClass;
		objAnchor.style.color = "#000000";
		objAnchor.style.textDecoration = "none";
		imgClass = "";
	}
	}catch(e){
	//alert(e.description)	
	}
}

function loadFAQ(){
	args = loadFAQ.arguments;
	if(args.length > 1){
		window.open(args[0],"Link");
	}
	else{
		window.location.replace(args[0]);
	}
}
function loadCase(url){
	window.location.replace(url);
}
function loadDownload(){
	args = loadDownload.arguments;
	if(args.length > 1){
		window.open(args[0],"Link");
	}
	else{
		window.location.replace(args[0]);
	}
}
var downloadWin;
function loadPage(obj){
	try{
		objChild = obj.getElementsByTagName("a");
		objA = objChild[0];
		if(objA.href.toString().indexOf("image") != -1){
			downloadWin = window.open("downloadImage.asp?uri=" + objA.href,"image_win","width=250, height=120");
			downloadWin.focus();
			//setTimeout("closeWin()",3000);
		}
		else{
			window.location.href = objA.href;
		}
	}
	catch(e){
		alert(e.description);
	}
}
function closeWin(){

	if(confirm("Close download window")){
		downloadWin.close();
	}
}
function loadURL(){
	objChild = document.getElementsByTagName("select");
	url = "";
	for(t=0;t<objChild.length;t++){
		for(p=0;p<objChild[t].options.length;p++){
			if(objChild[t].options[p].selected == true){
				if(objChild[t].options[p].value.indexOf(".asp") == -1 && objChild[t].options[p].value != 0 ){
					url = url + "&cat=" + objChild[t].options[p].value;
				}
				else if(objChild[t].options[p].value != 0 ){
					url = url +  objChild[t].options[p].value;
				}
			}
		}
	}
	pUrl=window.location;
	if(url.indexOf("asp") == -1){
		try{
			if(pUrl.toString().indexOf("&") != -1){
				pUrl = pUrl.toString().substring(0,pUrl.toString().indexOf("&"));
			}
		}
		catch(e){
			alert(e.description);
		}
		url = pUrl + url;
	}
	window.location.replace(url);
}

function swapPage(url){
	//window.location.replace(url);
}

function alertSize() {

  var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
}

function totalAttendeeCost(form,noAttendees) {
	tmp = 0;
	for (i=1;i<=noAttendees;i++) {
		tmp += parseInt(form['AttendeePriceBand'+i].value);
	}
	form.total.value = tmp;
}

