// JavaScript Document

photostory = 0;

function create_images_player(id,width,height){
	var so = new SWFObject("player.swf", "scroll", width, height+22, "9", "#000000");
	so.addParam("menu", "false"); 
	so.addParam("loop", "false"); 
	so.addParam("quality", "best");
	so.addParam("wmode", "transparent");
	so.addParam("allowScriptAccess", "sameDomain"); 
	so.addParam("allowFullScreen", "true");
	so.addVariable("WIDTH", width);
	so.addVariable("HEIGHT", height);
	so.addVariable("PATH","media/");
	so.addVariable("COLOR_1","0xFFFFFF");
	so.addVariable("COLOR_2","0x6A5844");
	so.addVariable("COLOR_3","0x7F6D59");
	so.addVariable("TYPE","img");
	so.addVariable("FILES","1.png,2.jpg,3.jpg");
	so.write(id);
} // end function create_images_player

function create_flv_player(id,width,height){
	var so = new SWFObject("player.swf", "scroll", width, height+35, "9", "#000000");
	so.addParam("menu", "false"); 
	so.addParam("loop", "false"); 
	so.addParam("quality", "best");
	so.addParam("wmode", "transparent");
	so.addParam("allowScriptAccess", "sameDomain"); 
	so.addParam("allowFullScreen", "true");
	so.addVariable("WIDTH", width);
	so.addVariable("HEIGHT", height);
	so.addVariable("PATH","media/");
	so.addVariable("COLOR_1","0xFFFFFF");
	so.addVariable("COLOR_2","0x6A5844");
	so.addVariable("COLOR_3","0x7F6D59");
	so.addVariable("TYPE","flv");
	so.addVariable("FILES","movie.v2.flv");
	so.write(id);
} // end function create_flv_player

function load_photostory ( lang )
{
	//$("#main_box_content").load("photostory.php");
	div = document.getElementById ( 'main_box_content' );

	if ( photostory == 0 )
	{
		div.innerHTML = '<div id="image_player"></div>';
		//create_images_player("image_player",683, 385);
		create_flv_player("image_player",683, 374);
		photostory = 1;
	} else {
		div.innerHTML = '<img src="images/main_photo_' + lang + '.jpg" width="683" height="407" alt="Main Photo" title="Main Photo" />';
		photostory = 0;
	} // end else

} // end function load_photostory

function show_object ( id )
{
	var obj = window.document.getElementById ( id );
	obj.style.display = '';
} // end function show_object

function hide_object ( id )
{
	var obj = window.document.getElementById ( id );
	obj.style.display = 'none';
} // end function hide_object

function show_hide_vendor ( value )
{
	var obj = window.document.getElementById ( 'vendor' + value );
	var subobj = window.document.getElementById ( 'subvendor' + value );
	
	for ( i = 1; i <= 7; i++ )
	{
		if ( i != value )
		{
			if ( window.document.getElementById ( 'subvendor' + i ) )
			{
				window.document.getElementById ( 'vendor' + i ).style.backgroundPosition = "0px -1px";
				window.document.getElementById ( 'subvendor' + i ).style.display = 'none';
			}
		}
	} // end for
	
	if ( subobj.style.display == '' )
	{
		subobj.style.display = 'none';
		obj.style.backgroundPosition = "0px -1px";
	} else {
		subobj.style.display = '';
		obj.style.backgroundPosition = "0px -40px";
	}

} // end function show_hide_object

function verify_appointment_form ()
{
	var fm = window.document.getElementById ( 'fm_appointment' );
	
	fm.submit ();
} // end verify_appointment_form

function verify_contact_form ()
{
	var fm = window.document.getElementById ( 'fm_contact' );
	
	fm.submit ();
} // end verify_appointment_form

function verify_reservation_form ()
{
	var fm = window.document.getElementById ( 'fm_reservation' );
	
	fm.submit ();
} // end function verify_reservation_form
