function writeNews(num){
setTimeout("printer()",num); 
}
function notebook()
	{
	self.name = "main"; 
	url="http://www.eluk.co.uk/my_notes.php";
window.open(url , 'remote' , 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=270,height=350,left=10,top=350');//var 
	}
function radio(e_track,title,artist,when,bandurl)
	{
	self.name = "main_site";
	url="http://www.eluk.co.uk/radiostandalone.php?track="+e_track+"&title="+title+"&artist="+artist+"&when="+when+"&bandurl="+bandurl;
	window.open(url , 'popup' , 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=370,height=102');//var 
	}
var thisurl=document.location.href;
function showMe(obj, a){
//showMe(this, 'divName')
  var e=document.getElementById(a);
  if(!e)return true;
    e.style.display="block"
  return true;
}

function hideMe(obj, a){
//hideMe(this, 'divName')
  var e=document.getElementById(a);
  if(!e)return true;
    e.style.display="none"
  return true;
}

function ilink(name,url,colour)
	{
	dispurl=url.replace("http://www.","")
	fname = dispurl
	sname = fname.split("?")
	dispurl=sname[0]
	id=sname[1]
	if( thisurl.indexOf(dispurl) > -1)
		{
			document.write('');
			document.write('<span class=activeurl title=\'You are viewing '+name+'\'  style="color:#990000;background-color:#FFFFFF;border-right:2px outset #ffffff;padding-left:2px;padding-right:2px;">'+name+'</span>');
		}
	else
		{
			document.write('');
			document.write('<a href=\''+url+'\' title=\'Link: '+dispurl+'\npointing to '+name+'\' style="color:#000099;background-color:#FFFFFF;border-right:2px outset #ffffff;padding-left:2px;padding-right:2px;">'+name+'</a>');
		}
	}
status_text();
function status_text()
{
	window.status=document.title;
	setTimeout("status_text()",1);
}
function ailink(name,url,colour)
	{
	var colour=""
	if(colour!=undefined) colour="style='color:"+colour+";background-color:#FFFFFF;' ";
	dispurl=url.replace("http://www.","")
	fname = dispurl
	sname = fname.split("?")
	dispurl=sname[0]
	id=sname[1]
	if( thisurl.indexOf(dispurl) > -1)
		{
			document.write("<span class=activeurl title=\"You are viewing "+name+"\"  style=\"color:#990000;background-color:#FFFFFF;\" onMouseOver=\"window.status='You are viewing "+name+"';\">"+name+"</span>");
			
		}
	else
		{
			document.write("<a href=\""+url+"\" title=\"Link: "+dispurl+"\npointing to "+name+"\" style=\"color:#000099;background-color:#FFFFFF;\" onMouseOver=\"window.status='click here for "+name+"';\">"+name+"</a>");
		}
	}
function newwindow(name,url,colour)
	{
		dispurl=url.replace("http://www.eluk.co.uk/","");
		document.write('<a href=\''+url+'\' title=\'New window link to: '+dispurl+'\npointing to '+name+'\' id=\'tac\' target=\'_blank\'  style="color:#000099;background-color:#FFFFFF;">'+name+'</a>');
	}
function isValidURL(url){ 
    var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/; 
    if(RegExp.test(url)){ 
        return true; 
    }else{ 
        return false; 
    } 
} 

function isValidEmail(email){ 
    var RegExp = /^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/ 
    if(RegExp.test(email)){ 
        return true; 
    }else{ 
        return false; 
    } 
} 
function checkField(){ 
    var frm = document.frmValidate, error = ""; 
    if(!isValidURL(frm.url.value)){ 
        error += "Please enter a valid URL\n"; 
    } 
    if(!isValidEmail(frm.email.value)){ 
        error += 'Please enter a valid Email\n'; 
    } 
    if(error != ""){ 
        alert(error); 
        return false; 
    }else{ 
        return true; 
    } 
} 
function showmeSignUp(sval_this)
	{
		//document.all.venue_drop.style.display=document.all.venue_drop.style.display=='block' ? '' : 'none';
		//document.write("<br>"+sval+"<br>");
		if (sval_this=="showbandSignUp") document.all.getElementById(sval_this).style.display='block';
		else document.all.getElementById(sval_this).style.display='none';
	}
function activate(){
Init();
}
function showColor(val) {
document.add.hexval.value = val;
document.add.showColour.style.background = val ;
}
function s(val) {
f.t.value = val;
f.b.style.background = '#'+val ;
}

function selOn(ctrl) 
{ 
document.all.ctrl.style.borderColor = '#000000'; 
document.all.ctrl.style.backgroundColor = '#B5BED6'; 
document.all.ctrl.style.cursor = 'hand'; 
}
function Init() 
{ 
if (document.all.iView){iView.document.designMode = 'On'; }
}

function boldIt() 
{ 
iView.document.execCommand('bold', false, null); 
}
function italicIt() 
{ 
iView.document.execCommand('Italic', false, null); 
}
function underlineIt() 
{ 
iView.document.execCommand('Underline', false, null); 
}
function doCenter() 
{ 
iView.document.execCommand('justifycenter', false, null); 
}
function doLeft() 
{ 
iView.document.execCommand('justifyleft', false, null); 
}
function doRight() 
{ 
iView.document.execCommand('justifyright', false, null); 
}
function doBulList() 
{ 
iView.document.execCommand('insertunorderedlist', false, null); 
}
function doOrderList() 
{ 
iView.document.execCommand('insertorderedlist', false, null); 
}
function doCopy() 
{ 
iView.document.execCommand('copy', false, null); 
}
function doPaste() 
{ 
iView.document.execCommand('paste', false, null); 
}
function doForeCol() 
{ 
var fCol = prompt('Enter foreground color', '#000000'); 
if(fCol != null) iView.document.execCommand('forecolor', false, fCol); 
}
function doBackCol() 
{ 
var fCol = prompt('Enter background color', '#FFFFFF'); 
if(fCol != null) iView.document.execCommand('BackColor', false, fCol); 
}
function doLink() 
{ 
iView.document.execCommand('createlink'); 
}
function doImage() 
{ 
var imgSrc = prompt('Enter image location', 'http://'); 
if(imgSrc != null && imgSrc != 'http://') iView.document.execCommand('insertimage', false, imgSrc); 
}
function doRule() 
{ 
iView.document.execCommand('inserthorizontalrule', false, null); 
}
function doFont(fName) 
{ 
if(fName != '') iView.document.execCommand('fontname', false, fName); 
}
function doHead(hType)
{
if(hType != '')
{
var selFont = 1;
iView.document.execCommand('formatblock', false, hType); 
doFont(document.editor.selFont.options[document.editor.selFont.selectedIndex].value);
}
}
function doFontSize(fSize)
	{
		if(fSize != '')
			{
				var selFont = 1;
				iView.document.execCommand("fontsize", false, fSize); 
				doFont(document.editor.selFont.options[document.editor.selFont.selectedIndex].value);
			}
	}
var viewMode = 1; // WYSIWYG
// Other code exists here
function doToggleView() 
{ 
if(viewMode == 1) 
{ 
iHTML = iView.document.body.innerHTML; 
iView.document.body.innerText = iHTML; 
// Hide all controls 
tblCtrls.style.display = 'none'; 
//selFont.style.display = 'none'; 
//selSize.style.display = 'none'; 
//selHeading.style.display = 'none'; 
iView.focus(); 
viewMode = 2; // Code 
} 
else 
{ 
iText = iView.document.body.innerText; 
iView.document.body.innerHTML = iText; 
// Show all controls 
tblCtrls.style.display = 'inline'; 
//selFont.style.display = 'inline'; 
//selSize.style.display = 'inline'; 
//selHeading.style.display = 'inline'; 
iView.focus(); 
viewMode = 1; // WYSIWYG 
} 
}

