

    //function displayResults(){
        //var i_frame = jQuery(".answerscript>#scriptiframe");
        //alert(jQuery(i_frame).contents().find('.restype_353'));
        //alert(jQuery(i_frame).children('div').find('.restype_353').length);
        //jQuery(i_frame).contents().each(function(){
            //alert(this.childNodes[0].childNodes[1].childNodes[0]);
    //    });
        //if(pricedetail.type == "Message"){
            //jQuery('.error').hide();
            //jQuery("#pages_353 #page_2_353 .result_353").html("&pound;"+pricedetail.msg);
            //jQuery("#panel_1_353").css("background","#1155BB url(http://uidget.appspot.com/hf/static/hw_result.png) repeat scroll 0 0");
            //jQuery("#pages_353 #page_1_353").hide();
            //jQuery("#pages_353 #page_2_353").show();
        //}
        //if(pricedetail.type == "Error"){
            //var elem = jQuery('#'+pricedetail.elem+"_error_353");
            //elem.html(pricedetail.msg);
            //elem.show("fast");
        //    alert(pricedetail.msg);
        //}
    //}
    
    jQuery(function(){

        jQuery('#submit_353').click(function(){
            //detect whether the combination is valid
            //NOT (("Insured & Child" OR "Family") AND ("66,70" OR "71,75")) OR ("Worldwide Inc USA" AND ("66,70" OR "71,75"))
            //people.selectedIndex==(2 OR 3) age.selectedIndex==(7 OR 8) tripType.selectedIndex==1
            var speople = document.getElementsByName('people')[0].selectedIndex;
            var sage = document.getElementsByName('age')[0].selectedIndex;
            var stripType = document.getElementsByName('tripType')[0].selectedIndex;
            
            if(sage == 7 || sage == 8){
                if(speople == 2 || speople == 3){
                    alert("This type of insurance is not applicable to this age range");
                    return false;
                }
                if(stripType==1){
                    alert("This type of insurance is not applicable to this age range");
                    return false;                
                }
            }
        
			var exists = jQuery('#scriptiframe').length;
			if(exists>0){
				jQuery('#scriptiframe').remove();
			}
            jQuery('#wrapper_353').append("<div class=\"answerscript\"><div>");
            var script = document.createElement('iframe');
            script.src = "http://uidget.appspot.com/hf/res?" + jQuery('#myform_353').serialize();
            script.id = "scriptiframe";
            script.allowTransparency = true;
            script.frameBorder = "0";
            script.scrolling = "no";
            //alert(script.src);
            jQuery('.result_353').append(script);
            jQuery('.result_353>iframe').attr("height","31px");
            jQuery('.result_353>iframe').attr("width","170px");
            jQuery('#panel_sw_2_353').css("display","none");
            //alert(jQuery('.answerscript').innerhtml);
			//displayResults();
            
            jQuery('.error').hide();
            //jQuery("#pages_353 #page_2_353 .result_353").html("&pound;"+pricedetail.msg);
            jQuery("#panel_1_353").css("background","#1155BB url(http://uidget.appspot.com/hf/static/hw_result.png) repeat scroll 0 0");
            jQuery("#pages_353 #page_1_353").hide();
            jQuery("#pages_353 #page_2_353").show();
            return false;
        });
        jQuery('#return_353').click(function(){
            jQuery("#panel_1_353").css("background","#1155BB url(http://uidget.appspot.com/hf/static/hw_panel1-2.png) repeat scroll 0 0");
            jQuery("#pages_353 #page_2_353").hide();
            jQuery('#panel_sw_2_353').css("display","block");
            jQuery("#pages_353 #page_1_353").show();
            return false;
        });
    });


jQuery(function() {
    jQuery('#panel_2_353').hide();

    jQuery('.hw_tabs_353 div').filter(':not(:first)').hide();
    jQuery('.hw_tablinks_353 a').click(function() {
        jQuery('.hw_tablinks_353 a').removeClass('active_353');
        jQuery(this).addClass('active_353');
        the_element = jQuery(this).attr('href');
        if (jQuery(the_element).is(':not(:visible)')) {
            jQuery('.hw_tabs_353 div:visible').fadeOut(200, function(){
                jQuery(the_element).fadeIn(350);
            });
        }
        return false;
    });
    jQuery('#panel_sw_1_353').click(function() {
        jQuery('#panel_2_353').fadeOut(200,function(){
            jQuery('#flash_cont_353').show();
            jQuery('#panel_1_353').fadeIn(400)
        });
        return false;
    });
    jQuery('#panel_sw_2_353').click(function() {
        jQuery('#flash_cont_353').hide();
        jQuery('#panel_1_353').fadeOut(200,function(){
            jQuery('#panel_2_353').fadeIn(400)
        });
        return false;
    });
});