	/* include any js files here */
	
	// performs Ajax functions for staff contact details  
	include('http://www.ittralee.ie/en/contactPhp/myajax.js'); 
 	// performs hidden hide/drop down functions
 	include('http://www.ittralee.ie/en/javascript/ddaccordion.js');
 	include('http://www.ittralee.ie/en/javascript/jquery-1.2.2.pack.js');    
    

	
	
	//this function includes all necessary js files for the application  
function include(file)  
{  
	var script  = document.createElement('script');  
	script.src  = file;  
	script.type = 'text/javascript';  
	script.defer = true;  
	document.getElementsByTagName('head').item(0).appendChild(script);  
}  

// this adds a stylesheet
function includestyle(file){
	var script  = document.createElement('style');  
	script.src  = file;  
	script.type = 'text/css';  
	script.defer = true;  
	document.getElementsByTagName('head').item(0).appendChild(script);  
}
  		
/* Disable right click script 
<script language="JavaScript1.2" type="text/javascript">
*/
/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

var clickmessage="Copyright Control"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()

function getStaffDetailsByDept(department,thisDiv){
	dept = department.substr(0,4);
	processDept(dept,thisDiv);	
}


//Initialize:
ddaccordion.init({
	headerclass: "technology", //Shared CSS class name of headers group
	contentclass: "thelanguage", //Shared CSS class name of contents group
	collapseprev: false, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: false, //persist state of opened contents within browser session?
	toggleclass: ["closedlanguage", "openlanguage"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "<img src='http://www.ittralee.ie/en/javascript/plus.gif' /> ", "<img src='http://www.ittralee.ie/en/javascript/minus.gif' /> "], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal" //speed of animation: "fast", "normal", or "slow"
})

