/* *********** Begin Quixtar.Web.UI.Resources.ClientScriptHelper.ClientScripts.HelperMethods.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
YAHOO.namespace ("Quixtar.Web.UI.CS.ClientScriptHelper");

YAHOO.Quixtar.Web.UI.CS.ClientScriptHelper.HelperMethods = {
	StopClick: function(evt) {
		if (!evt) {
			evt = window.event;
		}
		
		//evt.cancelBubble is supported by IE - this will kill the bubbling process.
		evt.cancelBubble = true;
		evt.returnValue = false;

		//evt.stopPropagation works only in Firefox.
		if (evt.stopPropagation) {
			evt.stopPropagation();
			evt.preventDefault();
		}
	}
};
/* *********** End Quixtar.Web.UI.Resources.ClientScriptHelper.ClientScripts.HelperMethods.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.Resources.ClientScriptHelper.ClientScripts.AjaxMethods.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
//Override the Ajax handlers
function ajaxInit()
{
    if ( typeof Ajax == "object" ) 
	{
        Ajax.onTimeout = function ( b, res )
			{ 
			alert ( "Timeout" );
			return true; 
			} 
        
        Ajax.onLoading = function ( b )
			{ 
			//Show spinner 
			} 
        
        Ajax.onError = function ( err, res )
			{ 
			if ( err.Status == 302 )
				{
				document.forms[0].submit();
				}
			else
				{
				LogAjaxError ( err, res );
				alert ( "An error has occurred" );
				}
			} 
    }
}

function ExecuteAjax ( func ) 
{
	try 
		{
		var result = func();
		
		if ( result == null || result.value == null ) 
			{
			throw ( "Error" );
			}
		
		return result;
		} 
	catch ( ex ) 
		{
		window.location.href = CSHELPER_AJAX_LOGOUT_URL;
		return false;
		}
}

function LogAjaxError ( error, response )
{
    // Attempt to log the error - if it doesn't work add the message to a cookie and let the server log it later
    var browserVersion = "";

	if ( typeof navigator == "object" )
		{
		browserVersion = navigator.userAgent;
		}

    var context = {"Status":error.Status, "Name":response.url + "." + response.method, "Description":error.Type + ": " + error.Message + ". Client: " + browserVersion };
   
    Quixtar.Web.UI.AjaxUtility.LogError(context.Status,
        context.Name,
        context.Description,
        300,
        function(){},
        context,
        null,
        LogAjaxError_onerror);
}

function LogAjaxError_onerror ( error, response )
{
	//add a cookie so the server can log this later
	var cookieValues = Get_Cookie("qxtrErrors");

	if ( cookieValues != null )
		{
		cookieValues += "&";
		}
	else
		{
		cookieValues = "";
		}

	//set the expire date in milliseconds so add milliseconds to current date
	var sExpires;
	var dExpires = new Date();
	dExpires.setTime(dExpires.getTime() + (30*60*1000));
	sExpires = dExpires.toGMTString();
	var context = response.context[3][1];

	cookieValues += "Status=" + context.Status +
		"&Name=" + context.Name +
		"&Description=" + context.Description +
		"; expires=" + sExpires +
		"; domain=" + ajax_host +
		"; path=/";
	    
	document.cookie = "qxtrErrors=" + cookieValues;
}

// this function gets the cookie, if it exists
function Get_Cookie( name ) 
{
	var start = document.cookie.indexOf( name + "=" );
    var len = start + name.length + 1;
    
    if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
		{
        return null;
        }
    
    if ( start == -1 ) 
        {
        return null;
        }

    var end = document.cookie.indexOf( ";", len );
    
    if ( end == -1 ) 
		{
        end = document.cookie.length;
        }

	return unescape( document.cookie.substring( len, end ) );
}
/* *********** End Quixtar.Web.UI.Resources.ClientScriptHelper.ClientScripts.AjaxMethods.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.Resources.ClientScriptHelper.YahooUI.ClientScripts.animation-min.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.3.0
*/

YAHOO.util.Anim=function(el,attributes,duration,method){if(!el){}
this.init(el,attributes,duration,method);};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName||el;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}
YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}
var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}
return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}
return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}
start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i]*1;}}else{end=start+attributes[attr]['by']*1;}}
this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);return true;},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=!YAHOO.lang.isUndefined(duration)?duration:1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.setEl=function(element){el=YAHOO.util.Dom.get(element);};this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}
YAHOO.util.AnimMgr.registerElement(this);return true;};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index==-1){return false;}
queue.splice(index,1);tweenCount-=1;if(tweenCount<=0){this.stop();}
return true;};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}
queue=[];thread=null;tweenCount=0;}
else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}
tween._onTween.fire();}
else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}
return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}
if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}
tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}
for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}
return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}
var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}
c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}
c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}
return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}
val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}
else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}
this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}
return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d/2)==2){return b+c;}
if(!p){p=d*(.3*1.5);}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
if(t<1){return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}
return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}
return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;}
return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}
control=tmp;}
if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}
if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}
else{Y.Dom.setXY(el,Y.Dom.getXY(el));}
start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}
this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}
this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}
else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.3.0",build:"442"});
/* *********** End Quixtar.Web.UI.Resources.ClientScriptHelper.YahooUI.ClientScripts.animation-min.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.WebControls.PVBVStar.js  from Quixtar.Web.UI.WebControls, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
function PVBVStarDisplayToggle (node, strTextID) {
	while (node.id != 'divPVBVStarParent') {
		node = node.parentNode;
	}
	
	var nodeText = SearchChildNodes(node, strTextID, true);
	if (!nodeText) { return; }
	
	nodeText.style.display = (nodeText.style.display == '') ? 'none' : '';
}

function SearchChildNodes(node, strSearch, blnRecurse) {
	try {
		var node;
		
		if (node.hasChildNodes()) {
			for (var i=0; i<node.childNodes.length; i++) {
				nodeChild = node.childNodes[i];
				if (nodeChild.nodeType != 1) continue;	// For Mozilla browsers
				
				if (nodeChild.id.search(strSearch) > 0) {
					return nodeChild;
				} else if (blnRecurse && nodeChild.hasChildNodes()) {
					nodeChild = SearchChildNodes(nodeChild, strSearch, blnRecurse);
					if (nodeChild) {
						return nodeChild;
					}
				}
			}
		}
		
		return null;
	} catch (ex) {
		alert(ex);
		// Do nothing
	}
}
/* *********** End Quixtar.Web.UI.WebControls.PVBVStar.js  from Quixtar.Web.UI.WebControls, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.WebControls.Resources.ClientScripts.CountryControlSelector.js  from Quixtar.Web.UI.WebControls.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
function SetCookie(country, language, cookieName, sDomain, iExpMilliSeconds, targetUrl)
{
     var cookieValues = Get_Cookie(cookieName);
      if (cookieValues == null)
        var newCookieValue = "LanguageCode=" + language + "&CountryCode=" + country + "&MemberType=05&BusinessNature=V";
      else
      {
        var cookieValuesSplitResult = cookieValues.split("&");
        if (cookieValuesSplitResult.length == 4)
            var newCookieValue = "LanguageCode=" + language + "&CountryCode=" + country + "&" + cookieValuesSplitResult[2] + "&" + cookieValuesSplitResult[3];
        else
           var newCookieValue = "LanguageCode=" + language + "&CountryCode=" + country + "&MemberType=05&BusinessNature=V";
      }
      
      //set the expire date in milliseconds so add milliseconds to current date
      var sExpires;
      if (iExpMilliSeconds > 0)
      {
        var dExpires = new Date();
        dExpires.setTime(dExpires.getTime() + iExpMilliSeconds);
        sExpires = dExpires.toGMTString();
      }
      
      var sCookie = newCookieValue;
      var sPath = "/";
      
      if (sExpires)
      {
        sCookie += ("; expires=" + sExpires);
      }
      if (sDomain)
      {
        sCookie += ("; domain=" + sDomain);
      }
      if (sPath)
      {
        sCookie += ("; path=" + sPath);
      }
      
      document.cookie = cookieName + "=" + sCookie;
     
      if (typeof(targetUrl) != "string" || targetUrl == null || targetUrl == "")
      {
        window.location.reload();
      }
      else
      {
        window.location.href = targetUrl;
      }
}

// this function gets the cookie, if it exists
function Get_Cookie( name ) 
{
	var start = document.cookie.indexOf( name + "=" );
    var len = start + name.length + 1;
    if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
        return null;
    
    if ( start == -1 ) 
        return null;

    var end = document.cookie.indexOf( ";", len );
    if ( end == -1 ) 
        end = document.cookie.length;

    return unescape( document.cookie.substring( len, end ) );
}

/* *********** End Quixtar.Web.UI.WebControls.Resources.ClientScripts.CountryControlSelector.js  from Quixtar.Web.UI.WebControls.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.WebControls.Order.Resources.ClientScripts.CartItemCountControl.js  from Quixtar.Web.UI.WebControls.Order.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/

// JS Used to Update Cart Icon
 function CIC_UpdateCount() {
    
    Quixtar.Web.UI.WebControls.Order.CartItemCountControl.GetAjaxCartCount(m_CICCartTypeName, m_CICCartName, CIC_UpdateCountCallback, null, null, null, CIC_UpdateCountTimeout);
}

function CIC_UpdateCountCallback(ajaxResponse)
{
  
    var obj = document.getElementById(m_CICLinkCartClientID); 
    obj.innerHTML = '' + ajaxResponse.value; 

    var anim = new YAHOO.util.ColorAnim(obj.parentNode, {backgroundColor: { from:"#eae0d7", to:"#ffffff" } }, 2);
    anim.animate();
}

function CIC_UpdateCountTimeout()
{
    document.forms[0].submit();
}
/* *********** End Quixtar.Web.UI.WebControls.Order.Resources.ClientScripts.CartItemCountControl.js  from Quixtar.Web.UI.WebControls.Order.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.ThumbnailBase.js  from Quixtar.Web.UI.WebControls.Order.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
YAHOO.namespace('quixtar.controls');
(function() {
	var Event = YAHOO.util.Event,
		Dom = YAHOO.util.Dom;
	
	/**********************************************************
	 * ThumbnailBase                                          *
	 *                                                        *
	 * Acts as a base class for sub-classes to inherit from   *
	 * and extend thumbnail functionality from.               *
	 *                                                        *
	 **********************************************************/
	YAHOO.quixtar.controls.ThumbnailBase = function(thumbnailID) {
		// Properties
		this.ID = thumbnailID;
		this.Control = Dom.get(thumbnailID);
		this.HasErrors = false;
		this.Items = [];
		this.ActionMessageContentObject = null;
		this.ActionMessageToggleObject = null;
		this.ActionProgressImageToggleObject = null;
		this.CheckForFinancing = true;
		this.FinancingPopupID = null;
		this.FinancingPopUpPerformingAdd = false;
		this.FinancingContractTypeCode = null;
		this._financingHasBeenChecked = false;
		this._financingCartHasBeenAdded = false;
		
		// Initialize this object.
		this._initialize();
	};
	
	// Augment ThumbnailBase with the EventProvider functionality
	YAHOO.lang.augmentProto(YAHOO.quixtar.controls.ThumbnailBase, YAHOO.util.EventProvider); 
	
	// Static methods and properties
	YAHOO.quixtar.controls.ThumbnailBase.ActiveThumbnail = null;
	YAHOO.quixtar.controls.ThumbnailBase.ActiveWindow = null;
	
	YAHOO.quixtar.controls.ThumbnailBase.PopulateCopyItem = function() {
		var active = YAHOO.quixtar.controls.ThumbnailBase.ActiveThumbnail;
		try {
			if (active && !active.HasErrors) {
				active.CopyItemPopulateMethod(active);
			}
		} catch (ex) {
			if (active) { active.HasErrors = true; }
			alert("PopulateCopyItem: " + ex);
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.OpenWindow = function(URL) {
		var _window = YAHOO.quixtar.controls.ThumbnailBase.ActiveWindow;
		
		if (_window == null || _window.closed) {
			_window = window.open (URL, 'Document','height=475,width=800,fullscreen=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,location=no,top=40,left=35' );
		} else {
			var lastURL = _window.location.href
			// lastURL will contain the domain while strURL is usually relative, so only compare the URLs without the domain.
			if (lastURL.substring(lastURL.length - strURL.length) != strURL) {
				_window.location.href = strURL;
			}
		}
		
		_window.focus();
		YAHOO.quixtar.controls.ThumbnailBase.ActiveWindow = _window;
	};
	
	// Abstract methods below ...
	YAHOO.quixtar.controls.ThumbnailBase.prototype.ClickEvent = function(sender) {
		throw("'ClickEvent' is abstract and must be overridden.");
	};
	
	// Overridable methods below ...
	YAHOO.quixtar.controls.ThumbnailBase.prototype._initialize = function() {
		// Events
		this.createEvent('itemAdded');
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.GetItemNumber = function() {
		return this.Control.getAttribute('itemno');
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.GetClientID = function() {
		return (this.Control) ? this.Control.id : "";
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.AddItems = function(cartType, cartName, orderSourceType, orderSourceValue) {
		try {
			var TB = YAHOO.quixtar.controls.ThumbnailBase;
			
			if (!this.HasErrors && this.Items.length > 0) {
				// Initialize AJAX helper
				ajaxInit();

				for (var i=0; i < this.Items.length; i++) {
					var item = this.Items[i];
					
					var DTO = {
						Thumbnail : this,
						Item : item,
						CartType : cartType,
						CartName : cartName,
						OrderSourceType : orderSourceType,
						OrderSourceValue : orderSourceValue
					};
					
					// Check to see if it qualifies for financing
					if (this.CheckForFinancing && !this._financingHasBeenChecked) {
						this._financingHasBeenChecked = true;
						Quixtar.Web.UI.WebControls.Order.AjaxUtility.GetFinancing(item.ItemNumber, this.CheckForFinancing_CB, DTO);
					} else {
						var response = {
							context : DTO,
							error : false,
							value : (this._financingHasBeenChecked) ? this.FinancingContractTypeCode : null
						};
						this.CheckForFinancing_CB(response);
					}
				}
			}
			
			if (this.HasErrors && this.ActionMessageContentObject && this.ActionMessageContentObject.innerHTML === '') {
				// There's an error, but no message has been given to display, so just display a generic error message.
				this.DisplayMessage(TB_ErrorGeneric);
			}
		} catch (ex) {
			alert("AddItems: " + ex);
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.CheckForFinancing_CB = function(response) {
		if (response) {
			var DTO = response.context,
				thumbnail = DTO.Thumbnail;
				
			if (!response.error) {
				thumbnail.FinancingContractTypeCode = response.value;
				
				if (!thumbnail.FinancingPopUpPerformingAdd
					&& thumbnail.FinancingContractTypeCode
					&& typeof(ShowPopUp) == "function"
					&& thumbnail.FinancingPopupID) {
					
					// this item qualifies for financing
					ShowPopUp(thumbnail.FinancingPopupID, null);
				} else {
					thumbnail.FinancingPopUpPerformingAdd = false;	// Reset the financing performing add switch
					thumbnail.PerformAddItem(DTO);
				}
			}
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.PerformAddItem = function(DTO) {
		if (!DTO.CartName) { DTO.CartName = ""; }	// If cartName is null, default it to empty; this is allowed
		
		// start the progress image
		this.ShowProgress();
		
		if (DTO.Item.SizeColorCode) {
			Quixtar.Web.UI.WebControls.Order.AjaxUtility.AddItemWithSizeColorAndName(DTO.Item.ItemNumber, DTO.Item.SizeColorCode, DTO.Item.Quantity, DTO.CartType, DTO.CartName, DTO.OrderSourceType, DTO.OrderSourceValue, DTO.Thumbnail.AddItems_CB, DTO);
		} else {
			Quixtar.Web.UI.WebControls.Order.AjaxUtility.AddItemWithName(DTO.Item.ItemNumber, DTO.Item.Quantity, DTO.CartType, DTO.CartName, DTO.OrderSourceType, DTO.OrderSourceValue, DTO.Thumbnail.AddItems_CB, DTO);
		}
		
		// register tealeaf event
		try {
			if (TB_TealeafID != null && TB_TealeafSource != null && TB_TealeafDest != null) {
				if (TB_CategoryId == "none") {
					TB_CategoryId = '';
				}
				
				// Log to TeaLeaf asynchronously.
				Quixtar.Web.TeaLeaf.TeaLeafHelper.RaiseTeaLeafAddEvent(TB_TealeafSource * 1, TB_TealeafDest * 1, TB_CategoryId, [DTO.Item.ItemNumber], TB_TealeafID, TB_TealeafHID, '', TB_TealeafIMC, 0, function(){});
			}
		} catch (err) {
			// if the tealeaf does not happen move on
			DTO.Thumbnail.HasErrors = true;
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.AddItems_CB = function(response) {
		try {
			if (response) {
				var DTO = response.context,
				thumbnail = DTO.Thumbnail;
				if (!response.error) {
					if (response.value.IsOperationSuccessful) {

					    // display special link for items added to finance cart
					    
					    var displayedListTxt = TB_ItemAdded;
					    
					    if(thumbnail._financingCartHasBeenAdded) {
					        thumbnail._financingCartHasBeenAdded = false;
					        displayedListTxt = TB_FinanceItemAdded;
					    }
					    
					    var urlStr = Quixtar.Web.UI.WebControls.Order.AjaxUtility.GetItemAddCartNavigateUrl(displayedListTxt, DTO.CartName, DTO.CartType);

						if (urlStr !== null && urlStr.value.length > 0) {
						    thumbnail.DisplayMessage(urlStr.value);
						}

						// Update and repaint the View Cart count if it exists.
						if (typeof(CIC_UpdateCount) == "function") {
							CIC_UpdateCount();
						}
						
						thumbnail.OnItemAdded(response);
						thumbnail.fireEvent("itemAdded", response);
					} else {
						thumbnail.HasErrors = true;
						if (response.value.WarningMessage !== null && response.value.WarningMessage.length > 0) {
							thumbnail.DisplayMessage(response.value.WarningMessage);
						}
					}
				} else {
					thumbnail.HasErrors = true;
				}
				
				try {
					HandleMetricsEvent(response);
				} catch (ex) { }
			}
		} catch (exp) {
			alert("AddItems_CB: " + exp);
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.OnItemAdded = function(response) {
		try {
			var anim = new YAHOO.util.ColorAnim(this.ActionMessageToggleObject, {backgroundColor: { from:"#eae0d7", to:"#ffffff" } }, 2);
			anim.animate();
		} catch (ex) {
			alert("OnItemAdded: " + ex);
		}
	};

	YAHOO.quixtar.controls.ThumbnailBase.prototype.DisplayMessage = function(message) {
		try {
			if (this.ActionMessageContentObject && this.ActionMessageToggleObject) {
			    this.HideProgress();
				this.ActionMessageContentObject.innerHTML = message;
				this.ActionMessageToggleObject.style.display = 'block';
			}
		} catch (ex) {
			alert("DisplayMessage: " + ex);
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.HideMessage = function() {
		try {
			if (this.ActionMessageContentObject && this.ActionMessageToggleObject) {
				this.ActionMessageContentObject.innerHTML = '';
				this.ActionMessageToggleObject.style.display = 'none';
			}
		} catch (ex) {
			alert("HideMessage: " + ex);
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.ShowProgress = function () {
	    try {
	        if (this.ActionProgressImageToggleObject && this.ActionMessageToggleObject) {
	            this.HideMessage();
	            this.ActionProgressImageToggleObject.style.display = 'block';
	            this.ActionMessageToggleObject.style.display = 'block';
	        }
	    } catch (ex) {
	        alert("Show Progress: " + ex);
	    }
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.HideProgress = function () {
	    try {
	         if (this.ActionProgressImageToggleObject && this.ActionMessageToggleObject) {
                this.ActionProgressImageToggleObject.style.display = 'none';
                this.ActionMessageToggleObject.style.display = 'none';
	         }
	    } catch (ex) {
	        alert("Hide Progress: " + ex);
	    }
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.CopyItemPopulateMethod = function(thumbnail) {
		try {
			var arrDTOs = [];
			
			for (i=0; i < thumbnail.Items.length; i++) {
				var dto = new ItemDTO();
				var item = thumbnail.Items[i];
				
				dto.ItemNo = item.ItemNumber;
				dto.ItemQuantity = item.Quantity;
				dto.SizeColor = item.SizeColorCode;
				
				arrDTOs.push(dto);
			}
			
			if (arrDTOs.length > 0) {
				m_CopyCartItemsControl_ItemList = arrDTOs;
			}
		} catch (ex) {
			thumbnail.HasErrors = true;
			alert("CopyItemPopulateMethod: " + ex);
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.ShowListsPopup = function(evt, sender) {
		try {
			if (!this.HasErrors) {
				this.HideMessage();
				CopyCartItems_ShowLists(evt, sender);
			}
		} catch (ex) {
			this.HasErrors = true;
			alert("ShowListsPopup: " + ex);
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.prototype.ShowAvailabilityHelp = function(sender) {
		try {
			var popupID = sender.getAttribute("popupid");
			if (popupID != null) {
				ShowPopUp(popupID);
			}
		} catch (ex) {
			this.HasErrors = true;
			this.DisplayMessage(TB_ErrorGeneric);
		}
	};
	
	/**********************************************************
	 * ThumbnailItem                                          *
	 *                                                        *
	 * Encapsulates an item object that can be added to any   *
	 * ordering destination.                                  *
	 *                                                        *
	 **********************************************************/
	YAHOO.quixtar.controls.ThumbnailBase.ThumbnailItem = function() {
		// Properties
		this.ItemNumber = null;
		this.Quantity = null;
		this.SizeColorCode = null;
	};
	
	/**********************************************************
	 * ThumbnailSet                                           *
	 *                                                        *
	 * Encapsulates an item object that can be added to any   *
	 * ordering destination.                                  *
	 *                                                        *
	 **********************************************************/
	YAHOO.quixtar.controls.ThumbnailBase.ThumbnailSet = function() {
		// Properties
		this.Thumbnails = {};
		Event.addListener(document, 'click', this._clickEvent, this, true);
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.ThumbnailSet.prototype._clickEvent = function (e, obj) {
		var sender = Event.getTarget(e),
			thumbID = sender.getAttribute('thumbid'),
			count = 0;
		
		// If we can't find it, look up the stack (StyledButtons, among other controls,
		// can be clicked on either the SPAN or parent A tag)
		while (!thumbID && count < 10 && sender.parentNode != document) {
			sender = sender.parentNode;
			thumbID = sender.getAttribute('thumbid');
			count++;
		}
		
		if (thumbID) {
			var thumbnail = this.Thumbnails[thumbID];
			if (thumbnail) {
				thumbnail.ClickEvent(sender);
			}
		}
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.ThumbnailSet.prototype.Add = function (thumbnail) {
		this.Thumbnails[thumbnail.ID] = thumbnail;
	};
	
	YAHOO.quixtar.controls.ThumbnailBase.ThumbnailSet.prototype.Remove = function (thumbnail) {
		delete this.Thumbnails[thumbnail.ID];
	};
})();
/* *********** End Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.ThumbnailBase.js  from Quixtar.Web.UI.WebControls.Order.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.Resources.ClientScriptHelper.ClientScripts.CoreMetricsMethods.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
// This function interprets an itemDTO object returned for various AjaxUtility class calls.
// It calls a cm function (coremetrics provided) to generate <img> tags that send data to CM.
// If CoreMetrics is switched out, this function will need to be modified.
function HandleMetricsEvent(itemDTO) {
	try {
		cmCreateShopAction5Tag( itemDTO.value.ItemNo, 
		                        itemDTO.value.NameNoHTML, 
		                        itemDTO.value.ItemQuantity,
		                        itemDTO.value.DisplayPrice,
		                        itemDTO.value.MetricsCatId); 
		cmDisplayShop5s();
	} catch (ex) {
		// Swallow any exceptions as we do not want tagging problems to impact site performance
	}
}

function HandleMetricsUpdateEvent(itemUpdateDTO) {
	try {
	    // We are only interested in updates if the quantity has changed...
	    if(itemUpdateDTO.ItemQuantity != itemUpdateDTO.OriginalItemQuantity)
	    {
		    cmCreateShopAction5Tag( itemUpdateDTO.ItemNumber, 
		                            itemUpdateDTO.ItemDescription, 
		                            itemUpdateDTO.ItemQuantity,
		                            itemUpdateDTO.ItemDisplayPrice,
		                            itemUpdateDTO.MetricsCatId); 
		    cmDisplayShop5s();
		}
	} catch (ex) {
		// Swallow any exceptions as we do not want tagging problems to impact site performance
	}
}
/* *********** End Quixtar.Web.UI.Resources.ClientScriptHelper.ClientScripts.CoreMetricsMethods.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.Resources.ClientScriptHelper.ClientScripts.ValidationMethods.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
function ValidateNumber(e) {
	if (window.event) {
		e = window.event;
	}

	if (e.keyCode) {
		code = e.keyCode;
	} else if (e.which) {
		code = e.which;
	}

	// Attempt to allow function keys, and edit keys
	if (e.charCode == 0) { return; }

	// Attempt to disallow the shift key.
	if (e.shiftKey) {
		e.preventDefault ? e.preventDefault() : e.returnValue = false;
	}

	// Only allow numbers (no decimal, etc )
	if ((code < 48 || code > 57)) {
		e.preventDefault ? e.preventDefault() : e.returnValue = false;
	}
}
/* *********** End Quixtar.Web.UI.Resources.ClientScriptHelper.ClientScripts.ValidationMethods.js  from Quixtar.Web.UI.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.Thumbnail.js  from Quixtar.Web.UI.WebControls.Order.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
YAHOO.namespace('quixtar.controls');
(function() {
	var Event = YAHOO.util.Event,
		Dom = YAHOO.util.Dom;

	YAHOO.util.Event.onDOMReady(function() {
		YAHOO.quixtar.controls.Thumbnail = function(thumbnailID) {
			// chain the constructors
			YAHOO.quixtar.controls.Thumbnail.superclass.constructor.apply(this, [thumbnailID]);
			
			this.ActionMessageContentObject = Dom.get(thumbnailID + '_lblActionMessage');
			this.ActionMessageToggleObject = Dom.get(thumbnailID + '_divActionMessage');
			this.ActionProgressImageToggleObject = Dom.get(thumbnailID + '_imgCartItemAddInProgress');
			this.FinancingPopupID = thumbnailID + '_popupFinancing';
			this.PrinterFriendlyPageURL = '/products/printflyer.aspx?itemno=' + this.GetItemNumber();
		}
		YAHOO.lang.extend(YAHOO.quixtar.controls.Thumbnail, YAHOO.quixtar.controls.ThumbnailBase);
		
		// Overrides
		YAHOO.quixtar.controls.Thumbnail.prototype.ClickEvent = function(sender) {
			// Reset error flag
			this.HasErrors = false;
			
			if (YAHOO.env.ua.ie > 0 && this.Control.parentNode.nodeName == "LI") {
				// IE only fix: IE improperly manages zIndex values for absolutely positioned children of relative elements.
				// Instead of using the correct zIndex value applied to the element, it uses the relatively positioned element's
				// value causing all kinds of headaches.  If this thumbnail was placed in a thumbnail list (parent is an LI), then
				// we dynamically manage the zIndexes of the LI's in the list to be sure that wherever we have clicked is the top-most
				// zIndex value.
				var li = this.Control.parentNode,
					ul = li.parentNode,
					allLIs = ul.getElementsByTagName("LI");
				
				for (var i=0; i<allLIs.length; i++) {
					allLIs[i].style.zIndex = 0;
				}
				li.style.zIndex = 999;
			}
			
			if (sender.id.indexOf('btnCart') > -1) {
				var cartType = sender.getAttribute('carttype'),
					cartName = sender.getAttribute('cartname');
				
				this.PopulateItems(sender);
				this.AddItems(cartType,
							cartName,
							(typeof(TB_SourceType) === "undefined") ? "" : TB_SourceType,
							(typeof(TB_SourceName) === "undefined") ? "" : TB_SourceName);
			} else if (sender.id.indexOf('btnShopAndDitto') > -1) {
				YAHOO.quixtar.controls.ThumbnailBase.ActiveThumbnail = this;
				this.PopulateItems(sender);
				
				// check to see if personalization required
				if (!this.HasErrors) {
					// If we're adding multiple items at once, ignore the personalization check.  Today only swatches add multiple items at
					// once, and swatches aren't personalized items.  If we ever allow multiple items to be added for other types of items,
					// this will have to change to somehow figure out what to do if some items can be personalized.
					if (this.Items.length === 1) {
						var isPersonalizedSku = Quixtar.Web.UI.WebControls.Order.AjaxUtility.IsPersonalizationRequired(this.Items[0].ItemNumber);
						if (isPersonalizedSku != null && isPersonalizedSku.value) {
							this.DisplayMessage(TB_DittoNotAllowedPersonalized);
						} else {
							this.ShowListsPopup(null, sender);
						}
					} else {
						this.ShowListsPopup(null, sender);
					}
				}
			} else if (sender.id.indexOf('btnFinAddToCart') > -1 || sender.id.indexOf('btnFinAddToFinance') > -1) {
				if (this.FinancingPopupID) {
					HidePopUp(this.FinancingPopupID);
				}
				
				var cartType = sender.getAttribute('carttype'),
					cartName = sender.getAttribute('cartname');
					
				if (sender.id.indexOf('btnFinAddToFinance') > -1) {
					cartName = this.FinancingContractTypeCode;
					this._financingCartHasBeenAdded = true;
				}
				
				this.FinancingPopUpPerformingAdd = true;
				this.PopulateItems(sender);
				this.AddItems(cartType, cartName, TB_SourceType, TB_SourceName);
			} else if (sender.id.indexOf('hlpAvailability') > -1) {
				this.ShowAvailabilityHelp(sender);
			} else if (sender.id.indexOf('hypPrint') > -1) {
				YAHOO.quixtar.controls.ThumbnailBase.OpenWindow(this.PrinterFriendlyPageURL);
			}
		};
		
		// New Methods
		YAHOO.quixtar.controls.Thumbnail.prototype.PopulateItems = function(sender) {
			try {
				this.Items.clear();
				
				var item = new YAHOO.quixtar.controls.ThumbnailBase.ThumbnailItem();
				item.ItemNumber = this.GetItemNumber();
				
				var obj = Dom.get(this.ID + '_tbxQty');
				if (obj) {
					item.Quantity = obj.value * 1;	// Cast to integer
				} else {
					item.Quantity = 1;
				}
				
				var obj = Dom.get(this.ID + '_ddlSizeColor_hdnSelected');
				if (obj) {
					if (obj.value != null && obj.value.length > 0) {
						item.SizeColorCode = obj.value;
					} else {
						this.DisplayMessage(TB_ErrorSizeColor);
						this.HasErrors = true;
					}
				}

				if (!this.HasErrors) {
					this.Items.push(item);
				}
			} catch (ex) {
				this.HasErrors = true;
				this.DisplayMessage(TB_ErrorGeneric);
			}
		};
	});
})();
/* *********** End Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.Thumbnail.js  from Quixtar.Web.UI.WebControls.Order.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.WebControls.Resources.ClientScripts.StyledButton.js  from Quixtar.Web.UI.WebControls.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
var SB_IsActive = false;

window.onresize = UpdateBackgroundSize;

try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}

function SB_CheckPageValid(causesValidation, validationGroup) {

    if (causesValidation && typeof(Page_ClientValidate) == 'function')
    {
        if (validationGroup != null && validationGroup.length > 0)
        {
            return Page_ClientValidate(validationGroup);
        }
        else
        {
            return Page_ClientValidate();
        }
    }
    
    return true;
}

function SB_HandleSpacebar(e, sender) {
	if (YAHOO.util.Event.getCharCode(e) == 32) {
		sender.onclick();
	}
}

function DoOverlay(causesValidation, validationGroup) {
	var div = document.getElementById(GBL_STYLED_OVERLAY_DIV);
	
	// do not overlay if page is not valid
	if (!SB_CheckPageValid(causesValidation, validationGroup)) {
	    return false;
	}

	if (div) {
		SB_IsActive = true;
		
		// We need to turn off drop downs (selects) for IE 6 and below
		if (navigator.appVersion.indexOf("MSIE") != -1) {
			var temp = navigator.appVersion.split("MSIE");
			var version = parseFloat(temp[1]);
			if (version <= 6) {
				var selects = document.getElementsByTagName("SELECT");
				for (var i=0; i<selects.length; i++) {
					selects[i].style.visibility = 'hidden';
				}
			}
		}
		
		UpdateBackgroundSize();
		
		div.style.cursor = 'wait';
		div.style.display = 'inline';
	}
	
	return true;
}

function HideOverlay ()  {

    var div = document.getElementById(GBL_STYLED_OVERLAY_DIV);
    
    if (div) {
        div.style.cursor = 'default';
		div.style.display = 'none';
    }
}

function UpdateBackgroundSize() {
	var div;
	
	if (typeof(GBL_STYLED_OVERLAY_DIV) != "undefined") {
		div = document.getElementById(GBL_STYLED_OVERLAY_DIV);
	}
	
	if (SB_IsActive && div) {
		var viewportHeight = YAHOO.util.Dom.getViewportHeight();
		var height;
		
		if (document.body.scrollHeight > document.body.offsetHeight) {
			// all but Explorer Mac
			height = document.body.scrollHeight;
		} else { 
			// Explorer Mac, would also work in Explorer 6 Strict, Mozilla and Safari
			height = document.body.offsetHeight;
		}
		
		div.style.height = ((height > viewportHeight) ? height : viewportHeight) + "px";
		div.style.width = YAHOO.util.Dom.getViewportWidth() + "px";
	}
}

function StyledButtonEnable(enabled, context)
{
    //hack for new StyledButtons
    var linkButton = document.getElementById(context + "_Button");
    var text = document.getElementById(context + "_lblText");

    if (enabled)
    {
        linkButton.disabled = false;
        text.className = "enabled";
    }
    else
    {
        linkButton.disabled = true; 
        text.className = "disabled";
    }
}

/* *********** End Quixtar.Web.UI.WebControls.Resources.ClientScripts.StyledButton.js  from Quixtar.Web.UI.WebControls.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
/* *********** Begin Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.MoreInformationControl.js  from Quixtar.Web.UI.WebControls.Order.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
YAHOO.namespace ("Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts");

YAHOO.Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.MoreInformationControl = {
	// Properties
	Window: null,
	
	// Methods
	SelectMoreInfo: function(id, varNameID, useAjax, itemNumber) {
		var panel = document.getElementById(eval("MI_PANEL_" + varNameID));
		if (useAjax && !panel.getAttribute("populated")) {
			ajaxInit();
			Quixtar.Web.UI.WebControls.Order.ProductControls.MoreInformationControl.GetMoreInformationHTML(itemNumber, id, YAHOO.Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.MoreInformationControl.SelectMoreInfo_CallBack, varNameID);
		} else {
			YAHOO.Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.MoreInformationControl.FlipPanel(varNameID);
		}
	},
	
	SelectMoreInfo_CallBack: function(response) {
		if (response != null && response.value != null) {
			var varNameID = response.context;
			var panel = document.getElementById(eval("MI_PANEL_" + varNameID));
			panel.innerHTML = response.value;
			panel.setAttribute("populated", true);
			
			YAHOO.Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.MoreInformationControl.FlipPanel(varNameID);
		}
	},
	
	FlipPanel: function(varNameID) {
		var panel = document.getElementById(eval("MI_PANEL_" + varNameID));
		var tab = document.getElementById(eval("MI_TAB_" + varNameID));
		var prevPanel = document.getElementById(MI_PREV_PANEL);
		var prevTab = document.getElementById(MI_PREV_TAB);
		
		if (prevPanel && prevTab && panel && tab) {
			prevPanel.style.display = "none";
			panel.style.display = "inline";
			MI_PREV_PANEL = panel.id;
			
			var strOff = eval("MI_OFF_CLASS_"+varNameID);
			prevTab.className = strOff;
			tab.className = strOff + " on";
			MI_PREV_TAB = tab.id;
		}
	},
	
	OpenWindow: function(strURL) {
		var _window = YAHOO.Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.MoreInformationControl.Window;
		
		if (_window == null || _window.closed) {
			_window = window.open (strURL, 'Document','height=475,width=800,fullscreen=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,location=no,top=40,left=35' );
		} else {
			var lastURL = _window.location.href
			// lastURL will contain the domain while strURL is usually relative, so only compare the URLs without the domain.
			if (lastURL.substring(lastURL.length - strURL.length) != strURL) {
				_window.location.href = strURL;
			}
		}
		
		_window.focus();
		YAHOO.Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.MoreInformationControl.Window = _window;
	}
};
/* *********** End Quixtar.Web.UI.WebControls.Order.Resources.ProductControls.ClientScripts.MoreInformationControl.js  from Quixtar.Web.UI.WebControls.Order.CS, Version=2010.9.2.5, Culture=neutral, PublicKeyToken=null*/
