﻿
/* JS for dropdown menus in top-navigation */
window.onload = function () {
    var lis = document.getElementById('cssdropdown').getElementsByTagName('li');
    for (i = 0; i < lis.length; i++) {
        var li = lis[i];
        
        // ** NOTE **:  'headlink2' (Insider Exclusives) WAS REMOVED FROM if STATEMENT BELOW SINCE IT CURRENTLY HAS NO DROPDOWN!!
    	if (li.className == 'headlink1' || li.className == 'headlink3' || li.className == 'headlink4' || li.className == 'headlink5') {
    		li.onmouseover = function () { this.getElementsByTagName('ul').item(0).style.display = 'block'; }
    		li.onmouseout = function () { this.getElementsByTagName('ul').item(0).style.display = 'none'; }
    	}
    }
}
/* or with jQuery:
$(document).ready(function(){
$('#cssdropdown li.headlink').hover(
function() { $('ul', this).css('display', 'block'); },
function() { $('ul', this).css('display', 'none'); });
});
*/


/* ---------------------------------------------------
JS FOR FOOTER CAROUSEL*/

jQuery(document).ready(function () {
    jQuery('#mycarousel').jcarousel({
    	wrap: 'circular',
    	scroll: 1,
    	buttonNextHTML: '<img src=/images/footer/arrow_next2.jpg width=16 height=137>',
    	buttonPrevHTML: '<img src=/images/footer/arrow_prev2.jpg width=16 height=137>',
    	buttonNextEvent: 'click',
    	buttonPrevEvent: 'click'
    });
});


/* JS FOR COLLAPSER ON Product Registration PAGE */
jQuery(document).ready(function () {
    jQuery(".content").hide();
    jQuery(".HelpA1").hide();
    jQuery(".HelpA2").hide();
    jQuery(".HelpA3").hide();
    jQuery(".HelpA4").hide();
    jQuery(".HelpA5").hide();

    //toggle the component with class msg_body
    jQuery(".heading").click(function () {
    	jQuery(".content").slideToggle(500);
    });

    jQuery(".HelpQ1").click(function () {
    	jQuery(".HelpA1").slideToggle(500);
    });

    jQuery(".HelpQ2").click(function () {
    	jQuery(".HelpA2").slideToggle(500);
    });

    jQuery(".HelpQ3").click(function () {
    	jQuery(".HelpA3").slideToggle(500);
    });

    jQuery(".HelpQ4").click(function () {
    	jQuery(".HelpA4").slideToggle(500);
    });

    jQuery(".HelpQ5").click(function () {
    	jQuery(".HelpA5").slideToggle(500);
    });

});

/* JS FOR INFO POPUP BUBBLE ON Product Registration PAGE */
$(document).ready(function () {

	//create a bubble popup for info on Serial # for registered products
    $('.textSerial, #iconSerial').CreateBubblePopup({

		position: 'bottom',
		align: 'center',

		width: '375',
		height: '300',
		distance: '20',
		tail: { hidden: false },
		innerHtml: '<b><div style="font-size:14px;color:#000;">Where to find Serial Numbers:</div></b><BR><u>Drivers &amp; Fairway Woods</u>: heel of the head<BR><u>Hybrids</u>: heel of the head<BR><u>Iron</u>: On the hosel of the 8 iron only<BR><u>Wedges</u>: On the hosel<BR><u>Putters</u>: Sole of the head<br /><br /><b>Please Note</b>: Custom built clubs will not have a serial number. Serial number is not mandatory, but please include Authorized Dealer and date purchased. It is also a good idea to keep your receipt.',

		innerHtmlStyle: {
			color: '#333',
			padding: '0px 15px 0px 15px',
			'text-align': 'left'
		},

		themeName: 'all-grey',
		themePath: '/images/jquerybubblepopup-theme'

	});



	//create a bubble popup to explain why birthday is required for Signup
$('.textBirthday, #iconBirthday').CreateBubblePopup({

		position: 'bottom',
		align: 'center',

		width: '375',
		height: '220',
		distance: '20',
		tail: { hidden: false },
		innerHtml: '<b><div style="font-size:14px;color:#000;">Why do we want your birthday?</div></b><BR>At the end of each month we will be drawing a monthly winner for the HAPPY BIRDIE TO YOU, BIRTHDAY GIVEAWAY! Each mycallaway.ca member who has filled in their birthday will be automatically entered for a chance to win an amazing birthday gift from Callaway Golf Canada.',

		innerHtmlStyle: {
			color: '#333',
			padding: '0px 15px 0px 15px',
			'text-align': 'left'
		},

		themeName: 'all-grey',
		themePath: '/images/jquerybubblepopup-theme'

	});



	//create a bubble popup to explain why Aeroplan number is requested
$('.textAeroplan, #iconAeroplan').CreateBubblePopup({

		position: 'top',
		align: 'center',

		width: '375',
		height: '220',
		distance: '20',
		tail: { hidden: false },
		innerHtml: '<b><div style="font-size:14px;color:#000;">Why fill in your Aeroplan number?</div></b><BR>Enter your Aeroplan number in the appropriate field to the right to start earning Aeropan Miles on selected MyCallaway.ca contests. From time to time we will be giving away FREE Aeroplan Miles to MyCallaway.ca members, so be sure to have your Aeroplan number updated in your MyCallaway.ca profile.',

		innerHtmlStyle: {
			color: '#333',
			padding: '0px 15px 0px 15px',
			'text-align': 'left'
		},

		themeName: 'all-grey',
		themePath: '/images/jquerybubblepopup-theme'

	});


});

