// JavaScript Document
$(function () {

	function redirect(url)
	{
		document.location = url;
	}
	
	/*
	 * offer_open_subscription_link()
	 * Open a Popup or Redirect to the Subscription Link
	 */
	function offer_open_subscription_link() {
		url = $("input[name=offer_id]:checked").val();
		
		if (!url) {
			return false;
		}
		
		if (document.window) {
			if (document.window.open) {
				document.window.open(url);
			}
		} else {
			if (window.open) {
				window.open(url);
			}
		}
	}
	
	var default_offer = '6';
	var default_offer_ec = 'CB9';
	
	//$("#intekenform input").bind('change', function () { default_offer = $(this).val(); default_offer_ec = $(this).attr('sec'); });
	$('#accept_offer').bind('click', function (e) {offer_open_subscription_link();});
	
	var default_HKOH = '';
	var default_HKOHtype = 'redirect';
	
	function HoeKanOnsHlpbtnAction()
	{
		if (default_HKOH.length > 0)
		{
			if (default_HKOHtype == 'popup')
			{
				tb_show(null, default_HKOH, null);
			}
			else
			{
				redirect(default_HKOH);
			}
		}
	}
	
	$("#HoeKanOnsHelp input").bind('click', function () { 

		$('#HoeKanOnsHelpbtn').attr('disabled', '');
		$('#HoeKanOnsHelpbtn').attr('style', 'color:#741C1B');
	});
	
	$("#HoeKanOnsHelp input").bind('change', function () { 

		default_HKOHtype = $(this).attr('xreftype');
		default_HKOH = $(this).attr('xref');
		
		$('#HoeKanOnsHelpbtn').attr('disabled', '');
		$('#HoeKanOnsHelpbtn').attr('style', 'color:#741C1B');
	});
	$('#HoeKanOnsHelpbtn').bind('click', function (e) { HoeKanOnsHlpbtnAction(); });

});
