﻿function $(id){return document.getElementById(id);}
function showDiv(id){$(id).style.display = "block"; setColumnHeight();}
function hideDiv(id){$(id).style.display = "none"; setColumnHeight();}

function showSurvey()
{
	$('#survey').slideDown("slow");
}	
function setColumnHeight()
{var allImgs=document.getElementsByTagName("img");var allDivs=document.getElementsByTagName("div");var height=document.getElementById("innerContainer").offsetHeight;for(i=0;i<allImgs.length;i++)
{if(allImgs[i].className.indexOf("shadow")>-1)allImgs[i].style.height=height+"px";}
if($('mainBody')!=null&&$('mainBody')!=null)var bspaceHeight=$('mainBody').offsetHeight-$('lCol').offsetHeight;if(bspaceHeight>0)
{$('bottomSpace').style.height=bspaceHeight+"px";$('bottomSpace').style.display="block";}}
function checkWidth()
{var allImgs=document.getElementsByTagName("img");if(document.body.offsetWidth<=1050)
{for(i=0;i<allImgs.length;i++)
{if(allImgs[i].className=="shadow"||allImgs[i].className=="botShadow")allImgs[i].style.display="none";}}
else
{for(i=0;i<allImgs.length;i++)
{if(allImgs[i].className=="shadow"||allImgs[i].className=="botShadow")allImgs[i].style.display="";}}}
var isIE=(window.navigator.userAgent.indexOf("MSIE")>0);if(!isIE){HTMLElement.prototype.__defineGetter__("innerText",function(){return(this.textContent);});HTMLElement.prototype.__defineSetter__("innerText",function(txt){this.textContent=txt;});}
function windowLoad()
{setColumnHeight();checkWidth();}
window.onload=function(){windowLoad();}
function hcAccount(bool)
{if(bool)showDiv('isMember');else hideDiv('isMember');}
function goTo(page){window.href=page.toString();}
function Print(){document.body.offsetHeight;window.print()}
function toggleQuickCart()
{$('#quickCartButton').click();}
function refreshQuickCart()
{window.scroll(0,0);var quickCart=$('div#quickCart');postBackHiddenField(updatePanelQuickCart);if(!isOpen())
{toggleQuickCart();}
bodyClick();}
function bodyClick()
{var timer=setTimeout('$("body").unbind("click.bodyclick"); toggleQuickCart();',10000);$('body').one('click.bodyclick',function(){clearTimeout(timer);});$('.wrapper').children().unbind('click.bodyclick');}
function isOpen()
{var top=parseInt($('#quickCart-outer').css('marginTop'));if(top>0)
return true;else
return false;}
function postBackHiddenField(hiddenFieldID){var hiddenField=$get(hiddenFieldID);if(hiddenField){hiddenField.value=(new Date()).getTime();__doPostBack(hiddenFieldID,'');}}
jQuery(document).ready(function(e){setProductView();});function setProductView()
{$('.zoom').each(function(){$(' > .zoomImage',this).parent('.zoom').each(function(){$(this).parent().find('.innerPanel > ').css('display','none');});$(this).hover(function()
{if($(' > .zoomImage',this).length>0)
{$(' > .zoomImage',this).each(function(){$(this).fadeOut('def');});$('.innerPanel > ',this).css('display','block');}
else
{$('.pView',this).show();}},function()
{if($(' > .zoomImage',this).length>0)
{$(' > .zoomImage',this).parent().find('.innerPanel >').css('display','none');$(this).find(' > .zoomImage').fadeIn('def');}
else
{$('.pView',this).hide();}});});}
jQuery.fn.fadeToggle=function(speed,easing,callback){return this.animate({opacity:'toggle'},speed,easing,callback);};function HideValidators(){if(window.Page_Validators)
for(var vI=0;vI<Page_Validators.length;vI++){var vValidator=Page_Validators[vI];vValidator.isvalid=true;ValidatorUpdateDisplay(vValidator);}}
new function(settings){var $separator=settings.separator||'&';var $spaces=settings.spaces===false?false:true;var $suffix=settings.suffix===false?'':'[]';var $prefix=settings.prefix===false?false:true;var $hash=$prefix?settings.hash===true?"#":"?":"";jQuery.query=new function(){var is=function(o,t){return o!=undefined&&o!==null&&(!!t?o.constructor==t:true);};var parse=function(path){var m,rx=/\[([^[]*)\]/g,match=/^(\S+?)(\[\S*\])?$/.exec(path),base=match[1],tokens=[];while(m=rx.exec(match[2]))tokens.push(m[1]);return[base,tokens];};var set=function(target,tokens,value){var o,token=tokens.shift();if(typeof target!='object')target=null;if(token===""){if(!target)target=[];if(is(target,Array)){target.push(tokens.length==0?value:set(null,tokens.slice(0),value));}else if(is(target,Object)){var i=0;while(target[i++]!=null);target[--i]=tokens.length==0?value:set(target[i],tokens.slice(0),value);}else{target=[];target.push(tokens.length==0?value:set(null,tokens.slice(0),value));}}else if(token&&token.match(/^\s*[0-9]+\s*$/)){var index=parseInt(token,10);if(!target)target=[];target[index]=tokens.length==0?value:set(target[index],tokens.slice(0),value);}else if(token){var index=token.replace(/^\s*|\s*$/g,"");if(!target)target={};if(is(target,Array)){var temp={};for(var i=0;i<target.length;++i){temp[i]=target[i];}
target=temp;}
target[index]=tokens.length==0?value:set(target[index],tokens.slice(0),value);}else{return value;}
return target;};var queryObject=function(a){var self=this;self.keys={};if(a.queryObject){jQuery.each(a.get(),function(key,val){self.SET(key,val);});}else{jQuery.each(arguments,function(){var q=""+this;q=q.replace(/^[?#]/,'');q=q.replace(/[;&]$/,'');if($spaces)q=q.replace(/[+]/g,' ');jQuery.each(q.split(/[&;]/),function(){var key=this.split('=')[0];var val=this.split('=')[1];if(!key)return;if(/^[+-]?[0-9]+\.[0-9]*$/.test(val))
val=parseFloat(val);else if(/^[+-]?[0-9]+$/.test(val))
val=parseInt(val,10);val=(!val&&val!==0)?true:val;if(val!==false&&val!==true&&typeof val!='number')
val=decodeURIComponent(val);self.SET(key,val);});});}
return self;};queryObject.prototype={queryObject:true,has:function(key,type){var value=this.get(key);return is(value,type);},GET:function(key){if(!is(key))return this.keys;var parsed=parse(key),base=parsed[0],tokens=parsed[1];var target=this.keys[base];while(target!=null&&tokens.length!=0){target=target[tokens.shift()];}
return target||"";},get:function(key){var target=this.GET(key);if(is(target,Object))
return jQuery.extend(true,{},target);else if(is(target,Array))
return target.slice(0);return target;},SET:function(key,val){var value=!is(val)?null:val;var parsed=parse(key),base=parsed[0],tokens=parsed[1];var target=this.keys[base];this.keys[base]=set(target,tokens.slice(0),value);return this;},set:function(key,val){return this.copy().SET(key,val);},REMOVE:function(key){return this.SET(key,null).COMPACT();},remove:function(key){return this.copy().REMOVE(key);},EMPTY:function(){var self=this;jQuery.each(self.keys,function(key,value){delete self.keys[key];});return self;},empty:function(){return this.copy().EMPTY();},copy:function(){return new queryObject(this);},COMPACT:function(){function build(orig){var obj=typeof orig=="object"?is(orig,Array)?[]:{}:orig;if(typeof orig=='object'){function add(o,key,value){if(is(o,Array))
o.push(value);else
o[key]=value;}
jQuery.each(orig,function(key,value){if(!is(value))return true;add(obj,key,build(value));});}
return obj;}
this.keys=build(this.keys);return this;},compact:function(){return this.copy().COMPACT();},toString:function(){var i=0,queryString=[],chunks=[],self=this;var addFields=function(arr,key,value){if(!is(value)||value===false)return;var o=[key];if(value!==true){o.push("=");o.push(encodeURIComponent(value));}
arr.push(o.join(""));};var build=function(obj,base){var newKey=function(key){return!base||base==""?[key].join(""):[base,"[",key,"]"].join("");};jQuery.each(obj,function(key,value){if(typeof value=='object')
build(value,newKey(key));else
addFields(chunks,newKey(key),value);});};build(this.keys);if(chunks.length>0)queryString.push($hash);queryString.push(chunks.join($separator));return queryString.join("");}};return new queryObject(location.search,location.hash);};}(jQuery.query||{});var slideFlag=1;var Toggle={show:function(element,targetElement,options,increment){if(targetElement){var options=this.setOptions(this.getOptions(),options||{});targetElement.style.top=-options.height+'px';targetElement.style.left=(element.offsetLeft+options.leftOffSet)+'px';targetElement.style.position='absolute';targetElement.style.zIndex=options.zIndex;if(options.closeImage!='')
element.style.backgroundImage='url('+options.closeImage+')';slideFlag=1
element.onclick=function(){Toggle.close(element,targetElement,options,increment);if(options.bodyClick){setTimeout("document.body.onclick = null;",100);}}
this.slideDown(targetElement,element.offsetTop,increment);}},getOptions:function(){return{'height':300,'width':700,'topOffSet':20,'bottomOffSet':0,'leftOffSet':0,'rightOffSet':0,'bgColor':'#FFF','className':'','openImage':'','closeImage':'','zIndex':999,'bodyClick':false};},slideDown:function(element,styleTop,increment){var unit=element.style.top.replace(/[-]?\d/g,'');var elementTop=parseInt(element.style.top.replace(unit,''));if(elementTop<=styleTop){if(slideFlag==0)
return;elementTop=parseInt(element.style.top.replace(unit,''))+increment;element.style.top=elementTop+unit;setTimeout(function(){Toggle.slideDown(element,styleTop,increment)},0);}},slideUp:function(element,styleTop,increment){var unit=element.style.top.replace(/[-]?\d/g,'');var elementTop=parseInt(element.style.top.replace(unit,''))+element.clientHeight;if(elementTop>=0){if(slideFlag==1)
return;elementTop=parseInt(element.style.top.replace(unit,''))-increment;element.style.top=elementTop+unit;setTimeout(function(){Toggle.slideUp(element,styleTop,increment)},0);}},setOptions:function(destination,source){for(var property in source){destination[property]=source[property];}
return destination;},realOffset:function(element){var top=0,left=0;do{top+=element.scrollTop||0;left+=element.scrollLeft||0;element=element.parentNode;}while(element);return[left,top];},close:function(element,targetElement,options,increment){slideFlag=0;if(options.openImage!='')
element.style.backgroundImage='url('+options.openImage+')';element.onclick=function(){Toggle.show(element,targetElement,options,25);if(options.bodyClick){setTimeout("document.body.onclick = closeQuickCart;",100);}}
this.slideUp(targetElement,element.offsetTop,increment);},getPageSize: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){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}
else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}
else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}
else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}
else{pageWidth=xScroll;}
return{'pageWidth':pageWidth,'pageHeight':pageHeight,'windowWidth':windowWidth,'windowHeight':windowHeight,'yScroll':yScroll,'xScroll':xScroll};}}
var ModalPopup={show:function(control,options){var options=this.setOptions(this.getOptions(),options||{});control.style.display=options.display;if(options.enableOverlayClick){this.addOverlay(control,options.colorOverlay,options.enableOverlayClick);}
this.centerModal(control,options);window.onresize=function(){ModalPopup.centerModal(control,options);}},getOptions:function(){return{'height':600,'width':700,'topOffSet':30,'position':'absolute','display':'block','colorOverlay':'#000','enableOverlayClick':false};},setOptions:function(destination,source){for(var property in source){destination[property]=source[property];}
return destination;},centerModal:function(control,options){var pageSize=this.getPageSize();var pos=this.realOffset(document.body);var newTopOffSet=(pageSize.windowHeight/2-options.height/2+pos[1]+options.topOffSet);if(newTopOffSet<0){control.style.top=options.topOffSet+'px';}
else{control.style.top=newTopOffSet+'px';}
control.style.left=(pageSize.windowWidth/2-options.width/2+pos[0])+'px';control.style.height=options.height;control.style.width=options.width;control.style.position=options.position;control.style.zIndex='1000';control.style.display='block';document.body.appendChild(control);},realOffset:function(element){var top=0,left=0;do{top+=element.scrollTop||0;left+=element.scrollLeft||0;element=element.parentNode;}while(element);return[left,top];},close:function(control){var overlay=document.getElementById('modalOverlay');if(overlay!=null){document.body.removeChild(overlay);}
control.style.display='none';window.onresize=null;},addOverlay:function(control,backgroundColor,enableClick){if(!this.overlayMacFFBug()){var overlay=document.createElement('div');overlay.id='modalOverlay';overlay.style.top='0px';overlay.style.left='0px';overlay.style.position='absolute';if(backgroundColor==null){overlay.style.background='#000';}
else{overlay.style.background=backgroundColor;}
this.setOpacity(overlay,0.5);var pageSize=this.getPageSize();overlay.style.height=pageSize.pageHeight+'px';overlay.style.width='100%';overlay.style.zIndex='999';if(enableClick){overlay.onclick=function(){ModalPopup.close(control);}}
document.body.appendChild(overlay);return overlay;}},setOpacity:function(element,value){if(typeof element=='string'){element=$(element);}
if(value==1){element.style.opacity=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1.0;if(/MSIE/.test(navigator.userAgent)&&!window.opera){element.style.filter=element.style.filter.replace(/alpha\([^\)]*\)/gi,'');}}
else{if(value<0.00001)value=0;{element.style.opacity=value;}
if(/MSIE/.test(navigator.userAgent)&&!window.opera){element.style.filter=element.style.filter.replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+value*100+')';}}
return element;},getPageSize: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){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}
else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}
else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}
else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}
else{pageWidth=xScroll;}
return{'pageWidth':pageWidth,'pageHeight':pageHeight,'windowWidth':windowWidth,'windowHeight':windowHeight,'yScroll':yScroll,'xScroll':xScroll};},overlayMacFFBug:function(){return navigator.appVersion.toLowerCase().indexOf("mac")!=-1;}}
var QuickModal={open:function(tag,properties,fn){var control=$(tag);var properties=this.center(control,properties);if(properties.overlay){this.addOverlay(tag,properties,fn);}
$(window).resize(function(){QuickModal.center(control,properties);});$(window).scroll(function(){QuickModal.center(control,properties);});},getProperties:function(){return{'height':0,'width':0,'topOffSet':0,'position':'absolute','display':'block','zIndex':1000,'colorOverlay':'#000','overlay':true,'closeOverlay':true,'opacity':0.2};},setProperties:function(destination,source){for(var property in source){destination[property]=source[property];}
return destination;},center:function(control,properties){var property=this.setProperties(this.getProperties(),properties||{});var height=property.height;if(height==0)
height=$(control).height();var pageSize=this.getPageSize();var pos=this.realOffset(document.body);$(control).css('position',property.position);$(control).css('z-index',property.zIndex);var newTopOffSet=(pageSize.windowHeight/2-height/2+pos[1]+property.topOffSet);if(newTopOffSet<0){$(control).css('top',property.topOffSet);}
else{$(control).css('top',newTopOffSet);}
$(control).css('left',(pageSize.windowWidth/2-((property.width==0?$(control).width():property.width)/2)+pos[0]));if(property.height!=0)
$(control).height(property.height);if(property.width!=0)
$(control).width(property.width);$(control).css('display',property.display);$(control).prependTo('form');return property;},realOffset:function(element){var top=0,left=0;do{top+=element.scrollTop||0;left+=element.scrollLeft||0;element=element.parentNode;}while(element);return[left,top];},hide:function(control){var overlay=$('html > div:first');if(overlay!=null){$(overlay).remove();}
$(control).css('display','none');$(window).unbind('resize');$(window).unbind('scroll');},addOverlay:function(control,properties,fn){var overlay=document.createElement('div');$(overlay).css({top:0,left:0,position:'absolute',backgroundColor:properties.colorOverlay,opacity:properties.opacity,height:$(document).height(),width:'100%',zIndex:properties.zIndex-1});if(properties.closeOverlay){$(overlay).click(function(){QuickModal.hide(control);if(fn!=undefined){fn.call(this);}});}
$(overlay).prependTo('html');return overlay;},setOpacity:function(element,value){if(typeof element=='string'){element=$(element);}
if(value==1){element.style.opacity=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1.0;if(/MSIE/.test(navigator.userAgent)&&!window.opera){element.style.filter=element.style.filter.replace(/alpha\([^\)]*\)/gi,'');}}
else{if(value<0.00001)value=0;{element.style.opacity=value;}
if(/MSIE/.test(navigator.userAgent)&&!window.opera){element.style.filter=element.style.filter.replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+value*100+')';}}
return element;},getPageSize: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){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}
else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}
else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}
else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}
else{pageWidth=xScroll;}
return{'pageWidth':pageWidth,'pageHeight':pageHeight,'windowWidth':windowWidth,'windowHeight':windowHeight,'yScroll':yScroll,'xScroll':xScroll};}}
