$(function() {
	//Documentation located in special.docs.js
	$('.post').postPreview();
	$('.share-link').initializeSharing();

	// Blog Form Help
	$('div.form-help').hide();
	$('a.help-link').toggle( function() {
		$(this).parents('div.field').children('div.form-help').show();
		return false;
	},function(){ 
	  $(this).parents('div.field').children('div.form-help').hide();
	  return false;
	});

	//Interior pages heading sifr:
	$('div#content h1').sifr(
		{ strSWF: 'fonts/avenir-45.swf', strColor: '#b0a899', strLinkColor: '#b0a899', strHoverColor: '#b0a899', strWmode: 'transparent', intPadding: [5, 0, 0, 0], strFlashVars: 'textalign=left&', strCase: 'upper' },
		{ expressInstall: true }
	);
	
	$('div#content h2.subheader').sifr(
		{ strSWF: 'fonts/avenir-45.swf', strColor: '#b0a899', strLinkColor: '#b0a899', strHoverColor: '#b0a899', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'textalign=left&', strCase: 'upper' },
		{ expressInstall: true }
	);
	// Menu title sifr
	$('div#content #menu-header #menu-title').sifr(
		{ strSWF: 'fonts/avenir-45.swf', strColor: '#a93712', strLinkColor: '#a93712', strHoverColor: '#a93712', strWmode: 'transparent', intPadding: [5, 0, 0, 0], strFlashVars: 'textalign=left&', strCase: 'upper' },
		{ expressInstall: true }
	);
    
    //$('.post-description').hide();
//    $(".details-link").toggle(function() {
//        $(this).parents(".post").find(".post-description").animate({
//            height: 'show'
//        }, 'slow');
        // Changes the Text of the Control
//        $(this).html("Hide Post");
//    }, function() {
//        $(this).parents(".post").find(".post-description").animate({
//            height: 'hide'
//        }, 'slow');
        // Changes the Text of the Control
//        $(this).html("View Full Post");
//    });

	//Flash for middle masthead in del-mar-california-restaurants.php
	$("body.room div#masthead").flash( {
     src:"/kitchen1540/flash/rotating-masthead.swf",
     width:571,
     height:313,
     wmode:"transparent",
     quality:"high"},
     {version:"9"},
     function(htmlOptions) {    
	 htmlOptions.flashvars.xmlPath = "/kitchen1540/flash/images.xml";     $(this).html($.fn.flash.transform(htmlOptions));     });

	//Homepage quotes flash
	$("body.home div#content h1").flash(
		{src:"flash/quotes.swf",
		 width:579,
		 height:89,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
		 );
	
	$("#1540-press-video2").flash(
		{src:"flash/la-jolla-dining-kitchen-1540.swf",
		 width:480,
		 height:358,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
		 );

	$("#1540-press-video3").flash(
		{src:"/kitchen1540/flash/nyc.swf",
		 width:518,
		 height:340,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
		 );
		 
	$("#1540-press-video4").flash(
		{src:"/kitchen1540/flash/san-diego-dining-events.swf",
		 width:420,
		 height:400,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
		 function(htmlOptions) {
				htmlOptions.flashvars.flvPath = "/kitchen1540/flash/flvs/san-diego-dining-events.flv";
				htmlOptions.flashvars.skinPath = "/kitchen1540/flash/assets/SkinUnderAllNoFullNoCaption.swf";
				$(this).html($.fn.flash.transform(htmlOptions));
		}
		 );

	$("#1540-press-video5").flash(
		{src:"/flash/california-horse-racing-party.swf",
		 width:480,
		 height:320,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
		 function(htmlOptions) {
		 		htmlOptions.flashvars.flvPath = "/flash/flvs/california-horse-racing-party.flv";
				htmlOptions.flashvars.skinPath = "/flash/assets/SkinUnderAllNoFullNoCaption.swf"
				
				$(this).html($.fn.flash.transform(htmlOptions));
		});		 

	$("#1540-press-video6").flash(
		{src:"/flash/california-horse-racing-party.swf",
		 width:480,
		 height:320,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
		 function(htmlOptions) {
		 		htmlOptions.flashvars.flvPath = "/flash/flvs/art-soul.flv";
				htmlOptions.flashvars.skinPath = "/flash/assets/SkinUnderAllNoFullNoCaption.swf"
				
				$(this).html($.fn.flash.transform(htmlOptions));
		});		 

	$("#1540-press-video5").flash(
		{src:"/flash/california-horse-racing-party.swf",
		 width:480,
		 height:320,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
		 function(htmlOptions) {
		 		htmlOptions.flashvars.flvPath = "/flash/flvs/california-horse-racing-party.flv";
				htmlOptions.flashvars.skinPath = "/flash/assets/SkinUnderAllNoFullNoCaption.swf"
				
				$(this).html($.fn.flash.transform(htmlOptions));
		});		 
		 
		 
	$("#1540-press-video").flash(
		{src:"flash/kitchen_roughcut.swf",
		 width:480,
		 height:400,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
		 );
	$("body.virtual-tour").flash(
		{src:"flash/panorama.swf",
		 width:'100%',
		 height:'100%',
		 align: 'middle',
		 allowfullscreen: true,
		 wmode:'window',
		 loop: true,
		 play: true,
		 menu: true,
		 devicefont:false,
		 allowscriptaccess: 'samedomain',
		 quality:'high',
		 scale: 'showall'},
		 {version:"9"}
		 );
	
	$("#kitchen-gallery").flash(
		{src:"flash/1540-SSP.swf",
		 width:571,
		 height:455,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
		 );
	
	$('.bio').each(function(i,o) {
		var a = $('#'+this.id+"-link");
		var wrap = $('<div class="jqmWindow">');
		var closebio = $('<a href="#" class="jqmClose"><em class="alt">Close X</em></a>'); 
		$(wrap).append(closebio).append(o);
		wrap.jqm({
			toTop:true,
			trigger: a
			});
		$('body').append(wrap);
	});
	
	$("#home-flash").flash(
		{src:"homepage-flash.swf",
		 width:574,
		 height:346,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
		 );

});
