﻿$(function(){
	var strQ = window.location.href;
	strQ = strQ.substring(strQ.indexOf('bw=') + 3 ,strQ.indexOf('bw=') + 4);
	
	if(strQ=='1')
	{
		$('img').each(function(){
			
			if($(this).parent().parent().hasClass('logo'))
			{
				return true;
			}
			
			if($(this).css('float') == 'none')
			{
				$(this).remove();
			}
			
			var w = $(this).width();
			var h = $(this).height();
			
			$(this).attr('src','images/blank.gif').width(w).height(h);
		});
		
		$('.inner-bandwidth span a:eq(1)').addClass('selected');
		$('a').not(' a[href^="http://"], a[href^="javascript:"]').each(function(){
			$(this).attr('href',$(this).attr('href') + '?bw=1');
		});
	}
	else
	{
	    $('.inner-bandwidth span a:eq(0)').addClass('selected');
	}
	
})

function setBW(val)
{
    var qstr = window.location.href;
    if(qstr.indexOf('bw=') == -1) {
        if(qstr.indexOf('?') == -1)
            qstr = qstr + '?bw=' + val;
        else
            qstr = qstr + '&bw=' + val;
    }
    else{
        qstr = qstr.replace(/bw=./,'bw=' + val);
    }
    
    window.location.href = qstr;
}
