The requested content cannot be loaded.
Please try again later.
',
closeBtn: '').html(content).find(current.selector);
} else if (content instanceof $) {
if (content.parent().hasClass('fancybox-inner')) {
content.parents('.fancybox-wrap').unbind('onReset');
}
content = content.show().detach();
$(F.wrap).bind('onReset', function () {
content.appendTo('body').hide();
});
}
if (current.autoSize) {
loadingBay = $('
')
.appendTo('body')
.css({
minWidth : getValue(minWidth, 'w'),
minHeight : getValue(minHeight, 'h'),
maxWidth : getValue(maxWidth, 'w'),
maxHeight : getValue(maxHeight, 'h')
})
.append(content);
current.width = loadingBay.width();
current.height = loadingBay.height();
// Re-check to fix 1px bug in some browsers
loadingBay.width( F.current.width );
if (loadingBay.height() > current.height) {
loadingBay.width(current.width + 1);
current.width = loadingBay.width();
current.height = loadingBay.height();
}
content = loadingBay.contents().detach();
loadingBay.remove();
}
break;
case 'image':
content = current.tpl.image.replace('{href}', current.href);
current.aspectRatio = true;
break;
case 'swf':
content = current.tpl.swf.replace(/\{width\}/g, current.width).replace(/\{height\}/g, current.height).replace(/\{href\}/g, current.href);
break;
case 'iframe':
content = $(current.tpl.iframe.replace('{rnd}', new Date().getTime()) )
.attr('scrolling', current.scrolling)
.attr('src', current.href);
current.scrolling = isTouch ? 'scroll' : 'auto';
break;
}
if (type === 'image' || type === 'swf') {
current.autoSize = false;
current.scrolling = 'visible';
}
if (type === 'iframe' && current.autoSize) {
F.showLoading();
F._setDimension();
F.inner.css('overflow', current.scrolling);
content.bind({
onCancel : function() {
$(this).unbind();
F._afterZoomOut();
},
load : function() {
F.hideLoading();
try {
if (this.contentWindow.document.location) {
F.current.height = $(this).contents().find('body').height();
}
} catch (e) {
F.current.autoSize = false;
}
F[ F.isOpen ? '_afterZoomIn' : '_beforeShow']();
}
}).appendTo(F.inner);
} else {
F.inner.append(content);
F._beforeShow();
}
},
_beforeShow : function() {
F.coming = null;
//Give a chance for helpers or callbacks to update elements
F.trigger('beforeShow');
//Set initial dimensions and hide
F._setDimension();
F.wrap.hide().removeClass('fancybox-tmp');
F.bindEvents();
F._preloadImages();
F.transitions[ F.isOpened ? F.current.nextMethod : F.current.openMethod ]();
},
_setDimension: function () {
var wrap = F.wrap,
inner = F.inner,
current = F.current,
viewport = F.getViewport(),
margin = current.margin,
padding2 = current.padding * 2,
width = current.width,
height = current.height,
maxWidth = current.maxWidth + padding2,
maxHeight = current.maxHeight + padding2,
minWidth = current.minWidth + padding2,
minHeight = current.minHeight + padding2,
ratio,
height_;
viewport.w -= (margin[1] + margin[3]);
viewport.h -= (margin[0] + margin[2]);
if (isPercentage(width)) {
width = (((viewport.w - padding2) * parseFloat(width)) / 100);
}
if (isPercentage(height)) {
height = (((viewport.h - padding2) * parseFloat(height)) / 100);
}
ratio = width / height;
width += padding2;
height += padding2;
if (current.fitToView) {
maxWidth = Math.min(viewport.w, maxWidth);
maxHeight = Math.min(viewport.h, maxHeight);
}
if (current.aspectRatio) {
if (width > maxWidth) {
width = maxWidth;
height = ((width - padding2) / ratio) + padding2;
}
if (height > maxHeight) {
height = maxHeight;
width = ((height - padding2) * ratio) + padding2;
}
if (width < minWidth) {
width = minWidth;
height = ((width - padding2) / ratio) + padding2;
}
if (height < minHeight) {
height = minHeight;
width = ((height - padding2) * ratio) + padding2;
}
} else {
width = Math.max(minWidth, Math.min(width, maxWidth));
height = Math.max(minHeight, Math.min(height, maxHeight));
}
width = Math.round(width);
height = Math.round(height);
//Reset dimensions
$(wrap.add(inner)).width('auto').height('auto');
inner.width(width - padding2).height(height - padding2);
wrap.width(width);
height_ = wrap.height(); // Real wrap height
//Fit wrapper inside
if (width > maxWidth || height_ > maxHeight) {
while ((width > maxWidth || height_ > maxHeight) && width > minWidth && height_ > minHeight) {
height = height - 10;
if (current.aspectRatio) {
width = Math.round(((height - padding2) * ratio) + padding2);
if (width < minWidth) {
width = minWidth;
height = ((width - padding2) / ratio) + padding2;
}
} else {
width = width - 10;
}
inner.width(width - padding2).height(height - padding2);
wrap.width(width);
height_ = wrap.height();
}
}
current.dim = {
width : getValue(width),
height : getValue(height_)
};
current.canGrow = current.autoSize && height > minHeight && height < maxHeight;
current.canShrink = false;
current.canExpand = false;
if ((width - padding2) < current.width || (height - padding2) < current.height) {
current.canExpand = true;
} else if ((width > viewport.w || height_ > viewport.h) && width > minWidth && height > minHeight) {
current.canShrink = true;
}
F.innerSpace = height_ - padding2 - inner.height();
},
_getPosition: function (onlyAbsolute) {
var current = F.current,
viewport = F.getViewport(),
margin = current.margin,
width = F.wrap.width() + margin[1] + margin[3],
height = F.wrap.height() + margin[0] + margin[2],
rez = {
position: 'absolute',
top : margin[0] + viewport.y,
left : margin[3] + viewport.x
};
if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
rez = {
position: 'fixed',
top : margin[0],
left : margin[3]
};
}
rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * 0.5)));
return rez;
},
_afterZoomIn: function () {
var current = F.current, scrolling = current ? current.scrolling : 'no';
if (!current) {
return;
}
F.isOpen = F.isOpened = true;
F.wrap.addClass('fancybox-opened');
F.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
F.trigger('afterShow');
F.update();
//Assign a click event
if (current.closeClick || current.nextClick) {
F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
F[ current.closeClick ? 'close' : 'next' ]();
}
});
}
//Create a close button
if (current.closeBtn) {
$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', F.close);
}
//Create navigation arrows
if (current.arrows && F.group.length > 1) {
if (current.loop || current.index > 0) {
$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
}
if (current.loop || current.index < F.group.length - 1) {
$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
}
}
if (F.opts.autoPlay && !F.player.isActive) {
F.opts.autoPlay = false;
F.play();
}
},
_afterZoomOut: function () {
var current = F.current;
F.wrap.trigger('onReset').remove();
$.extend(F, {
group: {},
opts: {},
current: null,
isActive: false,
isOpened: false,
isOpen: false,
wrap: null,
skin: null,
outer: null,
inner: null
});
F.trigger('afterClose', current);
}
});
/*
* Default transitions
*/
F.transitions = {
getOrigPosition: function () {
var current = F.current,
element = current.element,
padding = current.padding,
orig = $(current.orig),
pos = {},
width = 50,
height = 50,
viewport;
if (!orig.length && current.isDom && $(element).is(':visible')) {
orig = $(element).find('img:first');
if (!orig.length) {
orig = $(element);
}
}
if (orig.length) {
pos = orig.offset();
if (orig.is('img')) {
width = orig.outerWidth();
height = orig.outerHeight();
}
} else {
viewport = F.getViewport();
pos.top = viewport.y + (viewport.h - height) * 0.5;
pos.left = viewport.x + (viewport.w - width) * 0.5;
}
pos = {
top : getValue(pos.top - padding),
left : getValue(pos.left - padding),
width : getValue(width + padding * 2),
height : getValue(height + padding * 2)
};
return pos;
},
step: function (now, fx) {
var prop = fx.prop, value, ratio;
if (prop === 'width' || prop === 'height') {
value = Math.ceil(now - (F.current.padding * 2));
if (prop === 'height') {
ratio = (now - fx.start) / (fx.end - fx.start);
if (fx.start > fx.end) {
ratio = 1 - ratio;
}
value -= F.innerSpace * ratio;
}
F.inner[prop](value);
}
},
zoomIn: function () {
var wrap = F.wrap,
current = F.current,
effect = current.openEffect,
elastic = effect === 'elastic',
dim = current.dim,
startPos = $.extend({}, dim, F._getPosition( elastic )),
endPos = $.extend({opacity : 1}, startPos);
//Remove "position" property that breaks older IE
delete endPos.position;
if (elastic) {
startPos = this.getOrigPosition();
if (current.openOpacity) {
startPos.opacity = 0;
}
F.outer.add(F.inner).width('auto').height('auto');
} else if (effect === 'fade') {
startPos.opacity = 0;
}
wrap.css(startPos)
.show()
.animate(endPos, {
duration : effect === 'none' ? 0 : current.openSpeed,
easing : current.openEasing,
step : elastic ? this.step : null,
complete : F._afterZoomIn
});
},
zoomOut: function () {
var wrap = F.wrap,
current = F.current,
effect = current.openEffect,
elastic = effect === 'elastic',
endPos = {opacity : 0};
if (elastic) {
if (wrap.css('position') === 'fixed') {
wrap.css(F._getPosition(true));
}
endPos = this.getOrigPosition();
if (current.closeOpacity) {
endPos.opacity = 0;
}
}
wrap.animate(endPos, {
duration : effect === 'none' ? 0 : current.closeSpeed,
easing : current.closeEasing,
step : elastic ? this.step : null,
complete : F._afterZoomOut
});
},
changeIn: function () {
var wrap = F.wrap,
current = F.current,
effect = current.nextEffect,
elastic = effect === 'elastic',
startPos = F._getPosition( elastic ),
endPos = { opacity : 1 };
startPos.opacity = 0;
if (elastic) {
startPos.top = getValue(parseInt(startPos.top, 10) - 200);
endPos.top = '+=200px';
}
wrap.css(startPos)
.show()
.animate(endPos, {
duration : effect === 'none' ? 0 : current.nextSpeed,
easing : current.nextEasing,
complete : F._afterZoomIn
});
},
changeOut: function () {
var wrap = F.wrap,
current = F.current,
effect = current.prevEffect,
endPos = { opacity : 0 },
cleanUp = function () {
$(this).trigger('onReset').remove();
};
wrap.removeClass('fancybox-opened');
if (effect === 'elastic') {
endPos.top = '+=200px';
}
wrap.animate(endPos, {
duration : effect === 'none' ? 0 : current.prevSpeed,
easing : current.prevEasing,
complete : cleanUp
});
}
};
/*
* Overlay helper
*/
F.helpers.overlay = {
overlay: null,
update: function () {
var width, scrollWidth, offsetWidth;
//Reset width/height so it will not mess
this.overlay.width('100%').height('100%');
if ($.browser.msie || isTouch) {
scrollWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
width = scrollWidth < offsetWidth ? W.width() : scrollWidth;
} else {
width = D.width();
}
this.overlay.width(width).height(D.height());
},
beforeShow: function (opts) {
if (this.overlay) {
return;
}
opts = $.extend(true, {}, F.defaults.helpers.overlay, opts);
this.overlay = $('
').css(opts.css).appendTo('body');
if (opts.closeClick) {
this.overlay.bind('click.fb', F.close);
}
if (F.current.fixed && !isTouch) {
this.overlay.addClass('overlay-fixed');
} else {
this.update();
this.onUpdate = function () {
this.update();
};
}
this.overlay.fadeTo(opts.speedIn, opts.opacity);
},
afterClose: function (opts) {
if (this.overlay) {
this.overlay.fadeOut(opts.speedOut || 0, function () {
$(this).remove();
});
}
this.overlay = null;
}
};
/*
* Title helper
*/
F.helpers.title = {
beforeShow: function (opts) {
var title, text = F.current.title;
if (text) {
title = $('
' + text + '
').appendTo('body');
if (opts.type === 'float') {
//This helps for some browsers
title.width(title.width());
title.wrapInner('
');
//Increase bottom margin so this title will also fit into viewport
F.current.margin[2] += Math.abs(parseInt(title.css('margin-bottom'), 10));
}
title.appendTo(opts.type === 'over' ? F.inner : (opts.type === 'outside' ? F.wrap : F.skin));
}
}
};
// jQuery plugin initialization
$.fn.fancybox = function (options) {
var that = $(this),
selector = this.selector || '',
index,
run = function(e) {
var what = this, idx = index, relType, relVal;
if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !$(what).is('.fancybox-wrap')) {
e.preventDefault();
relType = options.groupAttr || 'data-fancybox-group';
relVal = $(what).attr(relType);
if (!relVal) {
relType = 'rel';
relVal = what[ relType ];
}
if (relVal && relVal !== '' && relVal !== 'nofollow') {
what = selector.length ? $(selector) : that;
what = what.filter('[' + relType + '="' + relVal + '"]');
idx = what.index(this);
}
options.index = idx;
F.open(what, options);
}
};
options = options || {};
index = options.index || 0;
if (selector) {
D.undelegate(selector, 'click.fb-start').delegate(selector, 'click.fb-start', run);
} else {
that.unbind('click.fb-start').bind('click.fb-start', run);
}
return this;
};
// Test for fixedPosition needs a body at doc ready
$(document).ready(function() {
F.defaults.fixed = $.support.fixedPosition || (!($.browser.msie && $.browser.version <= 6) && !isTouch);
});
}(window, document, jQuery));
/* sShipping/public/js/scripts.js */
//PRIORITY:190
/* shipping scripts */
function selectShipMethod(purchaseId, shipOptCode, shipPriceQuote)
{
$.ajax({
type: "POST",
url: "module/sShipping/ajax/selectShipMethod.php",
data: "purchaseId="+purchaseId+"&shipOptCode="+shipOptCode+"&shipPriceQuote="+shipPriceQuote,
success: function(ajaxValues){
//alert(ajaxValues);
//document.getElementById('checkoutTotal').innerHTML = ajaxValues;
}
});
}
/* tooltip/public/js/scripts.js */
//PRIORITY:110
/* tooltip */
/**
* jquery.simpletip 1.3.1. A simple tooltip plugin
*
* Copyright (c) 2009 Craig Thompson
* http://craigsworks.com
*
* Licensed under GPLv3
* http://www.opensource.org/licenses/gpl-3.0.html
*
* Launch : February 2009
* Version : 1.3.1
* Released: February 5, 2009 - 11:04am
*/
(function($){function Simpletip(elem,conf){var self=this;elem=jQuery(elem);var tooltip=jQuery(document.createElement('div')).addClass(conf.baseClass).addClass((conf.fixed)?conf.fixedClass:'').addClass((conf.persistent)?conf.persistentClass:'').html(conf.content).appendTo(elem);if(!conf.hidden)tooltip.show();else tooltip.hide();if(!conf.persistent){elem.hover(function(event){self.show(event)},function(){self.hide()});if(!conf.fixed){elem.mousemove(function(event){if(tooltip.css('display')!=='none')self.updatePos(event);});};}else
{elem.click(function(event){if(event.target===elem.get(0)){if(tooltip.css('display')!=='none')self.hide();else
self.show();};});jQuery(window).mousedown(function(event){if(tooltip.css('display')!=='none'){var check=(conf.focus)?jQuery(event.target).parents('.tooltip').andSelf().filter(function(){return this===tooltip.get(0)}).length:0;if(check===0)self.hide();};});};jQuery.extend(self,{getVersion:function(){return[1,2,0];},getParent:function(){return elem;},getTooltip:function(){return tooltip;},getPos:function(){return tooltip.offset();},setPos:function(posX,posY){var elemPos=elem.offset();if(typeof posX=='string')posX=parseInt(posX)+elemPos.left;if(typeof posY=='string')posY=parseInt(posY)+elemPos.top;tooltip.css({left:posX,top:posY});return self;},show:function(event){conf.onBeforeShow.call(self);self.updatePos((conf.fixed)?null:event);switch(conf.showEffect){case'fade':tooltip.fadeIn(conf.showTime);break;case'slide':tooltip.slideDown(conf.showTime,self.updatePos);break;case'custom':conf.showCustom.call(tooltip,conf.showTime);break;default:case'none':tooltip.show();break;};tooltip.addClass(conf.activeClass);conf.onShow.call(self);return self;},hide:function(){conf.onBeforeHide.call(self);switch(conf.hideEffect){case'fade':tooltip.fadeOut(conf.hideTime);break;case'slide':tooltip.slideUp(conf.hideTime);break;case'custom':conf.hideCustom.call(tooltip,conf.hideTime);break;default:case'none':tooltip.hide();break;};tooltip.removeClass(conf.activeClass);conf.onHide.call(self);return self;},update:function(content){tooltip.html(content);conf.content=content;return self;},load:function(uri,data){conf.beforeContentLoad.call(self);tooltip.load(uri,data,function(){conf.onContentLoad.call(self);});return self;},boundryCheck:function(posX,posY){var newX=posX+tooltip.outerWidth();var newY=posY+tooltip.outerHeight();var windowWidth=jQuery(window).width()+jQuery(window).scrollLeft();var windowHeight=jQuery(window).height()+jQuery(window).scrollTop();return[(newX>=windowWidth),(newY>=windowHeight)];},updatePos:function(event){var tooltipWidth=tooltip.outerWidth();var tooltipHeight=tooltip.outerHeight();if(!event&&conf.fixed){if(conf.position.constructor==Array){posX=parseInt(conf.position[0]);posY=parseInt(conf.position[1]);}else if(jQuery(conf.position).attr('nodeType')===1){var offset=jQuery(conf.position).offset();posX=offset.left;posY=offset.top;}else
{var elemPos=elem.offset();var elemWidth=elem.outerWidth();var elemHeight=elem.outerHeight();switch(conf.position){case'top':var posX=elemPos.left-(tooltipWidth/2)+(elemWidth/2);var posY=elemPos.top-tooltipHeight;break;case'bottom':var posX=elemPos.left-(tooltipWidth/2)+(elemWidth/2);var posY=elemPos.top+elemHeight;break;case'left':var posX=elemPos.left-tooltipWidth;var posY=elemPos.top-(tooltipHeight/2)+(elemHeight/2);break;case'right':var posX=elemPos.left+elemWidth;var posY=elemPos.top-(tooltipHeight/2)+(elemHeight/2);break;default:case'default':var posX=(elemWidth/2)+elemPos.left+20;var posY=elemPos.top;break;};};}else
{var posX=event.pageX;var posY=event.pageY;};if(typeof conf.position!='object'){posX=posX+conf.offset[0];posY=posY+conf.offset[1];if(conf.boundryCheck){var overflow=self.boundryCheck(posX,posY);if(overflow[0])posX=posX-(tooltipWidth/2)-(2*conf.offset[0]);if(overflow[1])posY=posY-(tooltipHeight/2)-(2*conf.offset[1]);}}else
{if(typeof conf.position[0]=="string")posX=String(posX);if(typeof conf.position[1]=="string")posY=String(posY);};self.setPos(posX,posY);return self;}});};jQuery.fn.simpletip=function(conf){var api=jQuery(this).eq(typeof conf=='number'?conf:0).data("simpletip");if(api)return api;var defaultConf={content:'A simple tooltip',persistent:false,focus:false,hidden:true,position:'default',offset:[0,0],boundryCheck:true,fixed:true,showEffect:'fade',showTime:150,showCustom:null,hideEffect:'fade',hideTime:150,hideCustom:null,baseClass:'tooltip',activeClass:'active',fixedClass:'fixed',persistentClass:'persistent',focusClass:'focus',onBeforeShow:function(){},onShow:function(){},onBeforeHide:function(){},onHide:function(){},beforeContentLoad:function(){},onContentLoad:function(){}};jQuery.extend(defaultConf,conf);this.each(function(){var el=new Simpletip(jQuery(this),defaultConf);jQuery(this).data("simpletip",el);});return this;};})();
/* sAddress/public/js/scripts.js */
//PRIORITY:200
function addAddress(addressTypeId)
{
$.ajax({
type: "POST",
url: "module/sAddress/ajax/addAddress.php",
data: "addressTypeId="+addressTypeId,
success: function(ajaxValues){
if(addressTypeId == '1')
{
window.location='shipping';
}
if(addressTypeId == '2')
{
window.location='payment';
}
}
});
}
function editAddress(addressId)
{
var addressHolderDiv = document.getElementById('address-'+addressId);
$.ajax({
type: "POST",
url: "module/sAddress/ajax/displayAddressEditor.php",
data: "addressId="+addressId,
success: function(ajaxValues){
addressHolderDiv.innerHTML = ajaxValues;
}
});
}
function cancelAddressEdit(addressId)
{
var addressHolderDiv = document.getElementById('address-'+addressId);
$.ajax({
type: "POST",
url: "module/sAddress/ajax/displayAddress.php",
data: "addressId="+addressId,
success: function(ajaxValues){
addressHolderDiv.innerHTML = ajaxValues;
}
});
}
function saveAddressEdit(addressId)
{
var formData = $('#addressEditForm-'+addressId).serialize();
$.ajax({
type: "POST",
url: "module/sAddress/ajax/editAddress.php",
data: formData,
success: function(ajaxValues){
var ajaxParts = ajaxValues.split("|");
if(ajaxParts[0] > 0)
{
switch(ajaxParts[0])
{
case "1":
window.location='shipping';
break;
case "2":
window.location='payment';
break;
}
}
else
{
document.getElementById('addressEditorError-'+addressId).innerHTML = ajaxParts[1];
document.getElementById('addressEditorError-'+addressId).style.display = 'block';
}
}
});
}
function selectAddress(addressId)
{
$.ajax({
type: "POST",
url: "module/sAddress/ajax/selectAddress.php",
data: "addressId="+addressId,
success: function(ajaxValues){
var ajaxParts = ajaxValues.split('|');
if(ajaxParts[0] == '1')
{
window.location='shipping';
}
if(ajaxParts[0] == '2')
{
window.location='payment';
}
}
});
}
/* sCart/public/js/scripts.js */
//PRIORITY:130
/* Cart Scripts */
var qtyTimeout = null;
function addToCart(pageId, qty) {
$.ajax({
type: 'POST',
url: 'module/sCart/ajax/addToCart.php',
data: 'pageId='+pageId+'&qty='+qty,
success: function(ajaxValues){
var ajaxParts = ajaxValues.split('|');
if(ajaxParts[0] > 0)
{
refreshLiteCart();
}
else
{
alert('Out of Stock!');
}
if(ajaxParts[1] == 0) { $('#addToCartBtn-'+pageId).css('display', 'none'); }
$('#qtyInStock-'+pageId).html(ajaxParts[1]);
}
});
}
function refreshLiteCart() {
$.ajax({
type: 'POST',
url: 'module/sCart/ajax/refreshLiteCart.php',
data: '',
success: function(ajaxValues){
var ajaxParts = ajaxValues.split('|');
if(ajaxParts[1] > 0) {
$('#cartItemCount').html(ajaxParts[1]);
$('#liteCartBtn').css('display', 'block');
$('#liteCart').html(ajaxParts[0]);
}
}
});
}
function removeFromCart(ppId)
{
$.ajax({
type: 'POST',
url: 'module/sCart/ajax/removeFromCart.php',
data: 'ppId='+ppId,
dataType: "json",
success: function(ajaxValues){
if(ajaxValues.success == '1')
{
//This user has permission to remove this item from cart
//Remove this PurchaseProduct row
$('#cartItemDiv-'+ppId).remove();
//Update grandTotal
$('#cartGrandTotal').html(ajaxValues.grandTotal);
//Refresh the liteCart
refreshLiteCart();
}
else
{
alert(ajaxValues.errorMsg);
}
}
});
}
function updateQty(element)
{
var ppId = $(element).attr('id').substr(4);
$(element).css('background-color', '#EEE');
clearTimeout(qtyTimeout);
qtyTimeout = setTimeout(function() {
$.ajax({
type: 'POST',
url: 'module/sCart/ajax/updateQty.php',
data: 'ppId='+ppId+'&qty='+$(element).val(),
dataType: 'json',
success: function(ajaxValues){
if(ajaxValues.success == '1')
{
//Quantity has been updated successfully
//Update the qty input field
$('#qty-'+ppId).val(ajaxValues.qty);
//Update Item Total
$('#cartTotal-'+ppId).html(ajaxValues.total);
//Update grandTotal
$('#cartGrandTotal').html(ajaxValues.grandTotal);
//Refresh the liteCart
refreshLiteCart();
}
else
{
//An Invalid qty has been entered
//Reset the qty field with the previous valid value
$('#qty-'+ppId).val(ajaxValues.qty);
}
$('#qty-'+ppId).css('background-color', '#FFF');
}
});
}, 1000);
}
function doRegister()
{
var userEmail = $('#registerEmail').val();
var userPassword = $('#registerPassword').val();
$.ajax({
type: "POST",
url: "module/sCart/ajax/register.php",
data: "userEmail="+userEmail+"&userPassword="+userPassword,
dataType: 'json',
success: function(ajaxParts) {
if(ajaxParts.success) {
window.location = 'cart';
} else {
$('#registerError').html(ajaxParts.errorMsg);
$('#registerPassword').val('');
$('#registerPassword').focus();
}
}
});
}
/*
function isNumber(n)
{
return !isNaN(parseFloat(n)) && isFinite(n);
}
function validateQty(inputBox, minQty)
{
var tempVal = $(inputBox).val();
$(inputBox).css('background-color', '#EEE');
clearTimeout(qtyTimeout);
qtyTimeout = setTimeout(function() {
if(! isNumber(tempVal))
{
$(inputBox).val(minQty);
}
else
{
if(tempVal < minQty)
{
$(inputBox).val(minQty);
}
}
$(inputBox).css('background-color', '#FFF');
}, 1000);
}
*/
/* sSearch/public/js/scripts.js */
//PRIORITY:120
/* Search */
/* bxslider/public/js/jquery.bxslider.min.js */
/**
* BxSlider v4.1.1 - Fully loaded, responsive content slider
* http://bxslider.com
*
* Copyright 2012, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
* Written while drinking Belgian ales and listening to jazz
*
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*/
!function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length
1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap(''),o.viewport=r.parent(),o.loader=t(''),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:v()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:50,display:"block"})),o.controls.el=t(''),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).is("img")&&t(this).attr("src",t(this).attr("src")+"?timestamp="+(new Date).getTime()),t(this).load(function(){setTimeout(function(){++n==s&&i()},0)})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(p()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",B),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&I(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},p=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},v=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e0)if(o.viewport.width()o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t(''),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.delegate("a","click",q)},C=function(){o.controls.next=t(''+o.settings.nextText+""),o.controls.prev=t(''+o.settings.prevText+""),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t(''),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('"),o.controls.stop=t('"),o.controls.autoEl=t(''),o.controls.autoEl.delegate(".bx-start","click",k),o.controls.autoEl.delegate(".bx-stop","click",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append(''+e+"
")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},q=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},I=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),"horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0)}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},B=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider())};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&I(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",51).fadeIn(o.settings.speed,function(){t(this).css("zIndex",50),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",p()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),I(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",B))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
/* sForm/public/js/scripts.js */
//Form Scripts
function submitForm(formId) {
var formData = $('#form-'+formId).serialize();
$('.fieldErrorMsg').html('');
$.ajax({
type: "POST",
url: "module/sForm/ajax/submitForm.php",
dataType:"json",
data: formData,
success: function(data){
console.log(data);
if(data.validSubmission) {
$('#formHolder-'+formId).html(data.formSuccessText);
} else {
//Print all error messages to the form
for(var i=0; iul") //reference main menu UL
$mainmenu.parent().get(0).className=setting.classname || "ddsmoothmenu"
var $headers=$mainmenu.find("ul").parent()
$headers.hover(
function(e){
$(this).children('a:eq(0)').addClass('selected')
},
function(e){
$(this).children('a:eq(0)').removeClass('selected')
}
)
$headers.each(function(i){ //loop through each LI header
var $curobj=$(this).css({zIndex: 990-i}) //reference current LI header
var $subul=$(this).find('ul:eq(0)').css({display:'block'})
$subul.data('timers', {})
this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
this.istopheader=$curobj.parents("ul").length==1? true : false //is top level header?
$subul.css({top:this.istopheader && setting.orientation!='v'? this._dimensions.h+"px" : 0})
$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: smoothmenu.arrowimages.down[2]} : {}).append( //add arrow images
''
)
if (smoothmenu.shadow.enable && !smoothmenu.css3support){ //if shadows enabled and browser doesn't support CSS3 box shadows
this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx : this._dimensions.w), y:(this.istopheader? $subul.offset().top+smoothmenu.shadow.offsety : $curobj.position().top)} //store this shadow's offsets
if (this.istopheader)
$parentshadow=$(document.body)
else{
var $parentLi=$curobj.parents("li:eq(0)")
$parentshadow=$parentLi.get(0).$shadow
}
this.$shadow=$('').prependTo($parentshadow).css({left:this._shadowoffset.x+'px', top:this._shadowoffset.y+'px'}) //insert shadow DIV and set it to parent node for the next shadow div
}
$curobj.hover(
function(e){
var $targetul=$subul //reference UL to reveal
var header=$curobj.get(0) //reference header LI as DOM object
clearTimeout($targetul.data('timers').hidetimer)
$targetul.data('timers').showtimer=setTimeout(function(){
header._offsets={left:$curobj.offset().left, top:$curobj.offset().top}
var menuleft=header.istopheader && setting.orientation!='v'? 0 : header._dimensions.w
menuleft=(header._offsets.left+menuleft+header._dimensions.subulw>$(window).width())? (header.istopheader && setting.orientation!='v'? -header._dimensions.subulw+header._dimensions.w : -header._dimensions.w) : menuleft //calculate this sub menu's offsets from its parent
if ($targetul.queue().length<=1){ //if 1 or less queued animations
$targetul.css({left:menuleft+"px", width:header._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, ddsmoothmenu.transition.overtime)
if (smoothmenu.shadow.enable && !smoothmenu.css3support){
var shadowleft=header.istopheader? $targetul.offset().left+ddsmoothmenu.shadow.offsetx : menuleft
var shadowtop=header.istopheader?$targetul.offset().top+smoothmenu.shadow.offsety : header._shadowoffset.y
if (!header.istopheader && ddsmoothmenu.detectwebkit){ //in WebKit browsers, restore shadow's opacity to full
header.$shadow.css({opacity:.5})
}
header.$shadow.css({overflow:'', width:header._dimensions.subulw+'px', left:shadowleft+'px', top:shadowtop+'px'}).animate({height:header._dimensions.subulh+'px'}, ddsmoothmenu.transition.overtime)
}
}
}, ddsmoothmenu.showhidedelay.showdelay)
},
function(e){
var $targetul=$subul
var header=$curobj.get(0)
clearTimeout($targetul.data('timers').showtimer)
$targetul.data('timers').hidetimer=setTimeout(function(){
$targetul.animate({height:'hide', opacity:'hide'}, ddsmoothmenu.transition.outtime)
if (smoothmenu.shadow.enable && !smoothmenu.css3support){
if (ddsmoothmenu.detectwebkit){ //in WebKit browsers, set first child shadow's opacity to 0, as "overflow:hidden" doesn't work in them
header.$shadow.children('div:eq(0)').css({opacity:0})
}
header.$shadow.css({overflow:'hidden'}).animate({height:0}, ddsmoothmenu.transition.outtime)
}
}, ddsmoothmenu.showhidedelay.hidedelay)
}
) //end hover
}) //end $headers.each()
if (smoothmenu.shadow.enable && smoothmenu.css3support){ //if shadows enabled and browser supports CSS3 shadows
var $toplevelul=$('#'+setting.mainmenuid+' ul li ul')
var css3shadow=parseInt(smoothmenu.shadow.offsetx)+"px "+parseInt(smoothmenu.shadow.offsety)+"px 5px #000" //construct CSS3 box-shadow value
var shadowprop=["boxShadow", "MozBoxShadow", "WebkitBoxShadow", "MsBoxShadow"] //possible vendor specific CSS3 shadow properties
for (var i=0; i\n'
+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
+'')
}
this.shadow.enable=(document.all && !window.XMLHttpRequest)? false : this.shadow.enable //in IE6, always disable shadow
jQuery(document).ready(function($){ //ajax menu?
if (typeof setting.contentsource=="object"){ //if external ajax menu
ddsmoothmenu.getajaxmenu($, setting)
}
else{ //else if markup menu
ddsmoothmenu.buildmenu($, setting)
}
})
}
} //end ddsmoothmenu variable