﻿$(document).ready(function(){
    $('.flash-hdr').sifr({ path: '/Includes/', font: 'AlternateGothicEF-NoTwo', build: 436, version: 3});
    
    $(".accordian:gt(0)").slideToggle();
    
    $(".fot-links span:last").remove();
    
    //Setup Flash Click
    $(".flash-click").parent().css("position","relative");
    $(".flash-click").parent().css("z-index","1");

	var flashDivHeight = $("div:eq(0)", $(".flash-click").parent()).height();
	var flashDivWidth = $("div:eq(0)", $(".flash-click").parent()).width();
	$(".flash-click").parent().css("height",flashDivHeight);
	$(".flash-click").parent().css("width",flashDivWidth);

    $(".flash-click").parent().append("<img src='/Images/videopng.png' class='pngfix videopng' style='position:absolute; display:block; z-index:3; top:40%; left:35%;' />");

    $(".flash-click").parent().mouseup(function () { 
        $(".videopng").hide();
    });
    $(".flash-click, .flash-click object").mouseup(function () { 
        $(".videopng").hide();
    });
    
});

function checkAvailability()
{
    var checkIn = $(".datepickerhome-checkin").datepicker( 'getDate' );
    var checkOut = $(".datepickerhome-checkout").datepicker( 'getDate' );

    var diff = checkOut - checkIn;
    diff = diff / 86400000;
    diff = Math.floor(diff);

    var checkInDay = checkIn.getDate();
    var checkInMonth = checkIn.getMonth()+1;
    var checkInYear = checkIn.getFullYear();
    var formattedDate = checkInDay + '/' + checkInMonth + '/' + checkInYear;

    var url = "http://www.resonline.com.au/Portal/V2/default.aspx?NumNights=" + diff + "&DisplayFrom=" + formattedDate + "&r=3&olt=3&CommodityTypeID=&view=1&DivisionID=487&refcode=";
    
    window.open(url,'resWindow',''); 
}
