var h = 0;
var Sh;
var c = 0;
var mo = 1;
var Focus=0;
var Time=0;

if(self.opener){
 if(self.opener.location.substr(0, 21)=="http://www.hiz.org.uk"){
  self.close();
 }
}

var cnumber=0;
function SubmitContact(){
 var error="";
 if(document.getElementById("contactMessage").value==""){
  error = "Please enter your message";
  cnumber += 1;
 }
 if(document.getElementById("bigNameText").value==""){
  error = "Please enter your name";
  cnumber += 1;
 }
 if(document.getElementById("bigEmailText").value=="" || document.getElementById("bigEmailText").value.match("@")==null){
  error = "Please enter your e-mail";
  cnumber += 1;
 }
 document.getElementById("CError").innerHTML = error;
 if(cnumber==0){
  document.getElementById("ContactForm").target="contactObject";
  document.getElementById("ContactForm").submit();
  document.getElementById("contactObject").style.visibility="visible";
  document.getElementById("contactObject").style.height="200px";
  document.getElementById("ContactForm").style.display="none";
 }
}

var number=0;
function SubmitSign(){
 var error="";
 if(document.getElementById("nameText").value==""){
  number += 1;
  error = "Please enter your name";
 }
 if(document.getElementById("emailText").value=="" || document.getElementById("emailText").value.match("@")==null){
  number += 1;
  error = "Please enter your e-mail";
 }
 document.getElementById("Error").innerHTML = error;
 mo=1;
 h=98;
 if(number==0){
  h=83;
  document.getElementById("SignForm").target="object";
  document.getElementById("SignForm").submit();
  document.getElementById("object").style.visibility="visible";
  document.getElementById("object").style.height="160px";
  document.getElementById("Error").style.display="none";
  document.getElementById("nameText").style.display="none";
  document.getElementById("emailText").style.display="none";
  Keep();
 }
 document.getElementById("signContent").style.height=h+"px";
}
function Keep(){
 h=83;
 setTimeout(Keep,1);
}

function Run(way){
 if(way == 'FocusSmall'){
  Focus = "Smaller";
  FocusSmaller();
 }
 if(way == 'FocusLarge'){
  Focus = "Larger";
  FocusLarger();
 }
 if(way == 'Small'){
  if(c==0 && Focus != "Larger"){
   mo=0;
  }
 }
 if(way == 'Large'){
  if(c==0){
   Larger();
   mo=1;
  }
 }
}
function FocusLarger(){
 if(Focus == "Larger"){
  mo=1;
  setTimeout(FocusLarger,1);
 }
}
function FocusSmaller(){
 if(Focus=="Smaller"){
  mo=0;
  Run('Small');
 }
}
function Larger(){
 c=1;
 Sh = h;
 var mH=99;
 if(number==0){
  mH=84;
 }
 document.getElementById("signContent").style.backgroundColor="#ffefdf";
 document.getElementById("signContent").style.visibility="visible";
 if(h < 51){
if(navigator.userAgent.search(/msie/i)!= -1) {
h+=8;
} else {
h+=4;
}
  document.getElementById("signContent").style.height=h+"px";
  if(c==1){
   setTimeout(Larger,1);
  }
 }
 else if(h < mH){
if(navigator.userAgent.search(/msie/i)!= -1) {
h+=4;
} else {
h+=2;
}
  document.getElementById("signContent").style.height=h+"px";
  if(c==1){
   setTimeout(Larger,1);
  }
 }
 else{
  c=0;
  Time = 50;
 }
}
function Smaller(){
 if(Sh > 0){
if(navigator.userAgent.search(/msie/i)!= -1) {
Sh-=8;
} else {
Sh-=4;
}
  if(c==0 && mo==0 && Time < 0){
   document.getElementById("signContent").style.height=Sh+"px";
   h=Sh;
  }
  else{
   Sh=h;
  }
 }
 else{
  document.getElementById("signContent").style.backgroundColor="#ffffff";
 }
 setTimeout(Smaller,1);
 Time -= 1;
}


function newWindow(location){
 window.open(location,"Edit","menubar=no,width=700,height=360,toolbar=no,scrollbars=yes");
}