﻿
jQuery(function(){var gcallback;function OnValueChange(select,callback){if(!jQuery(select).val()){jQuery(select).parents(".selector").next('.selector').remove();jQuery(select).parents(".selector").prev('.selector').find("select").attr('name','filter');return;}
jQuery(select).attr("name","filter");jQuery(select).parents(".selector").prev('.selector').find("select").removeAttr("name");jQuery.ajax({url:'/ajax.aspx?m=Nv.SqlModule&name=FaqLevel&la='+NvPage.LanguageId+'&filter='+jQuery(select).val(),dataType:'xml',success:function(r){var document=jQuery(r);var nextSelect=jQuery(select).parents().next('.selector').find('select');if(document.find('Category').length){if(nextSelect.length==0){nextSelect=jQuery('<select />');jQuery(select).parents('.selector').after(nextSelect);nextSelect.uniform();nextSelect.change(function(){OnValueChange(this);});}
nextSelect.html('');jQuery("<option />").attr("value",'').text('...').appendTo(nextSelect);document.find('Category').each(function(){jQuery("<option />").attr("value",jQuery(this).attr("ID")).text(jQuery(this).text()).appendTo(nextSelect);});jQuery(select).attr("name","filter");nextSelect.removeAttr("name");nextSelect.change();if(callback){callback();}}
else{nextSelect.val('');nextSelect.change();nextSelect.removeAttr("name");jQuery(select).attr("name","filter");nextSelect.parents('.selector').remove();}
if(gcallback){gcallback();}}});}
jQuery('.date-picker.faq select').change(function(){OnValueChange(this);});var selected=parseUri(window.location.href).queryKey["filter"];if(selected){var Levels=[];var selectBox=jQuery('.date-picker.faq select');var currentLevel=1000;function Check(){jQuery.ajax({url:'/ajax.aspx?m=Nv.SqlModule&name=FaqLevel&la='+NvPage.LanguageId+'&filter='+selected,dataType:'xml',success:function(r){var document=jQuery(r);Levels.push({level:currentLevel-1,value:selected});currentLevel-=1;selected=parseInt(document.find('Categories').attr("ParentID"));if(!selectBox.find('option[value='+selected+']').length){Check();}
else{Levels.push({level:currentLevel-1,value:selected});Levels.reverse();var currentIndex=0;function updateValue(){if(currentIndex>=Levels.length)
return;selectBox.val(Levels[currentIndex].value).change();OnValueChange(selectBox,function(){currentIndex+=1;selectBox=selectBox.parents('.selector').next('.selector').find('select');updateValue();});}
updateValue();}}});}
if(!selectBox.find('option[value='+selected+']').length){Check();}
if(!jQuery(".faq-item").length){gcallback=function(){jQuery('.date-picker select:last').val(jQuery('.date-picker select:last option:eq(1)').val()).change();jQuery('.date-picker input[type=submit]').parents('form').get(0).submit();}}
jQuery('.date-picker select').change();}});jQuery(function(){jQuery("a").live('click',function(e){var u=parseUri(jQuery(this).attr("href"));if(u.anchor=="FAQ")
{jQuery.ajax({url:'/ajax.aspx?m=Nv.SqlModule&name=FAQPopup&la='+NvPage.LanguageId+'&pid='+NvPage.PageId,dataType:'html',success:function(r)
{jQuery('body').append(r);var container=jQuery('div.pop');AttachFaqHandler(container);container.css('height','100%');container.css('position','fixed');container.click(function(e)
{});jQuery('div.pop-close a',container).click(function(e)
{e.preventDefault();container.remove();});}});}});});

/*
File ends here
*/
