/**
 * $Id: common.js 19967 2009-10-28 22:58:38Z ajl $
 * @author alevasseur-arribas
 */
if (typeof console == "undefined") { var console = {}; console.log = function(){}; } //fail silently in IE         
if (typeof EXPOTV == "undefined") { var EXPOTV = {}; }

$U = EXPOTV.utils = new function()
{
	var self = this;
	
	this.init = function()
	{
		/* IE6 background-image cache fix: force background-image cache*/
		try {
		  document.execCommand("BackgroundImageCache", false, true);
		} catch(err) {}
		
		self.initNavbar();
		self.initSearchBox();
		self.initShrinkByWidth();
		self.initWatermarks();
		$.preloadCssImages();
	};
	
	/*
	 * Pre-init functions:
	 *  These are to be called from the html as soon as that section of the html is loaded.
	 */
	     
    this.preInitQuickLogin = function()
    {
        var $quickLoginWrap = $('.quick-login-wrap');
        var $loginText = $('.login-text');
        
        $quickLoginWrap.find('input[name=username]').watermark('Username');
        $quickLoginWrap.find('input[name=password]').watermark('Password');
            
        $('#loginBar a.loginLink').one('click', function(e)
        {
            e.preventDefault();
            $loginText.css('display', 'none');
            $quickLoginWrap
                .css('display', 'inline')
                .find('input:first').focus();
            
            $(this).click(function(e)
            {
                e.preventDefault();
                $quickLoginWrap.find('form').submit();
            });
        });
    };
    
    this.preInitSearch = function()
    {
    	var $search = $('.search');
    	$search.find('input[name=query]').watermark('Search by product name or brand...');
    }
	
	/////////////////////////
	
	this.initShrinkByWidth = function()
	{
        $(".shrinkByWidth").each(function() {
            var targetWidth = $(this).parent(':first').width();
            
            if (isNaN(parseInt($(this).css("font-size"))))
                $(this).css("font-size", '24px');
    
            while ($(this).width() > targetWidth) 
            {
                $(this).css("font-size", (parseInt($(this).css("font-size")) - 1) + 'px');
            }
        }); 
	};
	
    /* function to insert style sheet directly after title tag
     * the style sheet can then hide those elements that need to have events attached with js
     * Those elements can then be exposed using js after events are attached. */
	this.addHasJSStyleSheet = function(strUrl)
    {
        var strCssUrl = strUrl;
        var tempLink = document.createElement("link");
        tempLink.setAttribute("rel", "stylesheet");
        tempLink.setAttribute("type", "text/css");
        tempLink.setAttribute("href", strCssUrl);
        var titleEl = document.getElementsByTagName("title")[0];
        $('title:first').after(tempLink)
        //YAHOO.util.Dom.insertAfter(tempLink, titleEl);
    };
    
    /* function used for quick selectbox navigation */
    this.selectNavigationHandler = function()
    {
        var selectEl = this;
        var selectValueStr = selectEl.options[selectEl.selectedIndex].value;
        if (selectValueStr !== "null")
        {
            window.location.href = selectValueStr;
            return true;
        }
        return false;
    };
    
    this.rand = function()
    {
    	return Math.ceil(Math.random()*10000000000001);
    };
    
	this.isEventSupported = (function()
	{
		var TAGNAMES = 
		{
		    'select':'input','change':'input',
		    'submit':'form','reset':'form',
		    'error':'img','load':'img','abort':'img'
		}, 
        cache = { };
        
        function isEventSupported(eventName, element) 
        {
		    var canCache = (arguments.length == 1);
		    
		    if (eventName == 'beforeunload')
		    {
		    	element = typeof window.onbeforeunload != 'undefined' ? window : void 0;
		    }
		
		    // only return cached result when no element is given
		    if (canCache && cache[eventName]) {
		        return cache[eventName];
		    }
		
		    element = element || document.createElement(TAGNAMES[eventName] || 'div');
		    eventName = 'on' + eventName;
		
		    // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize"
		    // `in` "catches" those
		    var isSupported = (eventName in element);
		
		    if (!isSupported && element.setAttribute) {
		        element.setAttribute(eventName, 'return;');
		        isSupported = typeof element[eventName] == 'function';
		    }
		
		    element = null;
		    return canCache ? (cache[eventName] = isSupported) : isSupported;
        }
        return isEventSupported;
	})();
    
    this.getFormValues = function(form)
    {
    	var $form = (typeof(form) == 'string') ? $("#" + form) : form;
        var $fields = $form.find("input:not(:checkbox, :radio), input:checkbox:checked, " +
                                 "input:radio:checked, select, textarea");
        var formValuesObj = {};

        $fields.each(function()
        {
            var fieldName =  $(this).attr("name");
            var fieldValue = $(this).val();

            formValuesObj[fieldName] = fieldValue;
        });

        return formValuesObj;
    };
    
    this.getParam = function(param) // for when $.url doesn't work..
    {
        param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
        var regexS = "[\\?&]"+param+"=([^&#]*)";
        var regex = new RegExp( regexS );
        var results = regex.exec( window.location.href );
        
        if( results == null )
          return null;
        else
            return results[1];
    }
    
    this.getPageSizeArray = function()
    {
        var xScroll, yScroll;
        
        if (window.innerHeight && window.scrollMaxY) 
        {  
            xScroll = document.body.scrollWidth;
            yScroll = window.innerHeight + window.scrollMaxY;
        } 
        else if (document.body.scrollHeight > document.body.offsetHeight) // all but Explorer Mac
        { 
            xScroll = document.body.scrollWidth;
            yScroll = document.body.scrollHeight;
        } 
        else // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari 
        { 
            xScroll = document.body.offsetWidth;
            yScroll = document.body.offsetHeight;
        }
        
        var windowWidth, windowHeight;
        if (self.innerHeight) // all except Explorer 
        { 
            windowWidth = self.innerWidth;
            windowHeight = self.innerHeight;
        } 
        else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode 
        { 
            windowWidth = document.documentElement.clientWidth;
            windowHeight = document.documentElement.clientHeight;
        } 
        else if (document.body) // other Explorers 
        {
            windowWidth = document.body.clientWidth;
            windowHeight = document.body.clientHeight;
        }   
        
        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight)
        {
            pageHeight = windowHeight;
        } 
        else 
        { 
            pageHeight = yScroll;
        }
    
        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth)
        {  
            pageWidth = windowWidth;
        }
        else 
        {
            pageWidth = xScroll;
        }
    
        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
        return arrayPageSize;
    };
    
    this.getPageScrollArray = function()
    {
        var yScroll;
    
        if (self.pageYOffset) 
        {
            yScroll = self.pageYOffset;
        } 
        else if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict
        {  
            yScroll = document.documentElement.scrollTop;
        } 
        else if (document.body) // all other Explorers 
        {
            yScroll = document.body.scrollTop;
        }
    
        arrayPageScroll = new Array('',yScroll);
        return arrayPageScroll;
    };
	
	/* for top navbar dropdowns and selected states */
	this.initNavbar = function()
    {
		/* add rounded corners to first and last tab*/
		$('.menu-wrapper li').each(function(i){
			if($(this).is(':first-child')) $(this).find('a').addClass("top_left_round_5");
			if($(this).is(':last-child')) $(this).find('a').addClass("top_right_round_5");
		});
		
		/* find selected state*/
		var urlString = document.URL.split('.com')[1];
		$('.menu-wrapper li a').each(function(i)
		{
			var linkStr = $(this).attr("href");
			if(urlString.length == 1 && linkStr.length == 1){
				$(this).addClass("selected");
			}
			else if (urlString.match(linkStr) && linkStr.length > 1){
				$(this).addClass("selected");
			}
		});
		
		/* explore tab drop down */
        $(".explore").toggle(function()
        {
        	
        	$('.menu-wrapper').addClass("drop-down-active");
        	//$('.drop-down').css("display", 'block');
        	$(this).addClass('on');
        	$('.drop-down').hide().fadeIn('fast');
            
        },function()
        {
        	$('.menu-wrapper').removeClass("drop-down-active");
        	$('.drop-down').fadeOut('fast');
        	$(this).removeClass('on');
        });

        $(".close-dd").click(function()
		{
        	$('.menu-wrapper').removeClass("drop-down-active");
        	$('.drop-down').fadeOut('fast');
        	$(this).removeClass('on');
		});
        
        /* IE ROUNDED CORNERS HACK */
        DD_roundies.addRule('.round_5', '5px');
        DD_roundies.addRule('.top_right_round_5', '0 10px 0 0');
        DD_roundies.addRule('.top_left_round_5', '10px 0 0 0');
        DD_roundies.addRule('.top_round_5', '10px 10px 0 0');
        DD_roundies.addRule('.top_round_10', '10px 10px 0 0');
        DD_roundies.addRule('.bottom_round_10', '0 0 10px 10px');
        DD_roundies.addRule('.round_15', '15px');
    };
    
    this.initSearchBox = function()
    {
        var $searchBox = $('#txtHeaderSearchBox');
        
        if (!$searchBox.val())
        {
            //$searchBox.focus();
        }
        else
        {
        	$('#txtHeaderSearchBox').one('focus', function()
        	{
        		this.select();
        	});
        }
    };
    
    this.initWatermarks = function()
    {
        $('input.watermark').each(function(i)
        {
            var watermarkStr = $(this).attr('class').match(/watermark:'(.*)'/);
            
            if (watermarkStr && watermarkStr[1])
            {
                $(this).watermark(watermarkStr[1]);
            }
        });
    };
    
    this.showLoading = function()
    {
    	$('#pleaseWait').fadeIn('fast');
    };
    
    this.hideLoading = function()
    {
    	$('#pleaseWait').fadeOut('fast');
    };
    
	$(window).bind('ajaxError', function(ajaxError, xhr, etc)
	{
		self.hideLoading();
		console.log(ajaxError);
		console.log(xhr);
		console.log(etc);
	});
}

// Misc prototypes:
String.prototype.format = function()
{
    var txt = this;
    for (var i=0;i<arguments.length;i++)
    {
        var exp = new RegExp('\\{' + (i) + '\\}','gm');
        txt = txt.replace(exp,arguments[i]);
    }
    return txt;
};

Array.prototype.remove = function(from, to) 
{
    var rest = this.slice((to || from) + 1 || this.length);
    this.length = from < 0 ? this.length + from : from;
    return this.push.apply(this, rest);
};

Array.prototype.removeVal = function(val)
{
    for ( var i = 0, length = this.length; i < length; i++ )
    {
        // Use === because on IE, window == document
        if ( this[ i ] === val )
        {
            this.remove(i);  
            return true;
        }
    }
    
    return false;
};

// Shortcuts:
$E = EXPOTV;
log = console.log;

///////////

$(EXPOTV.utils.init);


// Helpers:

var DD_roundies={ns:'DD_roundies',IE6:false,IE7:false,IE8:false,IEversion:function(){if(document.documentMode!=8&&document.namespaces&&!document.namespaces[this.ns]){this.IE6=true;this.IE7=true;}else if(document.documentMode==8){this.IE8=true;}},querySelector:document.querySelectorAll,selectorsToProcess:[],imgSize:{},createVmlNameSpace:function(){if(this.IE6||this.IE7){document.namespaces.add(this.ns,'urn:schemas-microsoft-com:vml');}if(this.IE8){document.writeln('<?import namespace="'+this.ns+'" implementation="#default#VML" ?>');}},createVmlStyleSheet:function(){var style=document.createElement('style');document.documentElement.firstChild.insertBefore(style,document.documentElement.firstChild.firstChild);if(style.styleSheet){try{var styleSheet=style.styleSheet;styleSheet.addRule(this.ns+'\\:*','{behavior:url(#default#VML)}');this.styleSheet=styleSheet;}catch(err){}}else{this.styleSheet=style;}},addRule:function(selector,rad,standards){if(typeof rad=='undefined'||rad===null){rad=0;}if(rad.constructor.toString().search('Array')==-1){rad=rad.toString().replace(/[^0-9 ]/g,'').split(' ');}for(var i=0;i<4;i++){rad[i]=(!rad[i]&&rad[i]!==0)?rad[Math.max((i-2),0)]:rad[i];}if(this.styleSheet){if(this.styleSheet.addRule){var selectors=selector.split(',');for(var i=0;i<selectors.length;i++){this.styleSheet.addRule(selectors[i],'behavior:expression(DD_roundies.roundify.call(this, ['+rad.join(',')+']))');}}else if(standards){var moz_implementation=rad.join('px ')+'px';this.styleSheet.appendChild(document.createTextNode(selector+' {border-radius:'+moz_implementation+'; -moz-border-radius:'+moz_implementation+';}'));this.styleSheet.appendChild(document.createTextNode(selector+' {-webkit-border-top-left-radius:'+rad[0]+'px '+rad[0]+'px; -webkit-border-top-right-radius:'+rad[1]+'px '+rad[1]+'px; -webkit-border-bottom-right-radius:'+rad[2]+'px '+rad[2]+'px; -webkit-border-bottom-left-radius:'+rad[3]+'px '+rad[3]+'px;}'));}}else if(this.IE8){this.selectorsToProcess.push({'selector':selector,'radii':rad});}},readPropertyChanges:function(el){switch(event.propertyName){case'style.border':case'style.borderWidth':case'style.padding':this.applyVML(el);break;case'style.borderColor':this.vmlStrokeColor(el);break;case'style.backgroundColor':case'style.backgroundPosition':case'style.backgroundRepeat':this.applyVML(el);break;case'style.display':el.vmlBox.style.display=(el.style.display=='none')?'none':'block';break;case'style.filter':this.vmlOpacity(el);break;case'style.zIndex':el.vmlBox.style.zIndex=el.style.zIndex;break;}},applyVML:function(el){el.runtimeStyle.cssText='';this.vmlFill(el);this.vmlStrokeColor(el);this.vmlStrokeWeight(el);this.vmlOffsets(el);this.vmlPath(el);this.nixBorder(el);this.vmlOpacity(el);},vmlOpacity:function(el){if(el.currentStyle.filter.search('lpha')!=-1){var trans=el.currentStyle.filter;trans=parseInt(trans.substring(trans.lastIndexOf('=')+1,trans.lastIndexOf(')')),10)/100;for(var v in el.vml){el.vml[v].filler.opacity=trans;}}},vmlFill:function(el){if(!el.currentStyle){return;}else{var elStyle=el.currentStyle;}el.runtimeStyle.backgroundColor='';el.runtimeStyle.backgroundImage='';var noColor=(elStyle.backgroundColor=='transparent');var noImg=true;if(elStyle.backgroundImage!='none'||el.isImg){if(!el.isImg){el.vmlBg=elStyle.backgroundImage;el.vmlBg=el.vmlBg.substr(5,el.vmlBg.lastIndexOf('")')-5);}else{el.vmlBg=el.src;}var lib=this;if(!lib.imgSize[el.vmlBg]){var img=document.createElement('img');img.attachEvent('onload',function(){this.width=this.offsetWidth;this.height=this.offsetHeight;lib.vmlOffsets(el);});img.className=lib.ns+'_sizeFinder';img.runtimeStyle.cssText='behavior:none; position:absolute; top:-10000px; left:-10000px; border:none;';img.src=el.vmlBg;img.removeAttribute('width');img.removeAttribute('height');document.body.insertBefore(img,document.body.firstChild);lib.imgSize[el.vmlBg]=img;}el.vml.image.filler.src=el.vmlBg;noImg=false;}el.vml.image.filled=!noImg;el.vml.image.fillcolor='none';el.vml.color.filled=!noColor;el.vml.color.fillcolor=elStyle.backgroundColor;el.runtimeStyle.backgroundImage='none';el.runtimeStyle.backgroundColor='transparent';},vmlStrokeColor:function(el){el.vml.stroke.fillcolor=el.currentStyle.borderColor;},vmlStrokeWeight:function(el){var borders=['Top','Right','Bottom','Left'];el.bW={};for(var b=0;b<4;b++){el.bW[borders[b]]=parseInt(el.currentStyle['border'+borders[b]+'Width'],10)||0;}},vmlOffsets:function(el){var dims=['Left','Top','Width','Height'];for(var d=0;d<4;d++){el.dim[dims[d]]=el['offset'+dims[d]];}var assign=function(obj,topLeft){obj.style.left=(topLeft?0:el.dim.Left)+'px';obj.style.top=(topLeft?0:el.dim.Top)+'px';obj.style.width=el.dim.Width+'px';obj.style.height=el.dim.Height+'px';};for(var v in el.vml){var mult=(v=='image')?1:2;el.vml[v].coordsize=(el.dim.Width*mult)+', '+(el.dim.Height*mult);assign(el.vml[v],true);}assign(el.vmlBox,false);if(DD_roundies.IE8){el.vml.stroke.style.margin='-1px';if(typeof el.bW=='undefined'){this.vmlStrokeWeight(el);}el.vml.color.style.margin=(el.bW.Top-1)+'px '+(el.bW.Left-1)+'px';}},vmlPath:function(el){var coords=function(direction,w,h,r,aL,aT,mult){var cmd=direction?['m','qy','l','qx','l','qy','l','qx','l']:['qx','l','qy','l','qx','l','qy','l','m'];aL*=mult;aT*=mult;w*=mult;h*=mult;var R=r.slice();for(var i=0;i<4;i++){R[i]*=mult;R[i]=Math.min(w/2,h/2,R[i]);}var coords=[cmd[0]+Math.floor(0+aL)+','+Math.floor(R[0]+aT),cmd[1]+Math.floor(R[0]+aL)+','+Math.floor(0+aT),cmd[2]+Math.ceil(w-R[1]+aL)+','+Math.floor(0+aT),cmd[3]+Math.ceil(w+aL)+','+Math.floor(R[1]+aT),cmd[4]+Math.ceil(w+aL)+','+Math.ceil(h-R[2]+aT),cmd[5]+Math.ceil(w-R[2]+aL)+','+Math.ceil(h+aT),cmd[6]+Math.floor(R[3]+aL)+','+Math.ceil(h+aT),cmd[7]+Math.floor(0+aL)+','+Math.ceil(h-R[3]+aT),cmd[8]+Math.floor(0+aL)+','+Math.floor(R[0]+aT)];if(!direction){coords.reverse();}var path=coords.join('');return path;};if(typeof el.bW=='undefined'){this.vmlStrokeWeight(el);}var bW=el.bW;var rad=el.DD_radii.slice();var outer=coords(true,el.dim.Width,el.dim.Height,rad,0,0,2);rad[0]-=Math.max(bW.Left,bW.Top);rad[1]-=Math.max(bW.Top,bW.Right);rad[2]-=Math.max(bW.Right,bW.Bottom);rad[3]-=Math.max(bW.Bottom,bW.Left);for(var i=0;i<4;i++){rad[i]=Math.max(rad[i],0);}var inner=coords(false,el.dim.Width-bW.Left-bW.Right,el.dim.Height-bW.Top-bW.Bottom,rad,bW.Left,bW.Top,2);var image=coords(true,el.dim.Width-bW.Left-bW.Right+1,el.dim.Height-bW.Top-bW.Bottom+1,rad,bW.Left,bW.Top,1);el.vml.color.path=inner;el.vml.image.path=image;el.vml.stroke.path=outer+inner;this.clipImage(el);},nixBorder:function(el){var s=el.currentStyle;var sides=['Top','Left','Right','Bottom'];for(var i=0;i<4;i++){el.runtimeStyle['padding'+sides[i]]=(parseInt(s['padding'+sides[i]],10)||0)+(parseInt(s['border'+sides[i]+'Width'],10)||0)+'px';}el.runtimeStyle.border='none';},clipImage:function(el){var lib=DD_roundies;if(!el.vmlBg||!lib.imgSize[el.vmlBg]){return;}var thisStyle=el.currentStyle;var bg={'X':0,'Y':0};var figurePercentage=function(axis,position){var fraction=true;switch(position){case'left':case'top':bg[axis]=0;break;case'center':bg[axis]=0.5;break;case'right':case'bottom':bg[axis]=1;break;default:if(position.search('%')!=-1){bg[axis]=parseInt(position,10)*0.01;}else{fraction=false;}}var horz=(axis=='X');bg[axis]=Math.ceil(fraction?((el.dim[horz?'Width':'Height']-(el.bW[horz?'Left':'Top']+el.bW[horz?'Right':'Bottom']))*bg[axis])-(lib.imgSize[el.vmlBg][horz?'width':'height']*bg[axis]):parseInt(position,10));bg[axis]+=1;};for(var b in bg){figurePercentage(b,thisStyle['backgroundPosition'+b]);}el.vml.image.filler.position=(bg.X/(el.dim.Width-el.bW.Left-el.bW.Right+1))+','+(bg.Y/(el.dim.Height-el.bW.Top-el.bW.Bottom+1));var bgR=thisStyle.backgroundRepeat;var c={'T':1,'R':el.dim.Width+1,'B':el.dim.Height+1,'L':1};var altC={'X':{'b1':'L','b2':'R','d':'Width'},'Y':{'b1':'T','b2':'B','d':'Height'}};if(bgR!='repeat'){c={'T':(bg.Y),'R':(bg.X+lib.imgSize[el.vmlBg].width),'B':(bg.Y+lib.imgSize[el.vmlBg].height),'L':(bg.X)};if(bgR.search('repeat-')!=-1){var v=bgR.split('repeat-')[1].toUpperCase();c[altC[v].b1]=1;c[altC[v].b2]=el.dim[altC[v].d]+1;}if(c.B>el.dim.Height){c.B=el.dim.Height+1;}}el.vml.image.style.clip='rect('+c.T+'px '+c.R+'px '+c.B+'px '+c.L+'px)';},pseudoClass:function(el){var self=this;setTimeout(function(){self.applyVML(el);},1);},reposition:function(el){this.vmlOffsets(el);this.vmlPath(el);},roundify:function(rad){this.style.behavior='none';if(!this.currentStyle){return;}else{var thisStyle=this.currentStyle;}var allowed={BODY:false,TABLE:false,TR:false,TD:false,SELECT:false,OPTION:false,TEXTAREA:false};if(allowed[this.nodeName]===false){return;}var self=this;var lib=DD_roundies;this.DD_radii=rad;this.dim={};var handlers={resize:'reposition',move:'reposition'};if(this.nodeName=='A'){var moreForAs={mouseleave:'pseudoClass',mouseenter:'pseudoClass',focus:'pseudoClass',blur:'pseudoClass'};for(var a in moreForAs){handlers[a]=moreForAs[a];}}for(var h in handlers){this.attachEvent('on'+h,function(){lib[handlers[h]](self);});}this.attachEvent('onpropertychange',function(){lib.readPropertyChanges(self);});var giveLayout=function(el){el.style.zoom=1;if(el.currentStyle.position=='static'){el.style.position='relative';}};giveLayout(this.offsetParent);giveLayout(this);this.vmlBox=document.createElement('ignore');this.vmlBox.runtimeStyle.cssText='behavior:none; position:absolute; margin:0; padding:0; border:0; background:none;';this.vmlBox.style.zIndex=thisStyle.zIndex;this.vml={'color':true,'image':true,'stroke':true};for(var v in this.vml){this.vml[v]=document.createElement(lib.ns+':shape');this.vml[v].filler=document.createElement(lib.ns+':fill');this.vml[v].appendChild(this.vml[v].filler);this.vml[v].stroked=false;this.vml[v].style.position='absolute';this.vml[v].style.zIndex=thisStyle.zIndex;this.vml[v].coordorigin='1,1';this.vmlBox.appendChild(this.vml[v]);}this.vml.image.fillcolor='none';this.vml.image.filler.type='tile';this.parentNode.insertBefore(this.vmlBox,this);this.isImg=false;if(this.nodeName=='IMG'){this.isImg=true;this.style.visibility='hidden';}setTimeout(function(){lib.applyVML(self);},1);}};try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}DD_roundies.IEversion();DD_roundies.createVmlNameSpace();DD_roundies.createVmlStyleSheet();if(DD_roundies.IE8&&document.attachEvent&&DD_roundies.querySelector){document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete'){var selectors=DD_roundies.selectorsToProcess;var length=selectors.length;var delayedCall=function(node,radii,index){setTimeout(function(){DD_roundies.roundify.call(node,radii);},index*100);};for(var i=0;i<length;i++){var results=document.querySelectorAll(selectors[i].selector);var rLength=results.length;for(var r=0;r<rLength;r++){if(results[r].nodeName!='INPUT'){delayedCall(results[r],selectors[i].radii,r);}}}}});};