//Index - 
//Image open
//Framebuster client
//Download
//----------------------------------
//Image open - Opens an image in its own popup window in the style of the Super Graphics website.
//Useage = <a href="javascript:display_image('pictures/pk2001.jpg','Page Title','<br>Picture description',Height,Width,'#EC008C','URL');"><img src="pictures/pk2001sm.jpg" border=0></a>
//Note that the URL is optional.  If the height of the window does not fit on the screen of the user scrolling will be enabled automatically

function display_image(image, caption, info, width, height, colour, url) {
	var error;
        var scroll;
	if (url==error){
		url = '';
        }

	winwidth=eval(width+60);
        winheight=eval(height + 170)
        if (winheight>(screen.availHeight-20)){
            scroll=1;
            winheight=(screen.availHeight-20);
        } else if (winheight<=(screen.availHeight-20)){
            scroll=0;
        }

	PreView = window.open("", "preview","toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0,scrollbars=" + scroll + ",resizable=1,top=1,width=" + winwidth + ",height=" + winheight);
	PreView.document.open();
	PreView.document.write("<HTML>\n<HEAD>\n<STYLE>\nA:HOVER{COLOR: BLUE; TEXT-DECORATION: UNDERLINE;}\n</STYLE>");
	PreView.document.write("\n<TITLE>Plex Display - " + caption + "</TITLE>\n" +
	"\n</HEAD>\n<body bgcolor='#F6D401' link='#FFFFFF' alink='#FF0000' vlink='#FFFFFF'>");
	PreView.document.write("\n<TABLE WIDTH='100%' HEIGHT='100%' ALIGN=center border='0' cellspacing='0' cellpadding='0'>");
	PreView.document.write("\n<TR><TD BGCOLOR=" + colour + " WIDTH='10' HEIGHT='10'><IMG SRC='images/tl.gif'></TD>");	
	PreView.document.write("\n<TD BGCOLOR=" + colour + " HEIGHT='10'><IMG SRC='images/ct.gif' HEIGHT='10' WIDTH='100%'></TD>");	
	PreView.document.write("\n<TD BGCOLOR=" + colour + " WIDTH='10' HEIGHT='10'><IMG SRC='images/tr.gif'></TD></TR>");	
	PreView.document.write("\n<TR><TD BGCOLOR=" + colour + " WIDTH='10'><IMG SRC='images/cl.gif' HEIGHT='100%' WIDTH='10'></TD>");	
	PreView.document.write("\n<TD BGCOLOR=" + colour + "><CENTER><FONT FACE='ARIAL' SIZE=3 COLOR=WHITE><STRONG>" + caption + "</FONT><BR><BR>");
	if (url != ''){
		PreView.document.write("\n<A HREF=\"" + url + "\">");
        }
	PreView.document.write("\n<IMG SRC='" + image +"' BORDER=0 ALT='" + caption + "'><BR><FONT FACE='ARIAL' SIZE=2 COLOR=WHITE>" + info + "</A></FONT></STRONG></TD>");
	PreView.document.write("\n<TD BGCOLOR=" + colour + " WIDTH='10'><IMG SRC='images/cr.gif' HEIGHT='100%' WIDTH='10'></TD></TR>");	
	PreView.document.write("\n<TR><TD BGCOLOR=" + colour + " WIDTH='10' HEIGHT='10'><IMG SRC='images/bl.gif'></TD>");	
	PreView.document.write("\n<TD BGCOLOR=" + colour + " HEIGHT='10'><IMG SRC='images/cb.gif' HEIGHT='10' WIDTH='100%'></TD>");	
	PreView.document.write("\n<TD BGCOLOR=" + colour + " WIDTH='10' HEIGHT='10'><IMG SRC='images/br.gif'></TD></TR>");	
	PreView.document.write("\n</TABLE></HTML>");
	PreView.document.close();
	PreView.focus();
    }

//-------------
//Framebuster client
//To be used in conjunction with the framebuster parent which is installed in the frameset.html
//Source for the framebuster parent is in framejammer.js

if (window.name!='mainframe' && window.name!='booker_'
		 && !((self.innerHeight == 0) && (self.innerWidth == 0)))
		top.location.replace('frameset.html?' + self.location);

//-------------

//Download script - Makes sure that people agree to the terms and conditions
//Useage = <a href="javascript:download('wibble.zip')">Wibble</a>

function download(url){
	question = confirm("Downloading any file indicates you accept the terms and conditions.\n\nWould you like to continue with the download (OK) or read the disclaimer (CANCEL)?");
	if (question !="0"){
		alert("Thank you for agreeing to terms and conditions");
                window.open(url);
	} else {
                open("downloads.html","_blank", "toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=700,height=500")
	}
}
