//***************************************************************
//Copyright (c) 2009 Graham Hill
//Last update: 20-03-2010
//***************************************************************
function frameControl(fs, bp, pl, p)
{
var our_domains		= new Array(3);
our_domains[0]		= "www.porthlevengigclub.co.uk";
our_domains[1]		= "www.porthlevengigclub.org";
our_domains[2]		= "www.porthlevengigclub.co.uk";
var frameset_location 	= 'http://www.porthlevengigclub.co.uk/';
var frameset_name 	= new Array(1);
frameset_name[0]  	= "index.htm";
var base_page_location	= new Array(4);
base_page_location[0]	= "";
base_page_location[1]	= "?http://www.porthlevengigclub.co.uk/";
base_page_location[2]	= "?http://www.porthlevengigclub.co.uk/";
base_page_location[3]	= "?http://www.porthlevengigclub.co.uk/";
var page_location 	= new Array(4);
page_location[0]     	= "";
page_location[1]     	= "pgc_site/";
page_location[2]     	= "pgc_site/site_wide/";
page_location[3]     	= "pgc_site/images_htm/";
var url = "" + document.referrer;
var split_url = url.split("/");
if (split_url[2] == our_domains[0]){return;}
if (split_url[2] == our_domains[1]){return;}
if (split_url[2] == our_domains[2]){return;}

if (p == '#')
	{if (window != top) 
	     {window.top.location.href = location.href;}
	 else {return;}
	}
else{

if (p == '?') {var p = '?' + window.self.location.href;}
{window.top.location.href = frameset_location + frameset_name[fs] + base_page_location[bp] + page_location[pl] + p;}
}}


//***************************************************************
//Copyright (c) 2009 Graham Hill
//Last update: 20-03-2010
//***************************************************************
function frameSetControl(dp)
{
var variable_frame	= (location.search) ? location.search.substring(1, location.search.length) : dp;
var our_domains		= new Array(3);
our_domains[0]		= "www.porthlevengigclub.co.uk";
our_domains[1]		= "www.porthlevengigclub.co.uk";
our_domains[2]		= "www.porthlevengigclub.co.uk";

var url = "" + document.referrer;
var split_url = url.split("/");

if (window != top)
	{if (split_url[2] != our_domains[0] && (!(split_url[2] == our_domains[1])) && (!(split_url[2] == our_domains[2])))
	{window.top.location.href = window.location.href;}
	else ;}

else{	
parent.dynamic_frame.location.href = variable_frame;

<!--<The following code is ONLY because we have to change the banner dependent on the dynamic frame>-->

var url_less_anchor = variable_frame.split('#');

if (url_less_anchor[0] == 'http://www.porthlevengigclub.co.uk/pgc_site/pgc_home.htm')
{parent.pgc_banner_links.location.href = 'pgc_site/site_wide/pgc_banner_links_frame_home.htm', parent.pgc_left.location.href = 'pgc_site/site_wide/pgc_left_frame_home.htm';}
else{
	
if (url_less_anchor[0] == 'http://www.porthlevengigclub.co.uk/pgc_site/pgc_porthleven.htm')
{parent.pgc_banner_links.location.href = 'pgc_site/site_wide/pgc_banner_links_frame_porthleven.htm', parent.pgc_left.location.href = 'pgc_site/site_wide/pgc_left_frame_porthleven.htm';}
else{

if (url_less_anchor[0] == 'http://www.porthlevengigclub.co.uk/pgc_site/pgc_club.htm')
{parent.pgc_banner_links.location.href = 'pgc_site/site_wide/pgc_banner_links_frame_club.htm', parent.pgc_left.location.href = 'pgc_site/site_wide/pgc_left_frame_club.htm';}
else{

if (url_less_anchor[0] == 'http://www.porthlevengigclub.co.uk/pgc_site/pgc_gigs.htm')
{parent.pgc_banner_links.location.href = 'pgc_site/site_wide/pgc_banner_links_frame_gigs.htm', parent.pgc_left.location.href = 'pgc_site/site_wide/pgc_left_frame_gigs.htm';}
else{

if (url_less_anchor[0] == 'http://www.porthlevengigclub.co.uk/pgc_site/pgc_contact.htm')
{parent.pgc_banner_links.location.href = 'pgc_site/site_wide/pgc_banner_links_frame_contact.htm', parent.pgc_left.location.href = 'pgc_site/site_wide/pgc_left_frame_contact.htm';}
else{

if (url_less_anchor[0] == 'http://www.porthlevengigclub.co.uk/pgc_site/pgc_images.htm')
{parent.pgc_banner_links.location.href = 'pgc_site/site_wide/pgc_banner_links_frame_images.htm', parent.pgc_left.location.href = 'pgc_site/site_wide/pgc_left_frame_images.htm';}
else{

if (url_less_anchor[0] == 'http://www.porthlevengigclub.co.uk/pgc_site/pgc_merchandise.htm')
{parent.pgc_banner_links.location.href = 'pgc_site/site_wide/pgc_banner_links_frame_merchandise.htm', parent.pgc_left.location.href = 'pgc_site/site_wide/pgc_left_frame_merchandise.htm';}
else{

if (url_less_anchor[0] == 'http://www.porthlevengigclub.co.uk/pgc_site/pgc_links.htm')
{parent.pgc_banner_links.location.href = 'pgc_site/site_wide/pgc_banner_links_frame_links.htm', parent.pgc_left.location.href = 'pgc_site/site_wide/pgc_left_frame_links.htm';}
}}}}}}}
<!--<End code for changing the banner dependent on the dynamic frame>-->

}}

