
var divname = "";
function ajax_CloseDiv(divname)
{

	document.getElementById(divname).innerHTML = "";
}

function ajax_DisplayOption()
{
	var opt = document.getElementById('member_id').value;
	var whatelement = window.event.srcElement.id;
	alert( opt + whatelement);
}

var formname = "";
function ajax_DisplayUpload(formname)
{
	document.getElementById('divresponse').innerHTML = "Uploading video please wait..";
	var whatelement = window.event.srcElement.id;
	var savetext = document.getElementById(whatelement).value;
	document.getElementById(whatelement).value = "Uploading video please wait..This takes awhile";
}

var loginform = "";

function ajax_ClearError(loginform)
{
	document.getElementById('divresponse').innerHTML = "";
}


	
var fgstlyecolor = 'white';
var bgstylecolor = 'black';
function ajaxptsmenu()
{
	
	var whatelement = window.event.srcElement.id;
	bgstylecolor = document.getElementById(whatelement).style.backgroundColor;
	fgstlyecolor = document.getElementById(whatelement).style.color;
	if (document.getElementById("fpassptsclienttrainer").value != "")
	{
		document.getElementById(whatelement).style.color='Blue';
		document.getElementById(whatelement).style.backgroundColor='Yellow';
	}

}

function ajaxmenu()
{
	var whatelement = window.event.srcElement.id;
	//alert("here" + whatelement);
	bgstylecolor = document.getElementById(whatelement).style.backgroundColor;
	fgstlyecolor = document.getElementById(whatelement).style.color;
	
		document.getElementById(whatelement).style.color='Black';
		document.getElementById(whatelement).style.backgroundColor='Yellow';


}
function killmenu()
{
	var whatelement = window.event.srcElement.id;
	if (whatelement =="")
	{
		var whatelement = window.event.srcElement.id;	
	}
	document.getElementById(whatelement).style.color= fgstlyecolor;	
	document.getElementById(whatelement).style.backgroundColor= bgstylecolor;
}

function ajax_updateconfig()
{
		document.getElementById('divresponse').innerHTML = "updating config data";

	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	
	var whatelement = window.event.srcElement.id;

	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_update_configrecord.php";
	var parameter = "fConfigID=" + whatelement + "&Configsvalue=" + document.getElementById(whatelement).value;

	if (whatelement == 'newconfig')
	{
		parameter = "fConfigID=&fConfigsName=" + document.getElementById(whatelement).value + "&fConfigsValue=&fConfigsType=Config&ftarget=" +  document.getElementById('ftarget').value;
		//alert(parameter);
	}
	if (whatelement == 'newcosmetix')
	{
		parameter = "fConfigID=&fConfigsName=" + document.getElementById(whatelement).value + "&fConfigsValue=&fConfigsType=Cosmetix&ftarget=" +  document.getElementById('ftarget').value;
		//alert(parameter);
	
	}

  	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			
			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			
//alert("here " + resulttext);
			   document.getElementById('divresponse').innerHTML = resulttext;
  			}
		}
	
	}

	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}	


//calendar event update
var formname = "";
function ajax_UpdateEvent(formname)
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	//alert('here ');
	var whatelement = window.event.srcElement.id;
	//alert(whatelement);
	
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements['urltocall'].value;
	
	var parameter = "";
	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter=="")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}
//alert('here ' + parameter);

  	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			
			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('divresponse').innerHTML = resulttext;
   				document.getElementById('calendarediteventdiv').innerHTML = "";
  			}
		}
	
	}

	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}	


var formname = "";
function ajax_UpdateMember(formname)
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	
	var whatelement = window.event.srcElement.id;
	
	
	if (whatelement == "member_delete")
	{
		document.forms[formname].elements["member_mode"].value = "delete";
	}
	if (whatelement == "member_update")
	{
		document.forms[formname].elements["member_mode"].value = "update";
		
	}
	var counter = 0;
	var nbroffields = document.forms[formname].length;
//	alert(nbroffields);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_updatemember.php";
	
	var parameter = "";
	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter=="")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}
//alert('here ' + parameter);

  	ajaxRequest.onreadystatechange = function checkstate()
	{
//alert(ajaxRequest.readyState + ajaxRequest.status);
	 	if (ajaxRequest.readyState==4)
		{
  			
			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			//alert(resulttext);

			   document.getElementById('divresponse').innerHTML = resulttext;
  			}
		}
	
	}

	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}	

var formname = "";
function ajax_UpdateMemberEvent(formname)
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	
	var whatelement = window.event.srcElement.id;
	//alert(whatelement);
	
	if (whatelement == "delete_event")
	{
		document.forms[formname].elements["event_mode"].value = "delete";
	}
	if (whatelement == "update_event")
	{
		document.forms[formname].elements["event_mode"].value = "update";
		
	}
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	//alert(nbroffields);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_updatememberevent.php";
	
	var parameter = "";
	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter=="")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}
//alert('here ' + parameter);

  	ajaxRequest.onreadystatechange = function checkstate()
	{
//alert(ajaxRequest.readyState + ajaxRequest.status);
	 	if (ajaxRequest.readyState==4)
		{
  			
			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			//alert(resulttext);

			   document.getElementById('divresponse').innerHTML = resulttext;
  			}
		}
	
	}

	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}	

var formname = "";
function ajax_sendreservationrequest(formname)
{
	
	document.getElementById('divresponse').innerHTML = "submitting reservation";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	
	var whatelement = window.event.srcElement.id;
	//alert(whatelement);
	
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	//alert(nbroffields);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_submitmemberreservation.php";
	
	var parameter = "";
	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter=="")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}
//alert('here ' + parameter);

  	ajaxRequest.onreadystatechange = function checkstate()
	{
//alert(ajaxRequest.readyState + ajaxRequest.status);
	 	if (ajaxRequest.readyState==4)
		{
  			
			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			//alert(resulttext);

			   document.getElementById('divresponse').innerHTML = resulttext;
			   document.getElementById('citnewsdiv').innerHTML = resulttext;
  			}
		}
	
	}

	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}	



var formname = "";
function ajaxModifyCalendar(formname)
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}

	// Create a function that will receive data sent from the server
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements['urltocall'].value;

	var parameter = "";
	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter=="")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}

	//alert(parameter);
  	ajaxRequest.onreadystatechange = function checkstate()
	{
//alert(ajaxRequest.status);
	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			
//alert(resulttext);
			   document.getElementById('calendarediteventdiv').innerHTML = resulttext;
   	
  			}
		}
	
	}

	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}	

var formname = "";
function ajaxModifyClickCalendar(formname)
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}

	// Create a function that will receive data sent from the server
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements['urltocall'].value;

	var parameter = "";
	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter=="")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}

	//alert(parameter);
  	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('calendarediteventdiv').innerHTML = resulttext;
   	
  			}
		}
	
	}

	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}	


var $strPopupTitleBG = "718796";
var $strPopupBG = "FFFFFF";
var $strPopupTitleFontLine = "<FONT FACE='Arial' COLOR='FFFFFF' SIZE='2'>";
var $strPopupFontLine = "<FONT FACE='Arial' COLOR='Black' SIZE='1'>";

var $Xoffset= -100;    // modify these values to ...
var $Yoffset= -40;    // change the popup position.
var $popupwidth = 200;

var $boxheight = 0;

var calformname = "";
function popup(calformname)
{

 var title = document.forms[calformname].elements["Title"].value;
  var eventtime = document.forms[calformname].elements["EventTime"].value;
 var location = document.forms[calformname].elements["Location"].value;
 var contact = document.forms[calformname].elements["Contact"].value;
 var details = document.forms[calformname].elements["Details"].value; 
 var content = "";
var posx = (document.forms[calformname] && !window.opera) ? event.x + document.body.scrollLeft : e.clientX;
var posy = (document.forms[calformname] && !window.opera) ? event.y + document.body.scrollTop : e.clientY;

 	posx = posx + $Xoffset;
 	posy = posy + $Yoffset;
 
if (posx > 750)
{
	posx = posx  - 200;
}
if (posx < 100)
{
	posx = posx  + 200;
}
if (posy > 700)
{
	posy = posy - 200;
}


 var fillstyle = "style='position:absolute; left:" + posx + "px; top:" + posy + "px; VISIBILITY:VISIBLE";

	content="<DIV ID='dek' " + fillstyle + "><TABLE WIDTH='200' BORDER=1 BGCOLOR='White'> ";
	
	if (title != "") 
	{
   		content = content + "<TR><TD BGCOLOR='Black'>";
   	}
	content = content + "<TABLE WIDTH='200' BORDER=1 BGCOLOR='" + $strPopupTitleBG + "'><TR><TD width='200'><b>" + $strPopupTitleFontLine + title + "</b></FONT></TD></TR>";
	content = content + "<TABLE WIDTH='200' BORDER=1 BGCOLOR='" + $strPopupBG + "'>";
	if (eventtime != "") 
	{
   		content = content + "<TR><TD BGCOLOR='Black' width='33%' VALIGN='TOP' ALIGN='RIGHT'>" + $strPopupTitleFontLine + "Time:</FONT></TD><TD BGCOLOR='White' WIDTH='67%'>" + $strPopupFontLine + eventtime + "</FONT></TD></TR>";
	}
	if (location != "") 
	{
   		content = content + "<TR><TD BGCOLOR='Black' width='33%' VALIGN='TOP' ALIGN='RIGHT'>" + $strPopupTitleFontLine + "Location:</FONT></TD><TD BGCOLOR='White' width='67%'>" + $strPopupFontLine + location + "</FONT></TD></TR>";
   	}

	if (contact != "") 
	{
   		content = content + "<TR><TD BGCOLOR='Black' width='33%' VALIGN='TOP' ALIGN='RIGHT'>" + $strPopupTitleFontLine + "Contact:</FONT></TD><TD BGCOLOR='White' width='67%'>" + $strPopupFontLine + contact + "</FONT></TD></TR>";
   	}
	if (details != "") 
	{
   		content = content + "<TR><TD BGCOLOR='Black' width='33%' VALIGN='TOP' ALIGN='RIGHT'>" + $strPopupTitleFontLine + "Details:</FONT></TD><TD BGCOLOR='White' width='67%'>" + $strPopupFontLine + details + "</FONT></TD></TR>";
   }
	content = content + "</td></tr></TABLE></td></tr></table></td></tr></TABLE></div>";
	
	document.getElementById("dek").innerHTML= content;

}
function get_mouse($e){
  if ($nav) {
     $x=$e.pageX; 
     $y=$e.pageY;     
     skn.left = $x + $Xoffset;
     skn.top=$y+$yyy;

     if (($e.pageX - 100) < 0) {
        skn.left=$e.pageX;
     }
     if (($e.pageX + 115) > document.body.clientWidth) {
        skn.left=$e.pageX - 150;
     }  
     
  }
  if ($iex) {
     $x = event.x+document.body.scrollLeft;
     skn.left = $x + $Xoffset;
     $y = event.y+document.body.scrollTop;
     skn.top=$y+$yyy;
       
     if ((event.y + $boxheight) > $w_y) {
        skn.top = $y - 200;
     }
     if ((event.x - 100) < 0) {
        skn.left=event.x;
     }
     if ((event.x + 115) > document.body.clientWidth) {
        skn.left=event.x - 150;
     }  
  }
}

function kill()
{

document.getElementById("dek").visibility = "hidden";
document.getElementById("dek").innerHTML= "";
}

function nothing(){
}

function killbiz()
{

document.getElementById("bizdescriptdiv2").style.visibility = "hidden";

}

//show text over image

var formname = "";

function popupbiz(formname)
{
	var bgimage = "http://www.clickintown.com/images/clickintown_blk_bg.jpg";
	var $Xoffset= -40;    // modify these values to ...
	var $Yoffset= 20;    // change the popup position.
	
	var whatelement = window.event.srcElement.name;
	//alert(whatelement);
	
	document.getElementById("bizdescriptdiv").style.visibility = "visible";

 	var descriptionelement = "fBiz_Description-" + formname;

  	var biznameelement = "fBiz_Name-" + formname;
//alert('here ' + descriptionelement);
 	var description = document.getElementById(descriptionelement).value; 

 	var bizname = document.getElementById(biznameelement).value;

 	var content = "";

	var posx = (document.getElementById(whatelement) && !window.opera) ? event.x + document.body.scrollLeft : e.clientX;
	var posy = (document.getElementById(whatelement) && !window.opera) ? event.y + document.body.scrollTop : e.clientY;

 	posx = posx + $Xoffset ;
	//posy = posy + $Yoffset + document.body.scrollTop;
	posx = event.x + $Xoffset + document.body.scrollLeft;
	posy = event.y + $Yoffset + document.body.scrollTop;

 var fillstyle = " align='left' style='position:absolute; left:" + posx + "px; top:" + posy + "px; background-color:yellow; width:150; VISIBILITY:VISIBLE'";

	content="<DIV ID='bizdescriptdiv2' " + fillstyle + "><fieldset>";
	content = content + "<legend><strong>" + bizname + "</font></strong></legend>";
	content = content +  description;

	content = content + "</fieldset></div>";

	document.getElementById("bizdescriptdiv").innerHTML= content;

}


function popupbook(formname)
{
	var bgimage = "http://www.clickintown.com/images/clickintown_blk_bg.jpg";
	var $Xoffset= -40;    // modify these values to ...
	var $Yoffset= 20;    // change the popup position.
	
	var whatelement = window.event.srcElement.name;
	
	document.getElementById("bizdescriptdiv").style.visibility = "visible";

 	var descriptionelement = "fBook_Statement-" + formname;

  	var booktitleelement = "fBook_Title-" + formname;

 	var description = document.getElementById(descriptionelement).value; 

 	var bizname = document.getElementById(booktitleelement).value;

 	var content = "";

	var posx = (document.getElementById(whatelement) && !window.opera) ? event.x + document.body.scrollLeft : e.clientX;
	var posy = (document.getElementById(whatelement) && !window.opera) ? event.y + document.body.scrollTop : e.clientY;

 	posx = posx + $Xoffset ;
	//posy = posy + $Yoffset + document.body.scrollTop;
	posx = event.x + $Xoffset + document.body.scrollLeft;
	posy = event.y + $Yoffset + document.body.scrollTop;

 var fillstyle = " align='left' style='position:absolute; left:" + posx + "px; top:" + posy + "px; background-color:yellow; width:150; VISIBILITY:VISIBLE'";

	content="<DIV ID='bizdescriptdiv2' " + fillstyle + "><fieldset>";
	content = content + "<legend><strong>" + bizname + "</font></strong></legend>";
	content = content +  description;

	content = content + "</fieldset></div>";

	document.getElementById("bizdescriptdiv").innerHTML= content;

}




//email user access
var formname = "";
function ajax_EmailPassword(formname)

{
	var ajaxRequest;  // The variable that makes Ajax possible!
	document.getElementById('divresponse').innerHTML = "sending mail";
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	var counter = 0;
		
	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}
	var urltocall = "urltocall" + whatelement;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements['urltocall'].value;
	
	var parameter = "fBiz_Email=" + encodeURIComponent(document.forms[formname].elements['fBiz_Email'].value) + "&whoisit=" + encodeURIComponent(document.forms[formname].elements['whoisit'].value);

  	ajaxRequest.onreadystatechange = function checkstate()
	{
		
	 	if (ajaxRequest.readyState==4)
		{
			
			  if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   				var resulttext = ajaxRequest.responseText;
   			
			   
			   document.getElementById('divresponse').innerHTML = resulttext ;
			   document.getElementById('bizeditdiv').innerHTML = "" ;
			   
			}
			   
   			
  		}
	}
	

	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}


var formname = "";
function ajax_SwapCamera(formname)

{
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	var counter = 0;
		
	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}
	var urltocall = "urltocall" + whatelement;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements[urltocall].value;
	
	var parameter = "fBiz_ID=" + encodeURIComponent(document.forms[formname].elements['fBiz_ID'].value);	

  	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{

			  if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   				var resulttext = ajaxRequest.responseText;
   			
			   
			   document.getElementById('divresponse').innerHTML = "Camera " + resulttext ;
			   if (resulttext == "On")
			   {
			   		document.getElementById("cameraonoff").value = "Turn Cam Off";
			   	
				}
				
				else
				{
					document.getElementById("cameraonoff").value = "Turn Cam On";

				}
			}
			   
   			
  		}
	}
	

	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}
//function reads a passed form and sends the parameters to an url for table update.
//formname is passed with table name and number of data fields
//form includes the data elements for the data read from the form
    var formname = "";
    
function ajaxTableUpdateFunction(formname)
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	document.getElementById('divresponse').innerHTML = "updating data";
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	var parameter = "";
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements['urltocall'].value;
	
	for (counter=0; counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}
//alert(urlparm + parameter);

  	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   				var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('divresponse').innerHTML = resulttext;
   			
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}	
var formname = "";
function ajaxExerciseUpdateFunction(formname)
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	document.getElementById('divresponse').innerHTML = "updating ex detail";
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	var parameter = "";
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + 'updateexercisedetail.php';
	//alert(urlparm);
	for (counter=0; counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}

//alert("here" +  parameter);
  	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   				var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('divresponse').innerHTML = resulttext;
   			
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}	
	
    var formname = "";
    
function ajax_UpdateBiz(formname)
{
	document.getElementById('divresponse').innerHTML = "Working ..please wait";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "";
	var nbroffields = document.forms[formname].length;
	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}

	var urltocall = "urltocall" + whatelement;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements[urltocall].value;
	
	for (counter=0; counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				
				parameter = parameter + "&" + newpair;
			
			}
		}
	}
	parameter = parameter + "&fTargetStateProv=" + document.getElementById('fTargetStateProv').value;
	parameter = parameter + "&fTargetTownID=" + document.getElementById('fTargetTownID').value;
	

	ajaxRequest.onreadystatechange = function checkstate()
	{
		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   				var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('divresponse').innerHTML = resulttext;
   			
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm, true);
//	ajaxRequest.onreadystatechange = checkstate;
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	

}	

function ajax_UpdateBook(formname)
{
	document.getElementById('divresponse').innerHTML = "Working ..please wait";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "";
	var nbroffields = document.forms[formname].length;
	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}

	var urltocall = document.forms[formname].elements[urltocall].value;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation  + urltocall;
	
	for (counter=0; counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				
				parameter = parameter + "&" + newpair;
			
			}
		}
	}
	

	ajaxRequest.onreadystatechange = function checkstate()
	{
		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   				var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('divresponse').innerHTML = resulttext;
   			
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm, true);
//	ajaxRequest.onreadystatechange = checkstate;
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	

}	

function ajax_UpdateNews(formname)
{
	document.getElementById('divresponse').innerHTML = "Working ..please wait";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "";

	var nbroffields = document.forms[formname].length;

	var whatelement = window.event.srcElement.id;
	
	var urltocall = document.getElementById('urltocall').value;
	if (whatelement = 'updatecontent')
	{
		var urltocall = 'ajax_update_news.php';	
	}

	
	
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + urltocall;

	//alert("here " + urltocall);
	for (counter=0; counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				
				parameter = parameter + "&" + newpair;
			
			}
		}
	}
	
//alert("here2 " + parameter);
	ajaxRequest.onreadystatechange = function checkstate()
	{
		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   				var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('divresponse').innerHTML = resulttext;
   			
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm, true);
//	ajaxRequest.onreadystatechange = checkstate;
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	

}	

	var formname = "";
function ajax_UpdateCameraSchedule(formname)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "";
	var nbroffields = document.forms[formname].length;
	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements["urltocall"].value;

	
	for (counter=0; counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				
				parameter = parameter + "&" + newpair;
			
			}
		}
	}

	ajaxRequest.onreadystatechange = function checkstate()
	{
		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
				var resulttext = ajaxRequest.responseText;
				document.getElementById('divresponse').innerHTML = resulttext;
	
   			
  			}
		}
	
	}
	
	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}

	var formname = "";
function ajax_UpdateClientExercises(formname)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "";
	var nbroffields = document.forms[formname].length;
	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.forms[formname].elements["urltocall"].value;

	
	for (counter=0; counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				
				parameter = parameter + "&" + newpair;
			
			}
		}
	}

	ajaxRequest.onreadystatechange = function checkstate()
	{
		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
				var resulttext = ajaxRequest.responseText;
				document.getElementById('divresponse').innerHTML = resulttext;
	
   			
  			}
		}
	
	}
	
	ajaxRequest.open("POST", urlparm, true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
}




	var formname = "";
function  ajax_EditContent(formname)	
{

	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "fid=" + formname;
	parameter = parameter + "&ftarget=" + document.getElementById('ftarget').value;

	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}
	var urltocall = "ajax_edit_news.php";
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + urltocall;


	
  	ajaxRequest.onreadystatechange = function checkstate()
	{

		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
				var resulttext = ajaxRequest.responseText;
   			
			   document.getElementById('camerascheduleditdiv').innerHTML = resulttext;
				document.getElementById('divresponse').innerHTML = "Edit Content Schedule";
	
   			
  			}
		}
	
	}
	
		ajaxRequest.open("POST", urlparm, true);
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", parameter.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(parameter);

	
}

	
	var formname = "";
function  ajax_EditBook()	
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "fBook_Key=" + formname;

	
	var urltocall = "ajax_edit_books.php";
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + urltocall;


	
  	ajaxRequest.onreadystatechange = function checkstate()
	{
		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
				var resulttext = ajaxRequest.responseText;
   			
			   document.getElementById('camerascheduleditdiv').innerHTML = resulttext;
				document.getElementById('divresponse').innerHTML = "Edit Book Data";
	
   			
  			}
		}
	
	}
	
		ajaxRequest.open("POST", urlparm, true);
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", parameter.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(parameter);

	
}
	var formname = "";
function  ajax_DisplayExercises(formname)	
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "fBiz_ID=" + document.forms[formname].elements['fBiz_ID'].value;

	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}
	var urltocall = "ajax_displayexercises";
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + urltocall;


	
  	ajaxRequest.onreadystatechange = function checkstate()
	{
		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
				var resulttext = ajaxRequest.responseText;
   			
			   document.getElementById('toplists').innerHTML = resulttext;
				document.getElementById('divresponse').innerHTML = "Select an Exercise";
	
   			
  			}
		}
	
	}
	
		ajaxRequest.open("POST", urlparm, true);
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", parameter.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(parameter);

	
}


	
	var formname = "";
function  ajax_EditCameraSchedule(formname)	
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;
	var parameter = "fBiz_ID=" + document.forms[formname].elements['fBiz_ID'].value;

	var whatelement = window.event.srcElement.name;
	if (whatelement == "")
	{
		var whatelement = window.event.srcElement.id;	
	}
	var urltocall = "urltocall" + whatelement;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + document.getElementById(urltocall).value;


	
  	ajaxRequest.onreadystatechange = function checkstate()
	{
		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
				var resulttext = ajaxRequest.responseText;
   			
			   document.getElementById('camerascheduleditdiv').innerHTML = resulttext;
				document.getElementById('divresponse').innerHTML = "Edit Camera Schedule";
	
   			
  			}
		}
	
	}
	
		ajaxRequest.open("POST", urlparm, true);
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", parameter.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(parameter);

	
}
	
	
//login screen

    var formname = "";
    
function ajax_login(formname)
{
	document.getElementById('divresponse').innerHTML = "logging in...";
	document.getElementById('bizeditdiv').innerHTML = "";
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	var parameter = "";
	var password = document.forms[formname].elements['fBiz_Password'].value;
	var userid = document.forms[formname].elements['fBiz_User_ID'].value;
	var whatelement = window.event.srcElement.name;
	
	if (whatelement == "")
	{
			whatelement = window.event.srcElement.id;
	}
	var rootlocation = document.getElementById('fphpfiles').value;
	if (whatelement == "loginmenu")
	{
		var urlparm = rootlocation + document.forms[formname].elements['urltocalllogin'].value;	
	}
	if (whatelement == "registermenu")
	{
		var urlparm = rootlocation + document.forms[formname].elements['urltocall'].value;	
	}

	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}
	
	
  	ajaxRequest.onreadystatechange = function checkstate()
	{

		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
				   var resulttext = ajaxRequest.responseText;

			   		if (resulttext.indexOf("lostpassword") > -1 )
			   		{
						document.getElementById('divresponse').innerHTML = "Invalid User ID and/or Password";
						document.getElementById('bizeditdiv').innerHTML = resulttext;
						document.getElementById('passbizid').value = "";
						document.getElementById('fBiz_ID').value = "";
						document.forms[formname].elements['fBiz_User_ID'].value = "";
						
					}
				else
					{
			   			
			   			
			   			document.getElementById('divresponse').innerHTML = "Logged in";
			   			document.getElementById('bizeditdiv').innerHTML = resulttext;
			   			document.getElementById('passbizid').value = document.forms['bizeditform'].elements['fBiz_ID'].value;
   					}
  			}
		}
	
	}
	if (userid !="")
	{


		ajaxRequest.open("POST", urlparm, true);
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", parameter.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(parameter);
	}
	else
	{
		document.getElementById('divresponse').innerHTML = "Enter User ID and Password";	
	}

}	
	
function ajax_memberlogin()
{
	document.getElementById('divresponse').innerHTML = "logging in...";
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var password = document.getElementById('passmember_pw').value;
	var userid = document.getElementById('passmember_id').value;
	
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_memberlogin.php";
	var parameter = "passmember_id=" + userid + "&passmember_pw=" + password;
	
  	ajaxRequest.onreadystatechange = function checkstate()
	{

		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
					var resulttext = ajaxRequest.responseText;
					document.getElementById('divresponse').innerHTML = resulttext;
					if (resulttext == "member logged in")
					{
						document.getElementById('passmember_ok').innerHTML = "ok";
					}
					else
					{
						document.getElementById('passmember_ok').innerHTML = "";
					}
  			}
		}
	
	}
	if (userid !="")
	{


		ajaxRequest.open("POST", urlparm, true);
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", parameter.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(parameter);
	}
	else
	{
		document.getElementById('divresponse').innerHTML = "Enter Member and Password";	
	}

}	
		
	
function ajax_ptslogin(formname)
{
	document.getElementById('divresponse').innerHTML = "logging in...";
	document.getElementById('bizeditdiv').innerHTML = "";
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;
	var nbroffields = document.forms[formname].length;
	var parameter = "";
	var password = document.forms[formname].elements['fptsclientpassword'].value;
	var userid = document.forms[formname].elements['fptsclientuserid'].value;
	var whatelement = window.event.srcElement.id;
	var mobile = document.getElementById('mobile').value;
	if (whatelement == "")
	{
			whatelement = window.event.srcElement.id;
	}
	var rootlocation = document.getElementById('fphpfiles').value;
	if (whatelement == "loginmenu")
	{
	
		var urlparm = rootlocation + "ajax_edit_client" + mobile + ".php";
//		var urlparm = rootlocation + document.forms[formname].elements['urltocalllogin'].value;	
	}
	if (whatelement == "registermenu")
	{
		var urlparm = rootlocation + document.forms[formname].elements['urltocall'].value;	
	}

	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}
	 
	
  	ajaxRequest.onreadystatechange = function checkstate()
	{

		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
					var resulttext = ajaxRequest.responseText;
						document.getElementById('bizeditdiv').innerHTML = resulttext;
						document.getElementById('divresponse').innerHTML = "Logged in";
						var clientuserid = document.getElementById('fptsclientuserid').value;
					var clientnumber = document.getElementById('fptsclientnumber').value;
					var  calendartarget = document.getElementById('fptsclienttrainer').value;
					document.getElementById('fpassptsclientnumber').value = clientnumber;
					document.getElementById('fpassptsclientuserid').value = clientuserid;
					document.getElementById('fpassptsclienttrainer').value = calendartarget;
					document.getElementById('fpasstarget').value = calendartarget;
					//alert(calendartarget);
					document.getElementById('bizeditdiv').innerHTML = "";
					if (clientnumber == "")
					{
						
						document.getElementById('divresponse').innerHTML = "Invalid Entry";	
					}

  			}
		}
	
	}
	if (userid !="")
	{


		ajaxRequest.open("POST", urlparm, true);
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", parameter.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(parameter);
	}
	else
	{
		document.getElementById('divresponse').innerHTML = "Enter User ID and Password";	
	}

}	
	
	
function ajax_ptsloginedit(formname)
{
	document.getElementById('divresponse').innerHTML = "loading edit...";
	document.getElementById('bizeditdiv').innerHTML = "";
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
		
	// Create a function that will receive data sent from the server
	var counter = 0;

	var nbroffields = document.forms[formname].length;
	var parameter = "";
	var password = document.forms[formname].elements['fptsclientpassword'].value;

	var userid = document.forms[formname].elements['fptsclientuserid'].value;

	var whatelement = window.event.srcElement.id;

	var mobile = document.getElementById('mobile').value;

	
	var rootlocation = document.getElementById('fphpfiles').value;
	if (whatelement == "editmenu")
	{
		var urlparm = rootlocation + "ajax_edit_client" + mobile + ".php";	
	}
	

	for (counter=0 ;counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				parameter = parameter + "&" + newpair;	
			}
		}
	}
	
	
  	ajaxRequest.onreadystatechange = function checkstate()
	{

		 if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
				   var resulttext = ajaxRequest.responseText;

						document.getElementById('bizeditdiv').innerHTML = resulttext;
						document.getElementById('divresponse').innerHTML = "Logged in";
					var clientnumber = document.getElementById('fptsclientnumber').value;
					var  calendartarget = document.getElementById('fptsclienttrainer').value;
					var clientuserid = document.getElementById('fptsclientuserid').value;
					document.getElementById('fpassptsclientuserid').value = clientuserid;
					document.getElementById('fpassptsclientnumber').value = clientnumber;
					document.getElementById('fpassptsclienttrainer').value = calendartarget;
					document.getElementById('fpasstarget').value = calendartarget;
					//alert(calendartarget);
					if (clientnumber == "")
					{
						document.getElementById('bizeditdiv').innerHTML = "";
						document.getElementById('divresponse').innerHTML = "Invalid Entry";	
					}

  			}
		}
	
	}
	if (userid !="")
	{


		ajaxRequest.open("POST", urlparm, true);
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", parameter.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(parameter);
	}
	else
	{
		document.getElementById('divresponse').innerHTML = "Enter User ID and Password";	
	}

}	
		

 
   function showradio($strVideo) 
{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
     var $intHeight = 60;
     var $intWidth = 300;
     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'showradio', 'status=yes,menubar=no,toolbar=no,resizable=no,width=' + String($intWidth) + ',height=' + String($intHeight))       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'showradio', 'resizable=no, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=' + String($intWidth) + ',height=' + String($intHeight)) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();
     win.document.writeln('<HTML><HEAD><TITLE>Wyred Radio Media</TITLE><STYLE>TABLE.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;} TD.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;}</STYLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><TABLE WIDTH="' + String($intWidth) + '" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD CLASS="singlew"><OBJECT ID="MediaPlayer" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=,1,52,701" width=' + String($intWidth) + ' height=' + String($intHeight) + ' standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
     win.document.writeln('<PARAM name="FileName" value="' + $strVideo + '"><PARAM NAME="ShowControls" VALUE="true"><PARAM NAME="ShowStatusBar" VALUE="true">');
     win.document.writeln('<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="' + $strVideo + '" name="MediaPlayer" width=' + String($intWidth) + ' height=' + String($intHeight) + ' ShowControls=1 ShowStatusBar=1></EMBED></OBJECT></TD></TR></TABLE><FONT FACE="Arial" COLOR="#FFFFFF" SIZE="1">&copy;2006 Wyred TV</FONT></CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }


   function vodmovie($strVideo) 
{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
     var $intHeight = 360;
     var $intWidth = 480;
     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'vodmovie', 'status=yes,menubar=no,toolbar=no,resizable=yes,width=' + String($intWidth + 20) + ',height=' + String($intHeight + 100))       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'vodmovie', 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=' + String($intWidth + 20) + ',height=' + String($intHeight + 100)) 
     else 
        window.location="start.html"     
      win.document.open();
     win.document.clear();
     win.document.writeln('<HTML><HEAD><TITLE>Wyred VOD Media</TITLE><STYLE>TABLE.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;} TD.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;}</STYLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><TABLE WIDTH="' + String($intWidth) + '" CELLPADDING="2" CELLSPACING="2" BORDER="0"><TR><TD CLASS="singlew"><OBJECT ID="MediaPlayer" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=,1,52,701" width=' + String($intWidth) + ' height=' + String($intHeight + 60) + ' standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
     win.document.writeln('<PARAM name="FileName" value="' + $strVideo + '"><PARAM NAME="ShowControls" VALUE="true"><PARAM NAME="ShowStatusBar" VALUE="true">');
     win.document.writeln('<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="' + $strVideo + '" name="MediaPlayer" width=' + String($intWidth) + ' height=' + String($intHeight + 60) + ' ShowControls=1 ShowStatusBar=1></EMBED></OBJECT></TD></TR></TABLE><FONT FACE="Arial" COLOR="#FFFFFF" SIZE="1">&copy;2006 Wyred TV</FONT></CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }

   function youtube($strVideo) 
{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
     var $intHeight = 350;
     var $intWidth = 425;

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'vodmovie', 'status=yes,menubar=no,toolbar=no,resizable=yes,width=' + String($intWidth + 20) + ',height=' + String($intHeight + 40))       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'vodmovie', 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=' + String($intWidth + 20) + ',height=' + String($intHeight + 40)) 
     else 
        window.location="start.html"     
      win.document.open();
     win.document.clear();
     win.document.writeln('<HTML><HEAD><TITLE>Wyred VOD Media via Youtube</TITLE><STYLE>TABLE.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;} TD.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;}</STYLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><TABLE WIDTH="' + String($intWidth) + '" CELLPADDING="2" CELLSPACING="2" BORDER="0"><TR><TD CLASS="singlew">');
     win.document.writeln('<object width="425" height="350"><param name="movie" value="' + $strVideo +'&autoplay=1&autoplay=1"></param><param name="wmode" value="transparent"></param>');
     
     win.document.writeln('<embed src="' + $strVideo + '&autoplay=1&autoplay=1" type="application/x-shockwave-flash" width=' + String($intWidth) + ' height=' + String($intHeight) + '></embed></object></TD></TR></TABLE><FONT FACE="Arial" COLOR="#FFFFFF" SIZE="1">&copy;2006 Wyred TV</FONT></CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }




   function showmoviewh($strVideo, $intWidth, $intHeight) 
{

     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
     var $strServer = "http://www.bluestube.com/bluesbooth/";
      $strVideo = $strServer + $strVideo;
     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'vodmovie', 'status=yes,menubar=no,toolbar=no,resizable=yes,width=' + String($intWidth + 20) + ',height=' + String($intHeight + 100))       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'vodmovie', 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=' + String($intWidth + 20) + ',height=' + String($intHeight + 100)) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();
     win.document.writeln('<HTML><HEAD><TITLE>Wyred VOD Media</TITLE><STYLE>TABLE.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;} TD.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;}</STYLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><TABLE WIDTH="' + String($intWidth) + '" CELLPADDING="2" CELLSPACING="2" BORDER="0"><TR><TD CLASS="singlew"><OBJECT ID="MediaPlayer" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=,1,52,701" width=' + String($intWidth) + ' height=' + String($intHeight + 60) + ' standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
     win.document.writeln('<PARAM name="FileName" value="' + $strVideo + '"><PARAM NAME="ShowControls" VALUE="true"><PARAM NAME="ShowStatusBar" VALUE="true">');
     win.document.writeln('<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="' + $strVideo + '" name="MediaPlayer" width=' + String($intWidth) + ' height=' + String($intHeight + 60) + ' ShowControls=1 ShowStatusBar=1></EMBED></OBJECT></TD></TR></TABLE><FONT FACE="Arial" COLOR="#FFFFFF" SIZE="1">&copy;2006 Wyred TV</FONT></CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }


   function showmovie($strVideo, $intWidth, $intHeight, $strVideoPath) 
{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'vodmovie', 'status=yes,menubar=no,toolbar=no,resizable=yes,width=' + String($intWidth + 20) + ',height=' + String($intHeight + 100))       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'vodmovie', 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=' + String($intWidth + 20) + ',height=' + String($intHeight + 100)) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();
     win.document.writeln('<HTML><HEAD><TITLE>Wyred VOD Media</TITLE><STYLE>TABLE.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;} TD.singlew {border-width: 2; border-style: solid; border-color: #FFFFFF;}</STYLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><TABLE WIDTH="' + String($intWidth) + '" CELLPADDING="2" CELLSPACING="2" BORDER="0"><TR><TD CLASS="singlew"><OBJECT ID="MediaPlayer" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=,1,52,701" width=' + String($intWidth) + ' height=' + String($intHeight + 60) + ' standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
     win.document.writeln('<PARAM name="FileName" value="' + $strVideoPath + $strVideo + '"><PARAM NAME="ShowControls" VALUE="true"><PARAM NAME="ShowStatusBar" VALUE="true">');
     win.document.writeln('<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="' + $strVideoPath + $strVideo + '" name="MediaPlayer" width=' + String($intWidth) + ' height=' + String($intHeight + 60) + ' ShowControls=1 ShowStatusBar=1></EMBED></OBJECT></TD></TR></TABLE><FONT FACE="Arial" COLOR="#FFFFFF" SIZE="1">&copy;2006 Wyred TV</FONT></CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }

  
function livemovie($strVideo) 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
    var $intHeight = 240;
     var $intWidth = 320;
    var $message="Function Disabled!";

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'livemovie', 'status=yes,menubar=no,toolbar=no,resizable=yes,width=' + String($intWidth + 20) + ',height=' + String($intHeight + 60))       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'livemovie', 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=' + String($intWidth + 20) + ',height=' + String($intHeight + 100)) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><OBJECT ID="MediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width=' + String($intWidth) + ' height=' + String($intHeight + 46) + ' standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
     
     win.document.writeln('<PARAM name="Url" value="' + $strVideo + '"><PARAM NAME="ShowControls" VALUE="true"><PARAM NAME="uniMode" VALUE="mini"><PARAM NAME="ShowStatusBar" VALUE="true"><PARAM NAME="enableContextmenu" VALUE="false">');
     win.document.writeln('<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="' + $strVideo + '" name="MediaPlayer" width=' + String($intWidth) + ' height=' + String($intHeight + 46) + ' uniMode="mini" enableContextmenu="false" ShowControls=1 ShowStatusBar=1></EMBED></OBJECT><FONT FACE="Arial" COLOR="#FFFFFF" SIZE="1">&copy;2006 Bluestube</FONT></CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }
   
function livemoviesmall($strVideo) 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
    var $intHeight = 200;
     var $intWidth = 240;
    var $message="Function Disabled!";

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'livemoviesmall', 'status=yes,menubar=no,toolbar=no,resizable=yes,width=' + String($intWidth) + ',height=' + String($intHeight))       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'livemoviesmall', 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=' + String($intWidth) + ',height=' + String($intHeight)) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><OBJECT ID="MediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width=' + String($intWidth) + ' height=' + String($intHeight) + ' standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
     
     win.document.writeln('<PARAM name="Url" value="' + $strVideo + '"><PARAM NAME="ShowControls" VALUE="true"><PARAM NAME="uniMode" VALUE="mini"><PARAM NAME="ShowStatusBar" VALUE="true"><PARAM NAME="enableContextmenu" VALUE="false">');
     win.document.writeln('<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="' + $strVideo + '" name="MediaPlayer" width=' + String($intWidth) + ' height=' + String($intHeight) + ' uniMode="mini" enableContextmenu="false" ShowControls=1 ShowStatusBar=1></EMBED></OBJECT><FONT FACE="Arial" COLOR="#FFFFFF" SIZE="1">&copy;2006 Bluestube</FONT></CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }
   
   

function livemoviearray($BroadcastPoint) 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
    var $intHeight = 240;
     var $intWidth = 320;
    var $message="Function Disabled!";
    
	$strVideo = $BroadcastPoint;
     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'livemovie', 'status=yes,menubar=no,toolbar=no,resizable=yes,width=' + String($intWidth + 20) + ',height=' + String($intHeight + 60))       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'livemovie', 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=' + String($intWidth + 20) + ',height=' + String($intHeight + 100)) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><OBJECT ID="MediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width=' + String($intWidth) + ' height=' + String($intHeight + 46) + ' standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
     
     win.document.writeln('<PARAM name="Url" value="' + $strVideo + '"><PARAM NAME="ShowControls" VALUE="true"><PARAM NAME="uniMode" VALUE="mini"><PARAM NAME="ShowStatusBar" VALUE="true"><PARAM NAME="enableContextmenu" VALUE="false">');
     win.document.writeln('<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="' + $strVideo + '" name="MediaPlayer" width=' + String($intWidth) + ' height=' + String($intHeight + 46) + ' uniMode="mini" enableContextmenu="false" ShowControls=1 ShowStatusBar=1></EMBED></OBJECT><FONT FACE="Arial" COLOR="#FFFFFF" SIZE="1">&copy;2006 Bluestube</FONT></CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }


function wyredtv($strVideo) 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
    var $intHeight = 600;
     var $intWidth = 800;
     var $webcast = $strVideo;
    var $message="Function Disabled!";

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'wyredtv_' + $webcast , 'status=yes,menubar=no,toolbar=no,resizable=yes,width=600,height=400')       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'wyredtv_' + $webcast , 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, width=600,height=400') 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred LIVE Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><embed src="http://www.tbarratt.com/php/embed/mediaplayer.swf" width="480" height="360" allowscriptaccess="always" allowfullscreen="true" flashvars="height=360&width=480&file=rtmp://liveblues.ca/livecasts/' + $webcast + '&id=' + $webcast + '&backcolor=0x000000&lightcolor=0x999999&screencolor=0x3333FF&autostart=true&logo=http://www.tbarratt.com/wyredtvwebcast_logo_80.gif&showdownload=true"/>');
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }


function wyredtvcam($strVideo) 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
    var $intHeight = 600;
     var $intWidth = 800;
     var $webcast = $strVideo.split("|");




     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'wyredcam_' + $webcast[1], 'status=yes,menubar=no,toolbar=no,resizable=yes,width=200,height=600')       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = open('', 'wyredcam_' + $webcast[1] , 'resizable=yes, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, width=200,height=600'); 
     else 
        window.location="start.html";     

     win.document.open();
     win.document.clear();	 
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Cam ' + $webcast[1] + '</TITLE></HEAD><FRAMESET cols="100%"><FRAME src="' + $webcast[0] + '"></FRAMESET></HTML>');

     if (win.window.focus) {win.window.focus();}
   }





function mtv($strVideo) 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion) 
    var $intHeight = 600;
     var $intWidth = 800;
     var $webcast = $strVideo.split("|");
     var $intHeight = $webcast[2];
     var $intWidth = $webcast[1];

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'mtv_' + $webcast[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'mtv_' + $webcast[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0"><CENTER><embed width="' + $intWidth + '" height="'+ $intHeight + '" src="http://www.blogtv.com/livesdk/' + $webcast[0] + '" type="application/x-shockwave-flash" allowFullScreen="true"></embed>');
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }


function vodtv($strVideo) 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion)
     var $intHeight = 600;
     var $intWidth = 800;
	 var $strPassedData =  $strVideo.split("~");
     var $strpart = $strPassedData[1].split("|");
     var $strtopass = $strPassedData[0].split("|");
     var $intHeight = parseInt($strpart[3]) + parseInt($strpart[2]);
     var $intWidth = $strpart[1];

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'vodtv_' + $strpart[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'vodtv_' + $strpart[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
     var $player = $strtopass[0] + 'embed/mediaplayer.swf';
     var $strxmllist = $strtopass[0] + 'flvplaylist.php?ftarget=' + $strpart[0] + '|' + $strtopass[1] + '|' + $strtopass[2];
     
				     
	 var $strTempItem = '<center><embed src="' + $player + '" width="' + $intWidth + '" height="' + $intHeight + '" allowscriptaccess="always" allowfullscreen="true" flashvars="height=' + $intHeight + '&width=' + $intWidth + '&file=' + $strxmllist + '&backcolor=0x000000&frontcolor=0xFFFF99&lightcolor=0xFFFF99&displayheight=' + $strpart[2] + '&link=http://www.clickintown.com&linktarget=http://www.clickintown.com&captions=true&autoscroll=false"/></center>';
					
				  
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0">' + $strTempItem);
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }

function vodmp3($strVideo) 

{
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion)
     var $intHeight = 600;
     var $intWidth = 800;
	 var $strPassedData =  $strVideo.split("~");
     var $strpart = $strPassedData[1].split("|");
     var $strtopass = $strPassedData[0].split("|");
     var $intHeight = parseInt($strpart[3]) + parseInt($strpart[2]);
     var $intWidth = $strpart[1];

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'vodmp3_' + $strpart[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'vodmp3_' + $strpart[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
     var $player = $strtopass[0] + 'embed/mediaplayer.swf';
     var $strxmllist = $strtopass[0] + 'mp3playlist.php?ftarget=' + $strpart[0] + '|' + $strtopass[1] + '|' + $strtopass[2];
     
				     
	 var $strTempItem = '<center><embed src="' + $player + '" width="' + $intWidth + '" height="' + $intHeight + '" allowscriptaccess="always" allowfullscreen="true" flashvars="height=' + $intHeight + '&width=' + $strpart[1] + '&file=' + $strxmllist + '&backcolor=0x000000&frontcolor=0xFFFF99&lightcolor=0xFFFF99&displayheight=' + $strpart[2] + '&link=http://www.clickintown.com&linktarget=http://www.clickintown.com&captions=true&autoscroll=false"/></center>';
					
				  
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0">' + $strTempItem);
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }


function artistJB() 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion)
     var $intHeight = 600;
     var $intWidth = 800;
     var $strPassed = window.event.srcElement.form.fpassed.value;
	 var $strpart = $strPassed.split("|");
     var $intDisplay = $strpart[2];
     var $intHeight = $strpart[1];
     var $intWidth = $strpart[0];
     var $dbuser = $strpart[3];
     var $database = $strpart[4];
     var $player = $strpart[5];
     var $strxmllist = $strpart[6];
     
     var $target = window.event.srcElement.form.ftarget.value;
     var $artist = window.event.srcElement.form.fartist.value;
     var $strNames = $artist.split(" ");

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'artistjb_' + $strNames[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'artistjb_' + $strNames[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
     
     var $strxmllist = $strxmllist + '?ftarget=' + $target + '|' + $artist + '|' + $dbuser + '|' + $database;
     
				     
	 var $strTempItem = '<center><embed src="' + $player + '" width="' + $intWidth + '" height="' + $intHeight + '" allowscriptaccess="always" allowfullscreen="true" flashvars="height=' + $intHeight + '&width=' + $intWidth + '&file=' + $strxmllist + '&backcolor=0x000000&frontcolor=0xFFFF99&lightcolor=0xFFFF99&displayheight=' + $intDisplay + '&link=http://www.clickintown.com&linktarget=http://www.clickintown.com&captions=true&autoscroll=false"/></center>';
					
				  
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0">' + $strTempItem);
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }
   


   function anyplaylistJB() 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion)
     var $intHeight = 600;
     var $intWidth = 800;
     var $strPassed = window.event.srcElement.form.fpassed.value;
	 var $strpart = $strPassed.split("|");
     var $intDisplay = $strpart[2];
     var $intHeight = $strpart[1];
     var $intWidth = $strpart[0];
     var $dbuser = $strpart[3];
     var $database = $strpart[4];
     var $player = $strpart[5];
     var $strxmllist = $strpart[6];
     
     var $target = window.event.srcElement.form.ftarget.value;
     var $exercise = window.event.srcElement.form.fexercise.value;
     var $strNames = $exercise.split(" ");

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'anyplaylistjb_' + $strNames[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'anyplaylistjb_' + $strNames[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
     
     var $strxmllist = $strxmllist + '?ftarget=' + $target + '|' + $exercise + '|' + $dbuser + '|' + $database;
    
//	var $strTempItem =  "<script type='text/javascript'>jwplayer('container').setup({ flashplayer: 'http://www.tbarratt.com/php/java/player.swf', playlist: [ { file: 'http://www.tbarratt.com/fitness/dblclick.mp4', image: 'http://www.tbarratt.com/fitness/tricep2.jpg' }, { file: 'http://www.tbarratt.com/fitness/UB_Bicep_Curl_CABLE_2.mp4', image: 'http://www.tbarratt.com/fitness/trappull1.jpg' }, { file: 'http://www.tbarratt.com/fitness/dblclick.mp4', image: 'http://www.tbarratt.com/fitness/trappull1.jpg' } ], 'playlist.position': 'right', 'playlist.size': 360, height:" + $intHeight + " , width: " + $intWidth + "}),</script>";		     
	 
	 var $strTempItem = '<center><embed src="' + $player + '" width="' + $intWidth + '" height="' + $intHeight + '" allowscriptaccess="always" allowfullscreen="true" flashvars="height=' + $intHeight + '&width=' + $intWidth + '&file=' + $strxmllist + '&backcolor=0x000000&frontcolor=0xFFFF99&lightcolor=0xFFFF99&displayheight=' + $intDisplay + '&link=http://www.clickintown.com&linktarget=http://www.clickintown.com&caption=true&autoscroll=false"/></center>';
					
				  
 	win.document.writeln('<HTML><HEAD><TITLE>tbarratt Video</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0">' + $strTempItem);
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }



   function anyistJB() 

{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion)
     var $intHeight = 600;
     var $intWidth = 800;
     var $strPassed = window.event.srcElement.form.fpassed.value;
	 var $strpart = $strPassed.split("|");
     var $intDisplay = $strpart[2];
     var $intHeight = $strpart[1];
     var $intWidth = $strpart[0];
     var $dbuser = $strpart[3];
     var $database = $strpart[4];
     var $player = $strpart[5];
     var $strxmllist = $strpart[6];
     
     var $target = window.event.srcElement.form.ftarget.value;
     var $artist = window.event.srcElement.form.fartist.value;
     var $strNames = $artist.split(" ");

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'anyistjb_' + $strNames[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'anyistjb_' + $strNames[0] , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
     
     var $strxmllist = $strxmllist + '?ftarget=' + $target + '|' + $artist + '|' + $dbuser + '|' + $database;
    
				     
	 var $strTempItem = '<center><embed src="' + $player + '" width="' + $intWidth + '" height="' + $intHeight + '" allowscriptaccess="always" allowfullscreen="true" flashvars="height=' + $intHeight + '&width=' + $intWidth + '&file=' + $strxmllist + '&backcolor=0x000000&frontcolor=0xFFFF99&lightcolor=0xFFFF99&displayheight=' + $intDisplay + '&link=http://www.clickintown.com&linktarget=http://www.clickintown.com&caption=true&autoscroll=false"/></center>';
					
				  
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0">' + $strTempItem);
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }

function bizJB() 

   
{

     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion)
     var $intHeight = 600;
     var $intWidth = 800;
     var $strPassed = window.event.srcElement.form.fpassed.value;
	 var $strpart = $strPassed.split("|");
     var $intDisplay = $strpart[2];
     var $intHeight = $strpart[1];
     var $intWidth = $strpart[0];
     var $dbuser = $strpart[3];
     var $database = $strpart[4];
     var $player = $strpart[5];
     var $strxmllist = $strpart[6];
     var $target = window.event.srcElement.form.ftarget.value;
     var $artist = window.event.srcElement.form.fartist.value;
     var $strNames = $artist;

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'bizjb_' + $strNames , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'bizjb_' + $strNames , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
     
     var $strxmllist = $strxmllist + '?bizid=' + $artist;
     //alert($strxmllist);
				     
	 var $strTempItem = '<center><embed src="' + $player + '" width="' + $intWidth + '" height="' + $intHeight + '" allowscriptaccess="always" allowfullscreen="true" flashvars="height=' + $intHeight + '&width=' + $intWidth + '&file=' + $strxmllist + '&backcolor=0x000000&frontcolor=0xFFFF99&lightcolor=0xFFFF99&displayheight=' + $intDisplay + '&link=http://www.clickintown.com&linktarget=http://www.clickintown.com&captions=true&autoscroll=false"/></center>'; 
					
				  
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0">' + $strTempItem);
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}

   }
   
   function bookJB() 

   
{

     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion)
     var $intHeight = 600;
     var $intWidth = 800;
     var $strPassed = window.event.srcElement.form.fpassed.value;
	 var $strpart = $strPassed.split("|");
     var $intDisplay = $strpart[2];
     var $intHeight = $strpart[1];
     var $intWidth = $strpart[0];
     var $dbuser = $strpart[3];
     var $database = $strpart[4];
     var $player = $strpart[5];
     var $strxmllist = $strpart[6];
     
     var $target = window.event.srcElement.form.ftarget.value;
     var $artist = window.event.srcElement.form.fartist.value;
     var $strNames = $artist;

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'bookjb_' + $strNames , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'bookjb_' + $strNames , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
     
     var $strxmllist = $strxmllist + '?ftarget=' + $target + '|' + $artist + '|' + $dbuser + '|' + $database;
     
				     
	 var $strTempItem = '<center><embed src="' + $player + '" width="' + $intWidth + '" height="' + $intHeight + '" allowscriptaccess="always" allowfullscreen="true" flashvars="height=' + $intHeight + '&width=' + $intWidth + '&file=' + $strxmllist + '&backcolor=0x000000&frontcolor=0xFFFF99&lightcolor=0xFFFF99&displayheight=' + $intDisplay + '&link=http://www.clickintown.com&linktarget=http://www.clickintown.com&captions=true&autoscroll=false"/></center>';
					
				  
 	win.document.writeln('<HTML><HEAD><TITLE>Wyred TV Media</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0">' + $strTempItem);
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}

   }


function btvJB() 

   
{
     
     var browser_type=navigator.appName
     var browser_version=parseInt(navigator.appVersion)
     var $intHeight = 600;
     var $intWidth = 800;
     var $strPassed = window.event.srcElement.form.fpassed.value;
	 var $strpart = $strPassed.split("|");
     var $intHeight = $strpart[1];
     var $intWidth = $strpart[0];
     var $dbuser = $strpart[2];
     var $database = $strpart[3];
     var $player = $strpart[4];
     var $strxmllist = $strpart[5];
     
     var $target = window.event.srcElement.form.ftarget.value;
     var $artist = window.event.srcElement.form.fartist.value;
     var $strNames = window.event.srcElement.form.fartist.value;

     if (browser_type=="Netscape"&&browser_version>=4)
        win = window.open('', 'btvjb_' + $strNames , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight )       
     else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4) 
        win = window.open('', 'btvjb_' + $strNames , 'status=yes,menubar=no,toolbar=no,resizable=yes,width='+$intWidth + ',height='+ $intHeight  ) 
     else 
        window.location="start.html"     

     win.document.open();
     win.document.clear();	 
     var $strSite = 'http://www.blogtv.com/livesdk/' + $artist;
     
				     
	 var $strTempItem = '<center><embed width="' + $intWidth + '" height="' + $intHeight + '" src="' + $strSite +'" type="application/x-shockwave-flash" allowFullScreen="true"></embed></center>';
					
				  
 	win.document.writeln('<HTML><HEAD><TITLE>BlogTV Feed</TITLE></HEAD><BODY BGCOLOR="#000000" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" MARGINWIDTH="0" LEFTMARGIN="0" RIGHTMARGIN="0">' + $strTempItem);
     
     win.document.writeln('</CENTER></BODY></HTML>');

     if (win.window.focus) {win.window.focus();}
   }



function ajaxExtypesListFunction()
{
	document.getElementById("divresponse").innerHTML = "Loading Exercise List";

	document.getElementById('citnewsdiv').innerHTML = "";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	
	var extypes = document.getElementById('Extype').value;
	
	var musclelist = document.getElementById('Musclelist').value;
	var parameter  = "Extype=" + extypes;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "musclelist.php";
	
		
	
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
			var counter = 0;
			var muscles = resulttext.split('|') ;
			var muscleslen = muscles.length;
			var muscledata = "";
			var muscleid = "";
			var musclemname = "";
			document.getElementById("Musclelist").length = 0;
			//document.getElementById("Musclelist").options[counter] = new Option(musclename, muscleid, false, false);
			for (counter = 0; counter <= muscleslen; ++counter)  
			{
				muscledata = muscles[counter].split('-');
				muscleid =  muscledata[0];
				musclename = muscledata[1];
				document.getElementById("Muscles").options[counter + 1] = new Option(musclename, muscleid, false, false);
				if (counter == 0)
				{
					document.getElementById("passmusclegroup").value = muscledata[1];
				}
			}
			document.getElementById("divresponse").innHTML = "";
			document.getElementById('citnewsdiv').innerHTML = "";
		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
	
}


function ajaxMuscleListFunction()
{
	document.getElementById("divresponse").innerHTML = "Loading Muscle Groups";
	document.getElementById("Exercises").style.visibility = "visible" ;
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server

	var extypes = document.getElementById('Extype').value;
	

	var parameter  = "Extype=" + extypes;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "musclelist.php";
	
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
	
			var counter = 0;
			var muscles = resulttext.split('|') ;

			var muscleslen = muscles.length;

			var muscledata = "";
			var muscleid = "";
			var musclename = "";
			var topass = "";

			document.getElementById("Musclegroup").length = 0;

			//document.getElementById("Musclegroup").options[counter] = new Option(musclename, muscleid, false, false);

			for (counter = 0; counter <= muscleslen - 1; ++counter)  
			{

				muscledata = muscles[counter].split('-');
				
				
				muscleid =  muscledata[0];
				musclename = muscledata[1];
				if (counter == 0)
				{
					
					document.getElementById("passmusclegroup").value = musclename;
					
				}

				document.getElementById("Musclegroup").options[counter] = new Option(musclename, muscleid, false, false);
				
			}

			document.getElementById("divresponse").innHTML = "";
			ajaxDefaultExerciseListFunction();
			
			
		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
	
	
	
}

function ajaxDefaultExerciseListFunction()
{
	document.getElementById("divresponse").innerHTML = "Loading Exercises";
//alert("exercise function");
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server

	var extypes = document.getElementById('Extype').value;
	var musclegroup = document.getElementById('passmusclegroup').value;

	
	//var musclegroup = document.getElementById('Musclegroup').value;
//	alert("here " + extypes + musclegroup);

	var parameter  = "Extype=" + encodeURIComponent(extypes) + "&Musclegroup=" + encodeURIComponent(musclegroup);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "exerciselist.php";
	
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
			//alert("ex results " + resulttext);
			var counter = 0;
			var exercises = resulttext.split('|') ;
	
			var exerciseslen = exercises.length;
			
			var exercisedata = "";
			var exerciseid = "";
			var exercisename = "";
			document.getElementById("Exercises").length = 0;
			
//			document.getElementById("Exercises").options[counter] = new Option(exercisename, exerciseid, false, false);
	
			for (counter = 0; counter <= exerciseslen - 1; ++counter)  
			{

				
				exercisedata = exercises[counter].split('-');
				
				exerciseid =  exercisedata[0];
				exercisename = exercisedata[1];
				
				document.getElementById("Exercises").options[counter] = new Option(exercisename, exerciseid, false, false);
				
				
				
			}
			//document.getElementById("Exercises").options.selectedindex = 0;
			document.getElementById("divresponse").innHTML = "";
			//document.getElementById("passmusclegroup").value = document.getElementById('Musclegroup').value;

		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}



function ajaxExerciseListFunction()
{
	document.getElementById("divresponse").innerHTML = "Loading Exercises";
//alert("exercise function");
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server

	var extypes = document.getElementById('Extype').value;
	var musclegroup = document.getElementById('Musclegroup').value;

	
	//var musclegroup = document.getElementById('Musclegroup').value;
//	alert("here " + extypes + musclegroup);

	var parameter  = "Extype=" + encodeURIComponent(extypes) + "&Musclegroup=" + encodeURIComponent(musclegroup);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "exerciselist.php";
	
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
			//alert("ex results " + resulttext);
			var counter = 0;
			var exercises = resulttext.split('|') ;
	
			var exerciseslen = exercises.length;
			
			var exercisedata = "";
			var exerciseid = "";
			var exercisename = "";
			document.getElementById("Exercises").length = 0;
			
//			document.getElementById("Exercises").options[counter] = new Option(exercisename, exerciseid, false, false);
	
			for (counter = 0; counter <= exerciseslen - 1; ++counter)  
			{

				
				exercisedata = exercises[counter].split('-');
				
				exerciseid =  exercisedata[0];
				exercisename = exercisedata[1];
				
				document.getElementById("Exercises").options[counter] = new Option(exercisename, exerciseid, false, false);
				
				
				
			}
			//document.getElementById("Exercises").options.selectedindex = 0;
			document.getElementById("divresponse").innerHTML = "";
			//document.getElementById("passmusclegroup").value = document.getElementById('Musclegroup').value;

		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}

function ajaxMyExerciseListFunction()
{
	document.getElementById("divresponse").innerHTML = "Loading My Exercises";
//alert("exercise function");
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server

	var extypes = document.getElementById('Extype').value;
	var musclegroup = document.getElementById('Musclegroup').value;
	var clientnumber = document.getElementById('fptsclientnumber').value;
//alert("here " + clientnumber)
	var parameter  = "Extype=" + encodeURIComponent(extypes) + "&Musclegroup=" + encodeURIComponent(musclegroup) + "&fpassptsclientnumber=" + encodeURIComponent(clientnumber);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "myexerciselist.php";
	
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
		//	alert(resulttext);
			document.getElementById("myexerciselist").innerHTML = resulttext;
			document.getElementById("divresponse").innerHTML = "";

		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}




function ajax_PlayExercises()
{
	document.getElementById("divresponse").innerHTML = "Playing Video";
//	document.getElementById("inlineplayer").innHTML = "";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	
	
	var pointer = document.getElementById('Extype').selectedIndex;

	var extypes = document.getElementById('Extype').options[pointer].text;

	//var musclegroup = document.getElementById('passmusclegroup').value;
	pointer = document.getElementById('Musclegroup').selectedIndex;

	var musclegroup = document.getElementById('Musclegroup').options[pointer].text;

	//var musclegroup = document.getElementById('Musclegroup').selected.text;
	pointer = document.getElementById('Exercises').selectedIndex;
	//alert("here " + pointer);
	var mobile = document.getElementById('mobile').value;
	var exercisename = document.getElementById('Exercises').options[pointer].text;

	//alert("here " + extypes + musclegroup + exercisename );
	//var exerciseid = document.getElementById('Exercises').selected.name;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "playexercise" + mobile + ".php";
	var parameter =	"Exercisename="	+ exercisename + "&Extype=" +  extypes + "&Musclegroup=" + musclegroup;
	//alert("param " + urlparm);
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
			//alert(resulttext);
			document.getElementById("inlineplayer").innerHTML = resulttext;
			//alert("here " +resulttext);
			document.getElementById("divresponse").innerHTML = "";
		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}


function ajaxDisplayExerciseDetail()
{
	document.getElementById("divresponse").innerHTML = "Exercise Detail";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	var whatelement = window.event.srcElement.name;
	if (whatelement =="")
	{
		var whatelement = window.event.srcElement.id;	
	}
//	alert(whatelement);
	var clientnumber  = document.getElementById('fptsclientnumber').value;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "displayexercisedetail.php";
	var exerciseid = document.getElementById(whatelement).name;

	
	
	var parameter = "exerciseid=" + exerciseid + "&fpassptsclientnumber=" + clientnumber;
//	alert(parameter);
	
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
			//alert(resulttext);
			document.getElementById("exercisedetail").innerHTML = resulttext;
		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}

function ajaxHideDetail()
{
	document.getElementById("exercisedetail").innerHTML = "";
}

function ajaxHideExercises()
{
	document.getElementById("myexerciselist").innerHTML = "";
}

function ajax_SelectExercises()
{
	document.getElementById("divresponse").innerHTML = "Adding Exercise";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server

	var pointer = document.getElementById('Extype').selectedIndex;

	var extypes = document.getElementById('Extype').options[pointer].text;


	pointer = document.getElementById('Musclegroup').selectedIndex;

	var musclegroup = document.getElementById('Musclegroup').options[pointer].text;


	pointer = document.getElementById('Exercises').selectedIndex;

	var mobile = document.getElementById('mobile').value;
	var exercisename = document.getElementById('Exercises').options[pointer].text;

	//var exerciseid = document.getElementById('pts_exercise_id').value;
	
	var clientnumber  = document.getElementById('fptsclientnumber').value;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "selectexercise.php";	
	
	var parameter = "Extype=" + extypes + "&Musclegroup=" + musclegroup + "&Exercisename=" + exercisename + "&fptsclientnumber=" + clientnumber;
	
	
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
			
			document.getElementById("divresponse").innerHTML = "Exercise added";
		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}


function ajax_RemoveExercises()
{
	document.getElementById("divresponse").innerHTML = "Adding Exercise";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	var pointer = document.getElementById('Extype').selectedIndex;

	var extypes = document.getElementById('Extype').options[pointer].text;

	//var musclegroup = document.getElementById('passmusclegroup').value;
	pointer = document.getElementById('Musclegroup').selectedIndex;

	var musclegroup = document.getElementById('Musclegroup').options[pointer].text;

	//var musclegroup = document.getElementById('Musclegroup').selected.text;
	pointer = document.getElementById('Exercises').selectedIndex;
	//alert("here " + pointer);
	var mobile = document.getElementById('mobile').value;
	var exercisename = document.getElementById('Exercises').options[pointer].text;

	
	var clientnumber  = document.getElementById('fptsclientnumber').value;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "selectexercise.php";	
	var parameter = "fptsclientnumber=" + clientnumber + "&Exercisename="	+ exercisename + "&Extype=" +  extypes + "&Musclegroup=" + musclegroup;
	
	
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
			//alert(resulttext);
			document.getElementById("divresponse").innerHTML = "Exercise Removed";
		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}
var formname = "";
function ajaxTownlistFunction(formname)
{
	document.getElementById("divresponse").innerHTML = "Loading Town List";
	document.getElementById('citnewsdiv').innerHTML = "";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	
	var stateprov = document.getElementById('fTargetStateProv').value;
	
	var townlist = document.getElementById('fTargetTownID').value;
	var parameter  = "";
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "cittownlist.php";
	var nbroffields = document.forms[formname].length;
		
	for (counter=0; counter < nbroffields; ++counter)
	{
		var newpair = document.forms[formname].elements[counter].name + "=" + encodeURIComponent(document.forms[formname].elements[counter].value);
		if (parameter == "")
		{
			if (newpair != "undefined=undefined")
			{
				parameter = newpair;	
			}
			
		}
		else
		{
			
			if (newpair != "undefined=undefined")
			{
				
				parameter = parameter + "&" + newpair;
			
			}
		}
	}
	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{

			var resulttext = ajaxRequest.responseText;
			var counter = 0;
			var towns = resulttext.split('|') ;
			var townslen = towns.length;
			var towndata = "";
			var townid = "";
			var townname = "";
			document.getElementById("fTargetTownID").length = 0;
			document.getElementById("fTargetTownID").options[counter] = new Option(townname, townid, false, false);
			for (counter = 0; counter <= townslen; ++counter)  
			{
				towndata = towns[counter].split('-');
				townid =  towndata[0];
				townname = towndata[1];
				document.getElementById("fTargetTownID").options[counter + 1] = new Option(townname, townid, false, false);
				
			}
			document.getElementById("divresponse").innHTML = "";
			document.getElementById('citnewsdiv').innerHTML = "";
		}
	}
	ajaxRequest.open("POST", urlparm, true);

	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}



function ajaxLoadBusinessFunction()
{
	
	
	if (document.getElementById('fTargetTownID').value !="") 
	{
	document.getElementById('divresponse').innerHTML = "loading businesses";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server

	var stateprov = document.getElementById('fTargetStateProv').value;
	var category = document.getElementById('fTargetCategory').value;
	var townlist = document.getElementById('fTargetTownID').value;
	var fkeydata =    document.getElementById('fkey').value;
	var params  = '?ftarget=clickintown &fTargetTownID=' + townlist + '&fTargetCategory=' + category  + '&fTargetStateProv=' + stateprov + '&fkeys=' + fkeydata;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_page_cit.php";
	
	ajaxRequest.open("GET", urlparm + params, true);

	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{
			var resulttext = ajaxRequest.responseText;
			document.getElementById('citnewsdiv').innerHTML = resulttext;
			document.getElementById('SCHEDULE').style.visibility = "visible";
			document.getElementById('LOGON_REGISTER').style.visibility = "visible";
			document.getElementById('passtownid').value = document.getElementById('fTargetTownID').value;
			document.getElementById('passtownid1').value = document.getElementById('fTargetTownID').value;
			document.getElementById('fTargetTown').value = document.getElementById('fTargetTownName').value;			
			document.getElementById('fkey').value = "";
			document.getElementById('divresponse').innerHTML = "";
			
		}
	}
	ajaxRequest.send(null);
	ajaxUpdateWeatherFunction();
	ajaxUpdateTownLogoFunction();
	}
}


function ajaxLoadBooksFunction()
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server


	var fkeydata =    document.getElementById('fkey').value;
	var params  = '?ftarget=books&fkeys=' + fkeydata;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_page_books.php";
	
	ajaxRequest.open("GET", urlparm + params, true);

	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{
			var resulttext = ajaxRequest.responseText;

			document.getElementById('businesslist').innerHTML = resulttext;
			document.getElementById('SCHEDULE').style.visibility = "visible";
			document.getElementById('LOGON_REGISTER').style.visibility = "visible";
			document.getElementById('passtownid').value = document.getElementById('fTargetTownID').value;
			document.getElementById('passtownid1').value = document.getElementById('fTargetTownID').value;
			document.getElementById('passtownid2').value = document.getElementById('fTargetTownID').value;
			document.getElementById('fkey').value = "";
			
			
		}
	}
	ajaxRequest.send(null);

}


function ajaxLoadMemberFunction()
{
	
	var whatelement = window.event.srcElement.id;
	var rootlocation = document.getElementById('fphpfiles').value;
	if (whatelement == "load_member")
	{
		document.getElementById('divresponse').innerHTML = "loading member";
		var urlparm = rootlocation + "ajax_addmember.php";
	}
	else
	{
		document.getElementById('divresponse').innerHTML = "loading event";
		var urlparm = rootlocation + "ajax_addmemberevent.php";
	}
	document.getElementById('bizeditdiv').innerHTML = "";
	var ajaxRequest;  // The variable that makes Ajax possible!

	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server



	var parameter  = "ftarget=" + document.getElementById('ftarget').value + "&fpageid=" + pageid + "&fkeys=" + document.getElementById('fkeys').value + "&feditmode=" + document.getElementById('feditmode').value + "&member_id=" + document.getElementById('member_id').value + "&event_id=" + document.getElementById('event_id').value;


	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
				//alert(resulttext);
			   document.getElementById('bizeditdiv').innerHTML = resulttext;
   	
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm , true);
	
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}




var pageid = "001";
function ajaxLoadNewsFunction(pageid)
{
	
	document.getElementById('divresponse').innerHTML = "loading data";
	var ajaxRequest;  // The variable that makes Ajax possible!

	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server



	var parameter  = "ftarget=" + document.getElementById('ftarget').value + "&fpageid=" + pageid + "&fkeys=" + document.getElementById('fkeys').value + "&feditmode=" + document.getElementById('feditmode').value ;

	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_news.php";
	

	
	var whatelement = window.event.srcElement.id;
	

	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('citnewsdiv').innerHTML = resulttext;
			   document.getElementById('divresponse').innerHTML = "";
			   document.getElementById('fkeys').value = "";
   	
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm , true);
	
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}

var pageid = "001";
function ajaxLoadNewsViaKey(pageid)
{

	//alert("key " + window.event.keyCode);
	if (window.event.keyCode == 13)
	{
		var result = ajaxLoadNewsFunction(pageid);	
	
	}
}


var pageid = "001";
function ajaxLoadptsNewsFunction(pageid)
{
	document.getElementById('divresponse').innerHTML = "loading data";

	if (document.getElementById('fpassptsclienttrainer').value == '')

	{
		
		document.getElementById('divresponse').innerHTML = "ACCESS DENIED ...please login";
	}
	

	var ajaxRequest;  // The variable that makes Ajax possible!

	try
	{
		// Opera 8.0+, Firefox, Safari
		
		ajaxRequest = new XMLHttpRequest();
		
	} 
	
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server




var parameter  = "ftarget=" + document.getElementById('ftarget').value + "&fpageid=" + pageid + "&fkeys=" + document.getElementById('fkeys').value + "&feditmode=" + document.getElementById('feditmode').value ;
	var mobile = document.getElementById('mobile').value;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_news" + mobile + ".php";
	
//alert(urlparm);
	

	if (document.getElementById('fpassptsclienttrainer').value != '')
	{
		


	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('citnewsdiv').innerHTML = resulttext;
			   document.getElementById('divresponse').innerHTML = "";
			   document.getElementById('fkeys').value = "";
   	
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm , true);
	
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);
}

}

var pageid = "001";
function ajaxLoadProductsFunction(pageid)
{
	
	document.getElementById('divresponse').innerHTML = "loading data";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server

	
	var parameter  = "ftarget=" + document.getElementById('ftarget').value + "&fpageid=" + pageid + "&fkeys=" + document.getElementById('fkeys').value + "&brand_value=" + document.getElementById('brand_value').value + "&category_value=" + document.getElementById('category_value').value;

	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_products.php";
	


	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById("citnewsdiv").innerHTML = resulttext;
			   document.getElementById('divresponse').innerHTML = "";
			   document.getElementById('fkeys').value = "";
   	
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm , true);
	
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}

var pageid = "001";
function ajaxLoadReservationsFunction(pageid)
{
	
	document.getElementById('divresponse').innerHTML = "loading data";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server


	var parameter  = "ftarget=" + document.getElementById('ftarget').value + "&fpageid=" + pageid + "&fkeys=" + document.getElementById('fkeys').value + "&passmember_id=" + document.getElementById('passmember_id').value + "&passmember_pw=" + document.getElementById('passmember_pw').value + "&passmember_ok=" + document.getElementById('passmember_ok').value;

	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_memberreservations.php";
	


	ajaxRequest.onreadystatechange = function checkstate()
	{

	 	if (ajaxRequest.readyState==4)
		{
  			if (ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
	  		{
   			var resulttext = ajaxRequest.responseText;
   			

			   document.getElementById('citnewsdiv').innerHTML = resulttext;
			   document.getElementById('divresponse').innerHTML = "";
			   document.getElementById('fkeys').value = "";
   	
  			}
		}
	
	}
	ajaxRequest.open("POST", urlparm , true);
	
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}

var pageid = "001";
function ajaxLoadClickScheduleFunction(pageid)
{

	document.getElementById('divresponse').innerHTML = "loading calendar";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server

	var stateprov = document.getElementById('fTargetStateProv').value;
	var townlist = document.getElementById('fTargetTownID').value;
	//var category = document.getElementById('fTargetCategory').value;
	var targetcalendar = document.getElementById('ftarget').value;
	var bizid = document.getElementById('passbizid').value;
	var editmode = document.getElementById('feditmode').value;
	var parameter  = 'ftarget=' + encodeURIComponent(targetcalendar) + '&fpageid=' + encodeURIComponent(pageid) + '&fTargetTownID=' + encodeURIComponent(townlist) +  '&fBiz_ID=' + encodeURIComponent(bizid) + "&feditmode=" + encodeURIComponent(editmode);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_clickcalendar.php";
//alert('here ' + parameter);
	ajaxRequest.onreadystatechange = function()
	{

		if(ajaxRequest.readyState == 4)
		{
			var resulttext = ajaxRequest.responseText;

			document.getElementById('citnewsdiv').innerHTML = resulttext;
			document.getElementById('divresponse').innerHTML = "";
		}
	}
	ajaxRequest.open("POST", urlparm , true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}

var pageid = "001";
function ajaxLoadScheduleFunction(pageid)
{

	document.getElementById('divresponse').innerHTML = "loading calendar";

	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server

	
	var targetcalendar = document.getElementById('ftarget').value;

	var editmode = document.getElementById('feditmode').value;
	var user = document.getElementById('fuser').value;
	var parameter  = 'ftarget=' + encodeURIComponent(targetcalendar) + '&fpageid=' + encodeURIComponent(pageid)  + "&feditmode=" + encodeURIComponent(editmode) + "&fuser=" + encodeURIComponent(user) + "&fpassptsclienttrainer=" + encodeURIComponent(targetcalendar);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_calendar.php";
//alert('here ' + parameter);
	ajaxRequest.onreadystatechange = function()
	{

		if(ajaxRequest.readyState == 4)
		{
			var resulttext = ajaxRequest.responseText;

			document.getElementById('citnewsdiv').innerHTML = resulttext;
			document.getElementById('divresponse').innerHTML = "";
		}
	}
	ajaxRequest.open("POST", urlparm , true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}



function ajaxLoadTrainerSchedule(pageid)
{

	document.getElementById('divresponse').innerHTML = "loading calendar";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server

	var targetcalendar = document.getElementById('ftarget').value;

	var ptsclientuserid = document.getElementById('fpassptsclientuserid').value;

	var editmode = document.getElementById('feditmode').value;

	var clienttrainer = document.getElementById('fpassptsclienttrainer').value;

	var parameter  = 'ftarget=' + encodeURIComponent(targetcalendar) + '&fpageid=' + encodeURIComponent(pageid) +  '&fpassptsclienttrainer=' + encodeURIComponent(clienttrainer) + "&feditmode=" + encodeURIComponent(editmode) + "&fpassptsclientuserid=" + encodeURIComponent(ptsclientuserid) + "&fpasstarget=" +  encodeURIComponent(clienttrainer);

	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_ptscalendar.php";
	

	ajaxRequest.onreadystatechange = function()
	{

		if(ajaxRequest.readyState == 4)
		{
			var resulttext = ajaxRequest.responseText;

			document.getElementById('citnewsdiv').innerHTML = resulttext;
			document.getElementById('divresponse').innerHTML = "";
			document.getElementById('fpasstarget').value = targetcalendar;
		}
	}
	ajaxRequest.open("POST", urlparm , true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}

function ajaxReLoadTrainerScheduleFunction()
{
	document.getElementById('divresponse').innerHTML = "loading calendar";
	var pageid = "004";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server
var targetcalendar = document.getElementById('ftarget').value;
	var clienttrainer = document.getElementById('fpassptsclienttrainer').value;
	var clientuserid = document.getElementById('fpassptsclientuserid').value;
	var editmode = document.getElementById('feditmode').value;
	var targetcalendar = document.getElementById('fpasstarget').value;
	var jumpindex = document.getElementById('selectmonth').value; 
   var jumpmonth = jumpindex.substr(0, jumpindex.length - 4);
   var jumpyear = jumpindex.substr(jumpindex.length - 4, 4);
   
	var parameter  = 'ftarget=' + encodeURIComponent(targetcalendar) + '&fpasstarget=' + encodeURIComponent(clienttrainer) + '&fpageid=' + encodeURIComponent(pageid) + '&feditmode=' + encodeURIComponent(editmode) + '&fpassptsclientuserid=' + encodeURIComponent(clientuserid) + '&fpassptsclienttrainer=' + encodeURIComponent(clienttrainer) + '&month=' + encodeURIComponent(jumpmonth) + '&year=' + encodeURIComponent(jumpyear);
	
	var rootlocation = document.getElementById('fphpfiles').value;

	var urlparm = rootlocation + "ajax_load_ptscalendar.php";

	ajaxRequest.onreadystatechange = function()
	{

		if(ajaxRequest.readyState == 4)
		{
			var resulttext = ajaxRequest.responseText;

			document.getElementById('citnewsdiv').innerHTML = resulttext;
			document.getElementById('divresponse').innerHTML = "";
		}
	}
	ajaxRequest.open("POST", urlparm , true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}


function ajaxReLoadScheduleFunction()
{
	document.getElementById('divresponse').innerHTML = "loading calendar";
	var pageid = "004";
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server
var targetcalendar = document.getElementById('ftarget').value;
//alert("here" + targetcalendar );
	var editmode = document.getElementById('feditmode').value;
	var user = document.getElementById('fuser').value;
	var targetcalendar = document.getElementById('fpasstarget').value;
	var jumpindex = document.getElementById('selectmonth').value; 
   var jumpmonth = jumpindex.substr(0, jumpindex.length - 4);
   var jumpyear = jumpindex.substr(jumpindex.length - 4, 4);
   
	var parameter  = 'ftarget=' + encodeURIComponent(targetcalendar)  + '&fpageid=' + encodeURIComponent(pageid) + '&feditmode=' + encodeURIComponent(editmode) + '&fuser=' + encodeURIComponent(user) + '&month=' + encodeURIComponent(jumpmonth) + '&year=' + encodeURIComponent(jumpyear) + '&fpassptsclienttrainer=' + encodeURIComponent(targetcalendar);
//	alert("here" + parameter );
	var rootlocation = document.getElementById('fphpfiles').value;

	var urlparm = rootlocation + "ajax_load_calendar.php";
//alert(parameter);
	ajaxRequest.onreadystatechange = function()
	{

		if(ajaxRequest.readyState == 4)
		{
			var resulttext = ajaxRequest.responseText;

			document.getElementById('citnewsdiv').innerHTML = resulttext;
			document.getElementById('divresponse').innerHTML = "";
		}
	}
	ajaxRequest.open("POST", urlparm , true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}



function ajaxReLoadClickScheduleFunction()
{
	document.getElementById('divresponse').innerHTML = "loading calendar";
	var ajaxRequest;  // The variable that makes Ajax possible!
	var pageid = "004";
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server
	
	var targetcalendar = document.getElementById('ftarget').value;
	var clienttrainer = document.getElementById('ftarget').value;
	var clientuserid = document.getElementById('ftarget').value;
	var editmode = document.getElementById('feditmode').value;
	var targetcalendar = document.getElementById('ftarget').value;
	var jumpindex = document.getElementById('selectmonth').value; 
   var jumpmonth = jumpindex.substr(0, jumpindex.length - 4);
   var jumpyear = jumpindex.substr(jumpindex.length - 4, 4);
   
	var parameter  = 'ftarget=' + encodeURIComponent(targetcalendar) + '&fpasstarget=' + encodeURIComponent(clienttrainer) + '&fpageid=' + encodeURIComponent(pageid) + '&feditmode=' + encodeURIComponent(editmode) + '&fpassptsclientuserid=' + encodeURIComponent(clientuserid) + '&fpassptsclienttrainer=' + encodeURIComponent(clienttrainer) + '&month=' + encodeURIComponent(jumpmonth) + '&year=' + encodeURIComponent(jumpyear);

	var stateprov = document.getElementById('fTargetStateProv').value;
	var townlist = document.getElementById('fTargetTownID').value;

	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_load_calendar.php";
	


	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{
			var resulttext = ajaxRequest.responseText;

			document.getElementById('citnewsdiv').innerHTML = resulttext;
			document.getElementById('divresponse').innerHTML = "";
		}
	}
	
	ajaxRequest.open("POST", urlparm , true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", parameter.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(parameter);

}



function ajaxUpdateWeatherFunction()
{
	document.getElementById('divresponse').innerHTML = "";
	var ajaxRequest;  // The variable that makes Ajax possible!

	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server

	var stateprov = document.getElementById('fTargetStateProv').value;
	var category = document.getElementById('fTargetCategory').value;
	var townlist = document.getElementById('fTargetTownID').value;
	var params  = '?ftarget=clickintown &fTargetTownID=' + townlist + '&fTargetCategory=' + category;
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_update_weather.php";
	
	ajaxRequest.open("GET", urlparm + params, true);

	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{
			
				
			var resulttext = ajaxRequest.responseText;

			document.getElementById('weather').innerHTML = resulttext;
			document.getElementById('TOWNLOGO').style.visibility = "visible";

	
		}
	}
	ajaxRequest.send(null);
}
function ajaxUpdateTownLogoFunction()
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!

	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive table sent from the server

	var stateprov = document.getElementById('fTargetStateProv').value;
	var category = document.getElementById('fTargetCategory').value;
	var townlist = document.getElementById('fTargetTownID').value;
	var rootpath = document.getElementById('fRootDirectory').value;

	var params  = '?ftarget=clickintown &fTargetTownID=' + townlist + '&fTargetCategory=' + encodeURIComponent(category) + '&fRootDirectory=' + encodeURIComponent(rootpath);
	var rootlocation = document.getElementById('fphpfiles').value;
	var urlparm = rootlocation + "ajax_update_townlogo.php";
	
	ajaxRequest.open("GET", urlparm + params, true);

	ajaxRequest.onreadystatechange = function()
	{
		
		if(ajaxRequest.readyState == 4)
		{
			
				
			var resulttext = ajaxRequest.responseText;

			document.getElementById('townlogodiv').innerHTML = resulttext;


	
		}
	}
	ajaxRequest.send(null);
}
var formname = "";

var startfile = "index.php";
function addFavorite(formname)
{
   	if (document.all)
		{
      		var urlparm = rootlocation + startfile;
	  		var linkis = 	"?fTargetTownID=" + encodeURIComponent(document.getElementById('fTargetTownID').value);
	  		linkis = linkis + "&fTargetStateProv=" + encodeURIComponent(document.getElementById('fTargetStateProv').value);
	  		var name = "Cit " + document.getElementById('fTargetTown').value;
       		
      		window.external.AddFavorite(urlparm + linkis,name);
    	}
}




//onload strategy
function addLoadEvent(func) 
{   
   

   var oldonload = window.onload;   
   if (typeof window.onload != 'function') 
	{   
     window.onload = func;   
   	} 
	else 
	{   
     	window.onload = function() 
		{   
       		if (oldonload) 
			{   
        	 oldonload();   
       		}   
       		func();   
     	}   
   }   
 }   
 
 var gAutoPrint = true;

function ajaxPrintExercises()
{

	if (document.getElementById != null)
	{

		var html = '<HTML>\n<HEAD>\n';

		if (document.document.getElementById("fptsclientname") != null)
		{

			var headTags = document.getElementById("fptsclientname").value;

			if (headTags.length > 0) html += headTags;

	}

		html += '\n</HE' + 'AD>\n<BODY>\n';
		
		html += '<table><tr><td>' + document.getElementById("fptsclientname").value + '-' + document.getElementById("Extype").value + '</td></tr></table>\n';

		var printReadyElem = document.getElementById("myexerciselist");

		if (printReadyElem != null) html += printReadyElem.innerHTML;

		else
		{

			alert("Error, no contents.");

			return;

		}

		html += '\n</BO' + 'DY>\n</HT' + 'ML>';

		var printWin = window.open("","ajaxPrintExercises");

		printWin.document.open();

		printWin.document.write(html);

		printWin.document.close();

		if (gAutoPrint) printWin.print(); 
		

	} 
	else alert("Browser not supported.");

}

   

// addLoadEvent(ajaxLoadBusinessFunction);   
//addLoadEvent(function() 
// {   
   /* more code to run on page load */  
// }); 



