$j(function() {
	//sIFR selectors
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#masthead h1',
	   css: {
			'.sIFR-root': { 
				'color': '#404040',
				'letter-spacing': -1,
				'font-size': 30
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#content div.marqueeText h1',
	   css: {
			'.sIFR-root': { 
				'color': '#ffffff',
				'letter-spacing': -1,
				'font-size': 28
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#content div.marqueeText p',
	   css: {
			'.sIFR-root': { 
				'color': '#ffffff', 
				'font-size': 18
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#toutArea h2',
	   css: {
			'.sIFR-root': { 
				'color': '#ffffff', 
				'font-size': 20,
				'cursor': 'pointer'
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#content #header h1',
	   css: {
			'.sIFR-root': { 
				'color': '#cc0000',
				'letter-spacing': -1,
				'font-size': 30
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#content div.tout_dark h2',
	   css: {
			'.sIFR-root': { 
				'color': '#ffffff',
				'font-size': 18
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#content div.tout_dark p',
	   css: {
			'.sIFR-root': { 
				'color': '#ffffff',
				'font-size': 12
			},
			'a': {'color': '#ffffff', 'text-decoration': 'none'},
		    'a:link': {'color': '#ffffff'},
		    'a:hover': {'color': '#ffffff', 'text-decoration': 'underline'}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#flashHome h2',
	   css: {
			'.sIFR-root': { 
				'color': '#ffffff',
				'font-size': 20
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#content div.mc h2',
	   css: {
			'.sIFR-root': { 
				'color': '#404040',
				'font-size': 17
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#content div.mc .webinar',
	   css: {
			'.sIFR-root': { 
				'color': '#404040',
				'font-size': 21,
				'letter-spacing': -1
			}
	   },
	   selectable: false
	});
	
	$j.Avaya.SifrConfig.masterReplace($j.Avaya.SifrConfig.gothamLight,{
	   selector: '#content div.rc h2',
	   css: {
			'.sIFR-root': { 
				'color': '#404040',
				'font-size': 17
			}
	   },
	   selectable: false
	});
	
	//find all selects replace with custom select
	$j('#content select').each(function(){
		//if className exists, assume it is function name
		var submitFunc = this.className?eval('$j.Avaya.DropDownFunctions.'+this.className):null;
		var $select = new $j.Avaya.CustomSelect($j(this),{submitFunction:eval(submitFunc)});
		//lock the select box if 1 or less items
		$select.locked = ($select.listItems.length<=1);
	});
	
	//finder filter for search
	var $filter = $j('#finderFilter');
	var $wrappers = $filter.find('div.filter-wrapper');
	var moreNum = 4;
	$wrappers.each(function(){
		new $j.Avaya.ResultsFilter({element:this}, moreNum);
	});
	$filter.css({
		visibility: 'visible'
	});

});
function gotoSubCatUrl()
	{
	    for (var i=0;i<catjson.length;i++){        
		    if (catjson[i][0] == ctgname) {
		        var optss = catjson[i][1];
		        
		        for(var j=0;j<optss.length;j++)
		        {
		            if(subcat==null || subcat=="")
		            {
		              window.location=location.protocol+"//"+location.host+optss[0].url;
		              break;
		             }
		            if(optss[j].text == subcat)
		               window.location=location.protocol+"//"+location.host+optss[j].url;
		        }
		    }
		}
	}
$j.Avaya.DropDownFunctions = {
    
    
    SubCatInterest:function(){	
       
        subcat=$j('#interests').val();	
    },
	wireTellUs : function(){	
		
		var $select = $j('#tellus');
		ctgname = $select.val();
		
		for (var i=0;i<catjson.length;i++){
		    if (catjson[i][0] == ctgname) {
		        options = catjson[i][1];
		    }
		}
		
		//var url = '/_aquisitionassets/json/choices'+($select.val()=='a'?'0':'')+'.js';
		//$j.ajax({
			//type : 'GET',
			//url: url,
			//dataType : 'json',
			//data :  'tellus='+$select.val(),
			//success : function(response){				
				var interestSelect = $j('#interests');
				
				var opts = '';
				
				for (var i=0;i<options.length;i++){
					opts += '<option value="'+options[i].value+'">'+options[i].text+'</option>';
				}
				
				interestSelect.html(opts);

				var id = interestSelect.next('div.selectWrapper').get(0).id.split('_')[1];				
				var customInterest = $j.Avaya.global.CustomSelects[id];
				customInterest.updateList();
				
				if (options.length <= 1){
					customInterest.container.parents('div.sortedBySelect').eq(0).addClass('disabled');
					customInterest.displaySpan.html("Select");
					customInterest.locked = true;
				} else {
					customInterest.container.parents('div.sortedBySelect').eq(0).removeClass('disabled');
					customInterest.jumpToIndex(0);
					customInterest.matchToIndex();
					customInterest.resetScrollPane();
				}
				
				subcat=$j('#interests').val();		
			}
		//});
	//}
};
