/* Learning Objects Popup Help Code v1.01
Property of Southbank Institute of Technology 2008
Developed by Jeremy Ryan
last modified date 8/2/2010
*/
var entitynum=-1;
var matchresult="";
var wantedlist=new Array(/Library Catalogue Search\b/g,/Advanced Catalogue Search/g);
var niceName=new Array("LO:Basic Library Catalogue Search","LO:Advanced Catalogue Search")
var matchlist=new Array("td","div");
var urllist=new Array("http://digibank.southbank.edu.au/learning/items/aa914016-c1f2-5257-84ec-f7bb55ae5c28/1/Basic%20Catalogue%20Search.zip/Basic%20Catalogue%20Search/Basic%20Catalogue%20Search.htm?preview=true")
function popuplaunch(){
	for(i=0;i<matchlist.length;i++){
		matchtags=document.getElementsByTagName(matchlist[i]);
		for(j=0;j<matchtags.length;j++){			
			if(matchtags[j].innerHTML.match(wantedlist[i])){
				matchresult=matchtags[j];
				entitynum=i
			}
		}
		if(matchresult!=""){
			break;
		}
	}
	if(urllist[entitynum]){
		createbutton(entitynum);
	}
}
function createbutton(buttontype){
	var helpicon=document.createElement("img");
	helpicon.src="/rooms/documents/html/allfacs/locator/playarrow_r4_c2.gif";
	helpicon.style.paddingLeft="4px";
	helpicon.style.marginBottom="-1px";
	var helpbutton=document.createElement("span")
	helpbutton.name="popuphelp";
	helpbutton.id="popuphelp";
	helpbutton.style.backgroundColor="#983E3E";
	helpbutton.style.color="#FFFFFF";
	helpbutton.style.fontWeight="bold";
	helpbutton.style.fontSize=".7em";
	helpbutton.style.padding="2px 5px 2px 6";
	helpbutton.style.border="2px outset #FFFFFF";
	helpbutton.style.marginLeft="40px";
	helpbutton.style.position="relative";
	helpbutton.appendChild(document.createTextNode("Show me how"))
	helpbutton.appendChild(helpicon)
	helpbutton.onmouseover= function() {helpbutton.style.cursor='default'};
	try{
		helpbutton.addEventListener("click",showhelp,false);
	}
	catch(e){
		helpbutton.setAttribute('onclick',showhelp)
	}
	matchresult.appendChild(helpbutton)
}
function showhelp(){
	if(entitynum!=-1){
		pageTracker._trackPageview(niceName[entitynum]);
		window.open(urllist[entitynum],"Tutorial","resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=no,width=840,height=686");
	}
}
// change layout on HighDPI screens when IE not scaling
/*function fnScaleManually(){
	// normal DPI		
	var constNorm = 96; 
	// scaling is off and DPI higher than normal
	if ((screen.deviceXDPI == screen.logicalXDPI)&&(screen.deviceXDPI > constNorm)){									
		document.body.style.zoom = 
		constNorm / screen.logicalXDPI;
	}
}
if(navigator.appName=="Microsoft Internet Explorer"){
	try{
		//document.body.style.zoom =.6;
		//fnScaleManually()
	}
	catch(e){
	//do nothing	
	}
}*/