﻿


function showWindow(p1, p2, p3, p4)
 {
 	var header= "Main representative person for";
 	var Company = p1 + ":";
 	var JobTitle = p2;
 	var Name = p3;
 	var Link = 'Website: '+p4;

 	//alert(p1+' ' + p2 + ' '+ p3);
 	alert (header + ' ' +Company + '\n' + Name + ' - ' + JobTitle + '\n' + Link);
 }


function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible";
}
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden";
}


function ShowText(id) {
document.getElementById(id).style.display = 'block';
}
function HideText(id) {
document.getElementById(id).style.display = 'none';
}


// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 6000

// Duration of crossfade (seconds)
var crossFadeDuration = 4

// Specify the image files
var Pic = new Array()

Pic[0] = 'slides/p1.jpg'
Pic[1] = 'slides/p2.jpg'
Pic[2] = 'slides/p3.jpg'
Pic[3] = 'slides/p4.jpg'
Pic[4] = 'slides/p5.jpg'
Pic[5] = 'slides/p6.jpg'
Pic[6] = 'slides/p7.jpg'
Pic[7] = 'slides/p8.jpg'
Pic[8] = 'slides/p9.jpg'
Pic[9] = 'slides/p10.jpg'







var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function setLinkColor(linkColor) {
	links = document.links;

	pageLocation = document.location.href;

	queryPos =pageLocation.indexOf("?");
	if (queryPos > -1) pageLocation=pageLocation.substr(0,queryPos);

	pageLocation = pageLocation.replace('eventsdetails.php','events.php')
	pageLocation = pageLocation.replace('pasteventsdetailsknowledge.php','pasteventsknowledge.php')


		//test if we are displaying a path of the form www.mysite.com/folder/
		dotPos 	  =pageLocation.lastIndexOf(".") 		//get the location of last dot
		dotString =pageLocation.substr(dotPos) 		//get the string from the dot onwards
		htmTest =(dotString.indexOf(".htm")>-1); 	//this one also covers .html
		phpTest =(dotString.indexOf(".php")>-1);

	if (htmTest || phpTest) {
		bIndexPage=false;
	} else {
		bIndexPage=true; //this means there is no file name displayed in the page location
	}

	for (i=0;i<links.length;i++) {
		if (links[i].name == "modLink") {
			linkURL = links[i].href;
			bSetLink = false;

			if (bIndexPage) {
				dotPos = linkURL.lastIndexOf(".");
				lastSlashPos = linkURL.lastIndexOf("/");
				pageNoExt = linkURL.substring(lastSlashPos+1,dotPos); //store the link page without the file extension
				pageNoExt = pageNoExt.toLowerCase() //convert to lower case just to be sure

				if (pageNoExt == "index") bSetLink=true;

			} else {

				if (pageLocation==linkURL) bSetLink=true;
			}

			if (bSetLink) {
				links[i].style.color = linkColor;
				break;
			}
		}
	}

}

function openWin(url) {
	window.open(url,null,"width=350,height=200,left=500,top=500,toolbar=no,location=no,status=no,resizable=no,scrollbars=no");
}


function CloseWindow() { 
	window.close()
}

