function writeMainFlash() {
document.write('<object type="application/x-shockwave-flash" data="images/one-leicester-story.swf" width="463" height="334" id="intromovie" name="intromovie">');
document.write('<param name="movie" value="images/one-leicester-story.swf" />');
document.write('<img src="images/one-passion-one-leicester.gif" width="463" height="334" alt="One Passion - One Leicester" />');
document.write('</object>');
}

function writePosterBuilder() {
document.write('<object type="application/x-shockwave-flash" data="images/poster-builder.swf" width="800" height="670">');
document.write('<param name="movie" value="images/poster-builder.swf" />');
document.write('</object>');
}

function writeLaunchPosterBuilder() {
document.write('<object type="application/x-shockwave-flash" data="images/launch-poster-builder.swf" width="800" height="670">');
document.write('<param name="movie" value="images/launch-poster-builder.swf" />');
document.write('</object>');
}

function collapseNav() {
/*
  numberOfSubNavs = 4;
  isCookieSet = readCookie('subcatcookie');
  for (i=1; i<=numberOfSubNavs; i++) {
    if (isCookieSet == i) {
      // cookie is set, so expand this sub category:
      if (getElement("subNav"+i)) {
        thiselement.style.display = 'block';
      }
    } else {
      if (getElement("subNav"+i)) {
        thiselement.style.display = "none";
      }
    }
  }
  */
}

function getElement(elementName) {
// thanks to http://www.netlobo.com/div_hiding.html
if (window.document.getElementById) {
	// this is the way the standards work
	thiselement = window.document.getElementById(elementName);
	return true;
	} else if (window.document.all) {
	// this is the way old msie versions work
	thiselement = window.document.all[elementName];
	return true;
	} else if (window.document.layers) {
	// this is the way nn4 works
	thiselement = window.document.layers[elementName];
	return true;
	}
	return false;
}

function expandNav(whichToExpand) {
/*
  for (i=1; i<=numberOfSubNavs; i++) {
    if (whichToExpand == i) {
      if (getElement("subNav"+i)) {
      thiselement.style.display = "block";
      }
    } else {
          if (getElement("subNav"+i)) {
      thiselement.style.display = "none";
      }
    }
  }
  /*
  // create cookie:
  var date = new Date();
  days = 7;
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
  document.cookie = 'subcatcookie='+whichToExpand+expires+'; path=/';
  */
  //return false;
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function collapseAll() {
  /*
  for (i=1; i<=numberOfSubNavs; i++) {
      if (getElement("subNav"+i)) {
        thiselement.style.display = "none";
      }
  }
    // create cookie for no category selected:
  var date = new Date();
  days = 7;
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
  document.cookie = 'subcatcookie=-1'+expires+'; path=/';
  */
}

function showOrHide(element_id) {
	obj = eval("document.getElementById(\"" + element_id + "\")");
	if(!obj.style.display || obj.style.display == "none") {
		obj.style.display = "block";
	} else if(obj.style.display == "block") {
		obj.style.display = "none";
	}
}

function hideBusinessUser() {
  // check for cookie:
  isCookieSet = readCookie('showBusiness');
  if (isCookieSet != "true") {
    if (getElement("businessUser")) {
      thiselement.style.display = "none";
      
       // drop cookie:
  var date = new Date();
  days = 7;
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
  document.cookie = 'showBusiness=false'+expires+'; path=/';
      
    }
  }
}

function clickedHideBusinessUser() {
  // don't check for cookie as user has clicked this:
  
    if (getElement("businessUser")) {
      thiselement.style.display = "none";
      
       // drop cookie:
  var date = new Date();
  days = 7;
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
  document.cookie = 'showBusiness=false'+expires+'; path=/';
      
    }

}

function showBusinessUser() {
  if (getElement("businessUser")) {
    thiselement.style.display = "block";
  }
  // drop cookie:
    var date = new Date();
  days = 7;
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
  document.cookie = 'showBusiness=true'+expires+'; path=/';
}



function showCreatorDetails() {
  if (getElement("creator_details")) {
    thiselement.style.display = "block";
     // drop cookie:
    var date = new Date();
  days = 7;
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
  document.cookie = 'showCreator=true'+expires+'; path=/';
  }
}

function hideCreatorDetails() {
  if (getElement("creator_details")) {
    thiselement.style.display = "none";
     // drop cookie:
    var date = new Date();
  days = 7;
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
  document.cookie = 'showCreator=false'+expires+'; path=/';
  }
}

function checkCreatorDetails() {
  // check for cookie:
  isCookieSet = readCookie('showCreator');

  if (isCookieSet == "false") {
 
    if (getElement("creator_details")) {
      thiselement.style.display = "none";
   
    }
    // check the radio button too:
    if (getElement("pc_questionNo")) {
  
    thiselement.checked = true;
    }
    
  }
}

function openPopup(popupLocation, popupName, popupWidth, popupHeight) {

// set defaults if they can't be read
var screenWidth = 760;
var screenHeight = 420;

if (self.screen.width) {
screenWidth = self.screen.width;
screenHeight = self.screen.height;
//alert(screenWidth+", "+screenHeight);
}

var popupTop = (screenHeight-popupHeight)/2;
var popupLeft = (screenWidth-popupWidth)/2;
newPopupName=window.open(popupLocation,'newname','height='+popupHeight+',width='+popupWidth+',left='+popupLeft+',top='+popupTop+',resizable=0');

if (newPopupName.focus) {
newPopupName.focus();
}

return false;
}
	

function revealHidden() {
// reveal close window JS link if JS is active
  if (getElement('JSHidden')) {
    thiselement.style.display="inline";
  }
}
