
// change the base href of the current page to be that of the currently visited URL
//setbasehref(self.location.host);

// test to see if this is an oldcommunity address
if (self.location.host.indexOf('oldcommunity')!=-1) {
	// check to see if the browser is firefox
	
	if (navigator.userAgent.indexOf('Firefox')!=-1) {
		// it is firefox! so redirect to firefox handling page
		//self.location.href='http://www.oldcommunity.internetkit.co.uk/firefox.ikml';
	}
	// now add the meta robots tag if relevant
	addNoIndexMeta();
}

// function to change the basehref of a page
function setbasehref(basehref) { 

 var thebase = document.getElementsByTagName("base"); 
 thebase[0].href = 'http://'+basehref; 
 
} 

function addNoIndexMeta() {
	var meta;
	
	
	if (document.createElement && (meta = document.createElement('meta'))) {
	
		// set properties
		meta.name = "ROBOTS";
		meta.content = "NOINDEX, NOFOLLOW";
		// now add the meta element to the head
		document.getElementsByTagName('head').item(0).appendChild(meta);
	}
	
}

// function to preview an image - used in order prints upload page
function previewImage(fileName,winTitle,closePhrase) {
	if (fileName!="") {
		file=unescape(fileName);
		rep="\\";
		while (file.indexOf(rep)!=-1) { file=file.replace(rep,'/'); }
		myFloater = window.open("","","scrollbars,resizable,width=600,height=400")
		myFloater.document.write("<HTML><HEAD><BODY><TITLE>"+winTitle+"</TITLE></HEAD><DIV ALIGN=\"CENTER\">")
		myFloater.document.write("<IMG SRC=\""+file+"\" BORDER=\"0\">")
		myFloater.document.write("<br><br><a href=\"javascript:self.close()\">"+closePhrase+"</a>")
		myFloater.document.write("</DIV></BODY></HTML>")
	}
}


// splash screen delay functions
function redirect (delay) { 
	setTimeout("gonow()",delay); 
}

function gonow ()   { 
	window.location.replace('home.ikml');
}

function running(buttonname) {
	
	obj=document.getElementById(buttonname);
	obj.style.display='none';

	obj2=document.getElementById('runningtext');
	obj2.style.display='block';
	
	startBlink();
}
function doBlink() {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
  // Make sure it is IE4
  if (document.all)
    setInterval("doBlink()",750)
}
