// JavaScript Document

// GET THE STYLESHEET
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
var detect = navigator.userAgent.toLowerCase();
browser_version = parseInt(navigator.appVersion);
browser_type = navigator.appName;
if(checkIt('win') &&browser_type == "Microsoft Internet Explorer") 
{
	document.write("<link REL='stylesheet' HREF='styles/pilates_pc_ie.css' TYPE='text/css'>");
}
else
{
	document.write("<link REL='stylesheet' HREF='styles/pilates.css' TYPE='text/css'>");
}


// ARRAY TO GENERATE THE DROP DOWN
var menu=new Array('club','golf','membership','activities');

/*
menu[0]=new Array(3);
menu[0][0]=new Array('xxx','xxx','xxx','Mission','xxx','xxx');
menu[0][1]=new Array('developer.html','leadership.php','location.html','mission.html','airfield.html','log_homes.html');
menu[0][2]=new Array('150px');	// SET THE WIDTH OF THE LEFT CELL TO POSITION THE REST OF THE ELEMENTS ( FOR INNER PAGES )3
*/

menu[1]=new Array(5);
menu[1][0]=new Array(' mat classes',' group equipment classes',' private & semi-private equipment training'," yoga");
menu[1][1]=new Array('mat_class.html','group_equipment_class.html','private_equipment_training.html','yoga_classes.html');
menu[1][2]=new Array('220');		// SET THE NAV POSITION FOR INDEX PAGE
menu[1][3]=new Array('190');		// SET THE NAV POSITION FOR THE INNER PAGES
menu[1][4]=new Array('230px');	// SET THE WIDTH OF THE NAV

menu[2]=new Array(5);
menu[2][0]=new Array("pilates mat & yoga classes","private & semi-private sessions","group equipment classes",'policies');
menu[2][1]=new Array('fee_mat.html','fee_private.html','fee_equipment.html','policy.html');
menu[2][2]=new Array('342');		// SET THE NAV POSITION FOR INDEX PAGE
menu[2][3]=new Array('220');		// SET THE NAV POSITION FOR  THE INNER PAGES
menu[2][4]=new Array('175px');	// SET THE WIDTH OF THE NAV
/*
menu[3]=new Array(3);
menu[3][0]=new Array('xxx','xxx','xxx','xxx','xxx');
menu[3][1]=new Array('adrenaline.html','nature.html','sport.html','local_attractions.html','airfield.html');
menu[3][2]=new Array('273px');


menu[4]=new Array(3);
menu[4][0]=new Array('xxx','xxx','xxx','xxx');
menu[4][1]=new Array('xxx.html','xxx.html','xxx.html','xxx.html');
menu[4][2]=new Array('393px');
*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var my_time=0;
var nav_pos;
var global_value;
var gen_menu;
function control() 
{
	my_time=setTimeout("hide_menu()",1000);
}
function hide_menu()
{
 	document.getElementById('dropdown').innerHTML="";
  	clearTimeout(my_time);
}
// DROPDOWN FOR INDEX PAGE
function generate_menu_index(value)
{
	global_value=value;
	//	GET ARRAY SIZE BASED ON THE MOUSE OVER
	var temp=menu[value][0].length;	
	gen_menu="<table border='0px' cellspacing='1px' cellpadding='3px' bgcolor='#7ac142' width='"+menu[value][4][0]+"'>";	
	for (i=0;i<temp;i++)
	{
		gen_menu+="<tr><td class='drop_nav' valign='middle'   width='"+menu[value][4][0]+"'>";
		gen_menu+="<a href='"+menu[value][1][i]+"' title='"+menu[value][0][i]+"'>"+menu[value][0][i]+"</a></td></tr>";
		//gen_menu+="<a href='"+menu[value][1][i]+"' onmouseover='gen_menu_index();' onmouseout='control();' >"+menu[value][0][i]+"</a></td></tr>";
	}
	gen_menu+="</table>";	
	// 	GET THE NAV POSITION	
	if (checkIt('win')&&checkIt('msie'))
	{
		nav_pos=parseInt(menu[value][2][0])+4;
		nav_pos=nav_pos+"px";
	}
	else
	{
		nav_pos=parseInt(menu[value][2][0]);
		nav_pos=nav_pos+"px";
	}
	//	DISPLAY THE DROPDOWN
	document.getElementById('dropdown').style.left=nav_pos;
	document.getElementById('dropdown').innerHTML=gen_menu;
	if (my_time)
	{
		clearTimeout(my_time);	
	}
}
function gen_menu_index()
{
	document.getElementById('dropdown').style.left=nav_pos;
	document.getElementById('dropdown').innerHTML=gen_menu;
	if (my_time)
	{
		clearTimeout(my_time);	
	}
}
// DROPDOWN FOR INNER PAGES
function generate_menu_inner(value)
{
	//	GET ARRAY SIZE BASED ON THE MOUSE OVER
	var temp=menu[value][0].length;
	
	gen_menu="<table border='0px' cellspacing='1px' cellpadding='3px' bgcolor='#7ac142' width='"+menu[value][4][0]+"'>";
	
	for (i=0;i<temp;i++)
	{
		gen_menu+="<tr><td class='drop_nav' valign='middle' width='"+menu[value][4][0]+"'><a href='"+menu[value][1][i]+"'>"+menu[value][0][i]+"</a></td></tr>";
	}
	gen_menu+="</table>";
	
	// 	GET THE NAV POSITION
	var nav_pos;
	if (checkIt('win')&&checkIt('msie'))
	{
		nav_pos=parseInt(menu[value][3][0]);
		nav_pos=nav_pos+6;
		nav_pos=nav_pos+"px";
		//alert(nav_pos);
	}
	else
	{
		nav_pos=parseInt(menu[value][3][0]);
		nav_pos=nav_pos+"px";
	}
	//	DISPLAY THE DROPDOWN
	document.getElementById('dropdown').style.left=nav_pos;
	document.getElementById('dropdown').innerHTML=gen_menu;
	if (my_time)
	{
		clearTimeout(my_time);	
	}
}
function gen_menu_inner(value)
{
	document.getElementById('dropdown').style.left=nav_pos;
	document.getElementById('dropdown').innerHTML=gen_menu;
}

function kill_control()
{
	clearTimeout(my_time);
}



var numfaqs=6;
var answer=new Array(numfaqs);
answer[0]="";
answer[1]="<p>Pilates is a full body exercise program developed in the 1920s by legendary physical trainer, Joseph Pilates. It is a series of more than 500 exercises designed to stretch and strengthen the entire body without adding bulk.  The exercises focus on the core muscles  the abdominals, lower back and hips and are performed on mats and exercise equipment developed by Joseph which uses spring resistance to build long, lean, sculpted muscles.  Most people overdevelop the stronger muscle groups, which leads to imbalance, also known as poor posture or spinal misalignment. The Pilates method strengthens weak muscles allowing strong ones to relax and increases overall flexibility and joint release so you can move with ease.  The emphasis on correct alignment through efficient muscle use also improves coordination, posture and balance and produces evenly conditioned bodies.</p><p>Unlike other exercise programs, the Pilates method does not employ mindless repetition of boring exercises that most people tire of and subsequently abandon.  The exercises require concentration to engage the body and mind and are unlike anything you&lsquo;ve done before.  It is the mind body connection that allows you carry your Pilates practice into your daily life so that without thinking about it you will move with ease and balance.  The results are a physical change as well as an emotional change in how you feel about yourself. You will stand taller, feel refreshed and alert and actually change the way your body looks, moves and feels.</p>";

answer[2]="<p><ul><li>Strong core and flat abdominals</li><li>An evenly conditioned body with long, lean, toned muscles</li><li>Graceful posture</li><li>Relief of back, shoulder, neck and leg pain</li><li>Injury rehabilitation and prevention</li><li>Prenatal and postpartum conditioning </li><li>Improved athletic performance</li><li>Increased flexibility, balance and ease of movement</li><li>Stronger immune system</li><li>Stress relief</li><li>Improved circulation from breathing and stretching which restores oxygen to muscle tissue</li><li>Correction of structural alignment problems</li><li>Increased energy and stamina</li></ul></p>";

answer[3]="<p>The modifications and variations for each exercise make Pilates a safe and effective workout for all ages and body types.  It is strongly recommend for anyone suffering from back, neck and shoulder pain.  Our instructors will be happy to work with you to develop a Pilates program that best suits your needs.</p>";

answer[4]="<p>It will be hard to get the most out of your matwork if you will need to work around an injured or very sensitive area.  We recommend working one-on-one with an instructor for a while.  That way your workouts can be personalized to address your individual needs and injury.  Then once you have developed the skills and knowledge to work with your body and modify as necessary, you will be able to safely join a mat class and enjoy a productive workout.</p>";

answer[5]="<p>Ideally, at least three times per week.  Pilates exercises are about moving correctly, and your results will improve greatly from the one-on-one instruction of private training.  You will gain more from your group classes by effectively practicing what you learned in your private session.  For this reason, we recommend that you round out your practice with a combination of private and group training.  Once you understand the exercises and can perform them correctly, mat and group equipment classes are a cost-effective way to get more practice.</p>";

/*answer[6]="<p>New answer.</p>";*/

/*answer[6]="<p>Our instructors are fully certified with 450-600 hours of training, plus continuing education and years of dance, yoga and fitness experience 
Our beautiful, inviting studio is conveniently located in Fort Worths Cultural district 
Our studio is fully equipped with professional Pilates equipment and lots of props  balls, rings, rollers, discs, and therabands - to keep your workouts fun and fresh
We work hard to give you the perfect Pilates program for your lifestyle and offer classes for every level, preference and budget

<ul><li>Private and semi-private equipment training</li>
<li>Small group equipment classes from beginner to advanced</li>
<li>Ballet Barre classes to complement your Pilates workout</li>
<li>Pre-natal and postpartum training</li>
<li>A variety of mat classes for all levels: Cardio Core, Body Sculpt , Classic Pilates Mat</li></ul>
</p>";*/
/*	Private and semi-private equipment training
	Small group equipment classes from beginner to advanced
	Ballet Barre classes to complement your Pilates workout
	Pre-natal and postpartum training
	A variety of mat classes for all levels: Cardio Core, Body Sculpt , Classic Pilates Mat*/


var marker=0;
function faq(value)
{	
	if (marker<1)
	{
		marker=value;	
	}
	// HIDE EVERYTHING BEFORE CHOOSING WHICH ONE TO DISPLAY
	for (var i=1;i<numfaqs;i++)
	{
		document.images['q'+i].src="images/show.gif";
		document.getElementById('faq'+i).innerHTML="";	
	}
	if(marker==value)
	{
		document.images['q'+value].src="images/hide.gif";
		document.getElementById('faq'+value).innerHTML=answer[value];
	}
	else
	{
		document.images['q'+value].src="images/hide.gif";
		document.getElementById('faq'+value).innerHTML=answer[value];
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
var detect = navigator.userAgent.toLowerCase();
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*if (checkIt('safari'))
{
	document.write("<link REL='stylesheet' HREF='styles/buckaroo_sf.css' TYPE='text/css' />");
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (checkIt('mac')&&checkIt('firefox'))
{
	document.write("<link REL='stylesheet' HREF='styles/buckaroo.css' TYPE='text/css' />");
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (checkIt('mac')&&checkIt('ie'))
{
	document.write("<link REL='stylesheet' HREF='styles/buckaroo_mac_ie.css' TYPE='text/css' />");
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (checkIt('win')&&checkIt('firefox'))
{ 
	document.write("<link REL='stylesheet' HREF='styles/buckaroo_win_fire.css' TYPE='text/css' />");
}
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var img_loader=new Array('index_pose1.jpg','index_pose2.jpg','index_pose3.jpg','index_pose4.jpg');
var img_src=new Array();
// FUNCTION TO PRELOAD IMAGES
function preload()
{
	for (var i=0;i<img_loader.length;i++)
	{
		img_src[i]=new Image();
		img_src[i].src='images/'+img_loader[i];
	}
	return 0;
}

var control_count=0;
var temp=0;
var array_size=(img_loader.length)-1;
function swap_img(value)
{	
	control_count=control_count+value;
	
	if (control_count>array_size)
	{
		temp=0;
		control_count=0;
	}
	else
	{
		if (control_count<0)
		{
			temp=array_size;
			control_count=array_size;
		}
		else
		{
			if (control_count>=0 && control_count<=array_size)
			{
				temp=control_count;
			}	
		}
	}
	document.images.index_image.src='images/'+img_loader[temp];
	return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
function popup()
{
	window.open('http://rolfingfortworth.com/map.html','map','width=740,height=500,toolbar=no');
}
