$(function() {
	//Documentation located in special.docs.js

	$('div#content-wrapper > h1').sifr({ strSWF: '/flash/hoefler-text-italic.swf', strColor: '#FFF7E0', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'letter-spacing=12&' }, { expressInstall: true });

	$('div#code-box').hide();
	$('a#promo-link').toggle(function() {
		$('div#code-box').show();
		return false;
	}, function() { 
		$('div#code-box').hide();
		return false; 
	});

	$('#mycarousel').jcarousel({
		scroll: 1
	});


	/*$('#dhr-flash').flash({  
		swf: 'http://www.destinationhotels.com/corp-facts-footer.php?style=white&prop=41',
		params: {
			wmode: 'transparent'
		}
	});*/

	var $tabs = $('#tabs').tabs();

	$tabs.bind('tabsselect', function(event, ui) {
     ui.options // options used to intialize this widget
     ui.index // zero-based index of the selected (clicked) tab
		switch(ui.index) {
			case 0: //Guestrooms & Suites
				$('input#room').attr('value','ROH,ROO,ROOD,ROOK,L0RFW,L0RFK,L0RVW,L0RVK,L0RSW,L0RSK,L1UFKP,L1UVKP,L1UTKP,L1UZKP');
				break;
			case 1: //Villas
				$('input#room').attr('value','V2VV3C,V2VS3C,V3VV4C,V3VS4C,V4VV4C');
				break;
			case 2: //Casitias
				$('input#room').attr('value','C0IFW,C0IFK,C0IVW,C0IVK,C0ISW,C0ISK,C2XF2C,C2XV2C,C2XS2C,C3XFKW,C3XVKW,C3XSKW,C1UFKC,C1UVKC,C1USKC');
				break;
			case 3: //Bungalows
				$('input#room').attr('value','B0RVW,B0RVK,B2XVKW,B1UVKC');
				break;
			case 4: //All
				$('input#room').attr('value','');
				break;

}
	  
	});

	$('input[value="Checkout"]').after('<input type="image" alt="checkout" src="images/buttons/checkout.gif" id="btn-checkout" name="checkout" style="background: #FFF7DE;" />').remove();
	//$('input[value="Continue Shopping"]').after('<input type="image" alt="continue shopping" src="images/buttons/continue-shopping.gif" onclick="window.location.href=\'index.php?op=view\'" id="btn-continue" name="view" />').remove();
	//inputContinueShopping = $('<input/>').attr({name:'btn-continue',type:'image',src:'images/buttons/continue-shopping.gif',id:'btn-continue'}).click(function(e){e.preventDefault(); window.location.href='index.php?op=view';});
	inputContinueShopping = $('<a/>').attr('href','#').html('<img src="images/buttons/continue-shopping.gif" alt="Continue Shopping" style="background: #FFF7DE;" />').click(function(e){e.preventDefault(); window.location.href='index.php?op=view';});
	$("input[value=Continue Shopping]").each(function(){$(this).after(inputContinueShopping).remove();});

	$('input[value="Update"]').after('<input type="image" alt="update" src="images/buttons/update.gif" id="btn-update" name="submit" style="background: #FFF7DE;" />').remove();

	$('input[value="Send Password"]').after('<input type="image" alt="send password" src="images/buttons/send-password.gif" id="btn-send-password" name="sendpass" style="background: #FFF7DE;" />').remove();
	//$('input[value="Edit Cart"]').after('<input type="image" alt="edit cart" onclick="window.location.href=\'index.php?op=viewcart\'" src="images/buttons/edit-cart.gif" id="btn-edit-cart" name="view" />').remove();
	inputEditCart = $('<a/>').attr('href','#').html('<img src="images/buttons/edit-cart.gif" alt="Edit Cart" style="background: #FFF7DE;" />').click(function(e){e.preventDefault(); window.location.href='index.php?op=viewcart';});
	$("input[value=Edit Cart]").each(function(){$(this).after(inputEditCart).remove();});

	$('input[value="Proceed to Address Information"]').after('<input type="image" alt="Proceed to Address Information" src="images/buttons/proceed.gif" id="btn-proceed" name="view" style="background: #FFF7DE;" />').remove();
	$('input[value="Quick Checkout"]').after('<input type="image" alt="Quick Checkout" src="images/buttons/quick-checkout.gif" id="btn-quick-checkout" name="submit" style="background: #FFF7DE;" />').remove();
	$('input[value="Log In"]').after('<input type="image" alt="Log In" src="images/buttons/login.gif" id="btn-login" name="submit" style="background: #FFF7DE;" />').remove();
	$('input[value="Continue to Shipping"]').after('<input type="image" alt="Continue to Shipping" src="images/buttons/proceed.gif" id="btn-proceed-shipping" name="submit" style="background: #FFF7DE;" />').remove();
	$('input[value="Continue Checkout"]').after('<input type="image" alt="Continue Checkout" src="images/buttons/proceed.gif" id="btn-continue-checkout" name="submit" style="background: #FFF7DE;" />').remove();
	$('input[value="Save Account"]').after('<input type="image" alt="Save Account" src="images/buttons/update-account.gif" id="btn-save-account" name="submit" style="background: #FFF7DE;" />').remove();

	$('input[value="Update Account"]').after('<input type="image" alt="Update Account" src="images/buttons/update-account.gif" id="btn-update" name="submit" style="background: #FFF7DE;" />').remove();

	
});
