<!--
function OpenPopUp(WindowName){
/*Designed this pop up menu script so that it can be used for all in the site and give one place for configuration. Window Name is passed and then details are decided later variables are 
URL, WindowName, StatusBar(true/false), MenuBar(true/false), Height, Width
The calling function just needs the window name nothing else. */

if (WindowName=="FitNFunky")
URL = "http://www.FitNFunky.co.uk/default.asp"
window.open(URL,WindowName)
}

function OpenToolTipPopUp(WindowName,URL,Height,Width){
/*Designed this pop up menu script so that it can be used for all in the site and give one place for configuration. Window Name is passed and then details are decided later variables are 
URL, WindowName, StatusBar(true/false), MenuBar(true/false), Height, Width
The calling function just needs the window name nothing else. */
alert("open new window")
var newWindow = window.open(URL,WindowName,"false,false,HEIGHT="+Height+",WIDTH="+Width+"")
newWindow.focus()
}

function ValidateEmailInput(strText, Fname) 
{
   
 //   '---- Email Input Fields ----
//	'< > ( ) [ ] \ ; :

    var str= new Array(9);
     str[0] = /</;
	 str[1] = />/;
	 str[2] = /\(/;
	 str[3] = /\)/;
	 str[4] = /\[/;
	 str[5] = /\]/;
	 str[6] = /\\/; // escape the backslash
	 str[7] = /;/;
	 str[8] = /:/;
	
	msgstremail= "<  "+">  "+"(  "+")  "+"[  "+"]  "+"\  "+";  "+":  ";
	
	for (i=0;i < str.length ;i++)
	{
	  if (strText.search(str[i])!= -1)
	    {
	     alert("Invalid Input :" + Fname + "\r\n" +"The following characters are not allowed" + "\r\n"+msgstremail);
	     return false
	     }
	 }
	 
	 return true			
    
}

function trim_spaces(String)
{

   var retValue = String;
   var ch = retValue.substring(0, 1);
    // Check for spaces at the beginning of the string
   while (ch == " ") {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   // Check for spaces at the end of the string
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { 
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }

//removes multiple spaces from the middle.
len=retValue.length
for (i=0;i<len;i++)
{
	if (retValue.substr(i,1) == " " && retValue.substr(i+1,1) == " ")
	{
		retValue = retValue.substring(0,i) + retValue.substring (i+1,len)
		i=0
	}
len=retValue.length
}
return retValue;
}

//-->
