﻿$(document).ready(function(){

    $('#LatestOffer').before('<div id="OfferNav">').cycle({

        fx: 'fade',

        speed: 800,

        timeout: 5000,

        pager: '#OfferNav'

    });

    $("a#single_image").fancybox();

    $("a#inline").fancybox({

        'hideOnContentClick': true

    });

    $("a.photoGroup").fancybox({

        'overlayShow': true

    });

    $("a.ajaxPage").fancybox({

        'width'	: 670,
	
	    'padding' : 10,
	
	    'height' : '80%',
    
        'autoScale' : false,
	
	    'type' : 'iframe',
	
	    'scrolling' : 'yes'

    });

    $("a.iframePage").fancybox({

        'type': 'iframe',

        'overlayShow': true,

        'hideOnContentClick': false,

        'width': 670,

        'height': 500

    });

    $("a.PQ").fancybox({

        'type': 'iframe',

        'hideOnContentClick': false,

        'width': 705,
        
        'height': 400,
        
        'opacity': true,
        
        'titleShow' : false
        

    });

    $("a.ajaxPageETA").fancybox({

        'overlayShow': true,

        'hideOnContentClick': false,

        'width': 300,

        'height': 200

    });

    $('A[rel="popup"]').click(function () {

        window.open($(this).attr('href'));

        return false;

    });

    

    $.localScroll.defaults.axis = 'y';

	

	var $tabs = $('#productTabs').tabs(); // first tab selected

	

	$('.scrollToo').localScroll({

		duration:1000,

		onBefore:function(){

			$tabs.tabs('select', 2); // switch to third tab

		}

	});
	
	$("input[id$=startDatePicker], input[id$=endDatePicker]").datepicker
	(
	    { dateFormat: 'dd/mm/yy'}
    );

	$('#productTabs').tabs({ fx: { opacity: 'toggle' } });
	
	$('.productSubTabs').tabs({ fx: { opacity: 'toggle' } });
	
	$('.communityTabs').tabs({ fx: { opacity: 'toggle' } });

    
    if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod'){
    
        $("#k_float").css("position", "static");
    
    };


});

