// mredkj.com
function NumberFormat(num, inputDecimal)
{
this.VERSION = 'Number Format v1.5.4';
this.COMMA = ',';
this.PERIOD = '.';
this.DASH = '-'; 
this.LEFT_PAREN = '('; 
this.RIGHT_PAREN = ')'; 
this.LEFT_OUTSIDE = 0; 
this.LEFT_INSIDE = 1;  
this.RIGHT_INSIDE = 2;  
this.RIGHT_OUTSIDE = 3;  
this.LEFT_DASH = 0; 
this.RIGHT_DASH = 1; 
this.PARENTHESIS = 2; 
this.NO_ROUNDING = -1 
this.num;
this.numOriginal;
this.hasSeparators = false;  
this.separatorValue;  
this.inputDecimalValue; 
this.decimalValue;  
this.negativeFormat; 
this.negativeRed; 
this.hasCurrency;  
this.currencyPosition;  
this.currencyValue;  
this.places;
this.roundToPlaces; 
this.truncate; 
this.setNumber = setNumberNF;
this.toUnformatted = toUnformattedNF;
this.setInputDecimal = setInputDecimalNF; 
this.setSeparators = setSeparatorsNF; 
this.setCommas = setCommasNF;
this.setNegativeFormat = setNegativeFormatNF; 
this.setNegativeRed = setNegativeRedNF; 
this.setCurrency = setCurrencyNF;
this.setCurrencyPrefix = setCurrencyPrefixNF;
this.setCurrencyValue = setCurrencyValueNF; 
this.setCurrencyPosition = setCurrencyPositionNF; 
this.setPlaces = setPlacesNF;
this.toFormatted = toFormattedNF;
this.toPercentage = toPercentageNF;
this.getOriginal = getOriginalNF;
this.moveDecimalRight = moveDecimalRightNF;
this.moveDecimalLeft = moveDecimalLeftNF;
this.getRounded = getRoundedNF;
this.preserveZeros = preserveZerosNF;
this.justNumber = justNumberNF;
this.expandExponential = expandExponentialNF;
this.getZeros = getZerosNF;
this.moveDecimalAsString = moveDecimalAsStringNF;
this.moveDecimal = moveDecimalNF;
this.addSeparators = addSeparatorsNF;
if (inputDecimal == null) {
this.setNumber(num, this.PERIOD);
} else {
this.setNumber(num, inputDecimal); 
}
this.setCommas(true);
this.setNegativeFormat(this.LEFT_DASH); 
this.setNegativeRed(false); 
this.setCurrency(false); 
this.setCurrencyPrefix('$');
this.setPlaces(2);
}
function setInputDecimalNF(val)
{
this.inputDecimalValue = val;
}
function setNumberNF(num, inputDecimal)
{
if (inputDecimal != null) {
this.setInputDecimal(inputDecimal); 
}
this.numOriginal = num;
this.num = this.justNumber(num);
}
function toUnformattedNF()
{
return (this.num);
}
function getOriginalNF()
{
return (this.numOriginal);
}
function setNegativeFormatNF(format)
{
this.negativeFormat = format;
}
function setNegativeRedNF(isRed)
{
this.negativeRed = isRed;
}
function setSeparatorsNF(isC, separator, decimal)
{
this.hasSeparators = isC;
if (separator == null) separator = this.COMMA;
if (decimal == null) decimal = this.PERIOD;
if (separator == decimal) {
this.decimalValue = (decimal == this.PERIOD) ? this.COMMA : this.PERIOD;
} else {
this.decimalValue = decimal;
}
this.separatorValue = separator;
}
function setCommasNF(isC)
{
this.setSeparators(isC, this.COMMA, this.PERIOD);
}
function setCurrencyNF(isC)
{
this.hasCurrency = isC;
}
function setCurrencyValueNF(val)
{
this.currencyValue = val;
}
function setCurrencyPrefixNF(cp)
{
this.setCurrencyValue(cp);
this.setCurrencyPosition(this.LEFT_OUTSIDE);
}
function setCurrencyPositionNF(cp)
{
this.currencyPosition = cp
}
function setPlacesNF(p, tr)
{
this.roundToPlaces = !(p == this.NO_ROUNDING); 
this.truncate = (tr != null && tr); 
this.places = (p < 0) ? 0 : p; 
}
function addSeparatorsNF(nStr, inD, outD, sep)
{
nStr += '';
var dpos = nStr.indexOf(inD);
var nStrEnd = '';
if (dpos != -1) {
nStrEnd = outD + nStr.substring(dpos + 1, nStr.length);
nStr = nStr.substring(0, dpos);
}
var rgx = /(\d+)(\d{3})/;
while (rgx.test(nStr)) {
nStr = nStr.replace(rgx, '$1' + sep + '$2');
}
return nStr + nStrEnd;
}
function toFormattedNF()
{	
var pos;
var nNum = this.num; 
var nStr;            
var splitString = new Array(2);   
if (this.roundToPlaces) {
nNum = this.getRounded(nNum);
nStr = this.preserveZeros(Math.abs(nNum)); 
} else {
nStr = this.expandExponential(Math.abs(nNum)); 
}
if (this.hasSeparators) {
nStr = this.addSeparators(nStr, this.PERIOD, this.decimalValue, this.separatorValue);
} else {
nStr = nStr.replace(new RegExp('\\' + this.PERIOD), this.decimalValue); 
}
var c0 = '';
var n0 = '';
var c1 = '';
var n1 = '';
var n2 = '';
var c2 = '';
var n3 = '';
var c3 = '';
var negSignL = (this.negativeFormat == this.PARENTHESIS) ? this.LEFT_PAREN : this.DASH;
var negSignR = (this.negativeFormat == this.PARENTHESIS) ? this.RIGHT_PAREN : this.DASH;
if (this.currencyPosition == this.LEFT_OUTSIDE) {
if (nNum < 0) {
if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL;
if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR;
}
if (this.hasCurrency) c0 = this.currencyValue;
} else if (this.currencyPosition == this.LEFT_INSIDE) {
if (nNum < 0) {
if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL;
if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR;
}
if (this.hasCurrency) c1 = this.currencyValue;
}
else if (this.currencyPosition == this.RIGHT_INSIDE) {
if (nNum < 0) {
if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL;
if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR;
}
if (this.hasCurrency) c2 = this.currencyValue;
}
else if (this.currencyPosition == this.RIGHT_OUTSIDE) {
if (nNum < 0) {
if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL;
if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR;
}
if (this.hasCurrency) c3 = this.currencyValue;
}
nStr = c0 + n0 + c1 + n1 + nStr + n2 + c2 + n3 + c3;
if (this.negativeRed && nNum < 0) {
nStr = '<font color="red">' + nStr + '</font>';
}
return (nStr);
}
function toPercentageNF()
{
nNum = this.num * 100;
nNum = this.getRounded(nNum);
return nNum + '%';
}
function getZerosNF(places)
{
var extraZ = '';
var i;
for (i=0; i<places; i++) {
extraZ += '0';
}
return extraZ;
}
function expandExponentialNF(origVal)
{
if (isNaN(origVal)) return origVal;
var newVal = parseFloat(origVal) + ''; 
var eLoc = newVal.toLowerCase().indexOf('e');
if (eLoc != -1) {
var plusLoc = newVal.toLowerCase().indexOf('+');
var negLoc = newVal.toLowerCase().indexOf('-', eLoc); 
var justNumber = newVal.substring(0, eLoc);
if (negLoc != -1) {
var places = newVal.substring(negLoc + 1, newVal.length);
justNumber = this.moveDecimalAsString(justNumber, true, parseInt(places));
} else {
if (plusLoc == -1) plusLoc = eLoc;
var places = newVal.substring(plusLoc + 1, newVal.length);
justNumber = this.moveDecimalAsString(justNumber, false, parseInt(places));
}
newVal = justNumber;
}
return newVal;
} 
function moveDecimalRightNF(val, places)
{
var newVal = '';
if (places == null) {
newVal = this.moveDecimal(val, false);
} else {
newVal = this.moveDecimal(val, false, places);
}
return newVal;
}
function moveDecimalLeftNF(val, places)
{
var newVal = '';
if (places == null) {
newVal = this.moveDecimal(val, true);
} else {
newVal = this.moveDecimal(val, true, places);
}
return newVal;
}
function moveDecimalAsStringNF(val, left, places)
{
var spaces = (arguments.length < 3) ? this.places : places;
if (spaces <= 0) return val; 
var newVal = val + '';
var extraZ = this.getZeros(spaces);
var re1 = new RegExp('([0-9.]+)');
if (left) {
newVal = newVal.replace(re1, extraZ + '$1');
var re2 = new RegExp('(-?)([0-9]*)([0-9]{' + spaces + '})(\\.?)');		
newVal = newVal.replace(re2, '$1$2.$3');
} else {
var reArray = re1.exec(newVal); 
if (reArray != null) {
newVal = newVal.substring(0,reArray.index) + reArray[1] + extraZ + newVal.substring(reArray.index + reArray[0].length); 
}
var re2 = new RegExp('(-?)([0-9]*)(\\.?)([0-9]{' + spaces + '})');
newVal = newVal.replace(re2, '$1$2$4.');
}
newVal = newVal.replace(/\.$/, ''); 
return newVal;
}
function moveDecimalNF(val, left, places)
{
var newVal = '';
if (places == null) {
newVal = this.moveDecimalAsString(val, left);
} else {
newVal = this.moveDecimalAsString(val, left, places);
}
return parseFloat(newVal);
}
function getRoundedNF(val)
{
val = this.moveDecimalRight(val);
if (this.truncate) {
val = val >= 0 ? Math.floor(val) : Math.ceil(val); 
} else {
val = Math.round(val);
}
val = this.moveDecimalLeft(val);
return val;
}
function preserveZerosNF(val)
{
var i;
val = this.expandExponential(val);
if (this.places <= 0) return val; 
var decimalPos = val.indexOf('.');
if (decimalPos == -1) {
val += '.';
for (i=0; i<this.places; i++) {
val += '0';
}
} else {
var actualDecimals = (val.length - 1) - decimalPos;
var difference = this.places - actualDecimals;
for (i=0; i<difference; i++) {
val += '0';
}
}
return val;
}
function justNumberNF(val)
{
newVal = val + '';
var isPercentage = false;
if (newVal.indexOf('%') != -1) {
newVal = newVal.replace(/\%/g, '');
isPercentage = true; 
}
var re = new RegExp('[^\\' + this.inputDecimalValue + '\\d\\-\\+\\(\\)eE]', 'g');	
newVal = newVal.replace(re, '');
var tempRe = new RegExp('[' + this.inputDecimalValue + ']', 'g');
var treArray = tempRe.exec(newVal); 
if (treArray != null) {
var tempRight = newVal.substring(treArray.index + treArray[0].length); 
newVal = newVal.substring(0,treArray.index) + this.PERIOD + tempRight.replace(tempRe, ''); 
}
if (newVal.charAt(newVal.length - 1) == this.DASH ) {
newVal = newVal.substring(0, newVal.length - 1);
newVal = '-' + newVal;
}
else if (newVal.charAt(0) == this.LEFT_PAREN
&& newVal.charAt(newVal.length - 1) == this.RIGHT_PAREN) {
newVal = newVal.substring(1, newVal.length - 1);
newVal = '-' + newVal;
}
newVal = parseFloat(newVal);
if (!isFinite(newVal)) {
newVal = 0;
}
if (isPercentage) {
newVal = this.moveDecimalLeft(newVal, 2);
}
return newVal;
}
// must load mredkj.com NumberFormat first

function MoneyFormat(amount)
{
    var localeconv = arguments.callee.localeconv;

    var nf = new NumberFormat(amount, localeconv.decimal_point);
    nf.setCurrency(true);

    if (localeconv.n_sign_posn == 2 || localeconv.n_sign_posn == 4) {
        nf.setNegativeFormat(nf.RIGHT_DASH);
    } else {
        nf.setNegativeFormat(nf.LEFT_DASH);
    }

    nf.setCurrencyPosition(localeconv.p_cs_precedes ? nf.LEFT_OUTSIDE : nf.RIGHT_OUTSIDE);

    if (localeconv.p_sep_by_space) {
        nf.setCurrencyValue(' '+localeconv.currency_symbol);
    } else {
        nf.setCurrencyValue(localeconv.currency_symbol)
    }

    return nf.toFormatted();
}
/* from: http://labnol.blogspot.com/2006/01/add-to-favorites-ie-bookmark-firefox.html */
function CreateBookmarkLink(title, url) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
		return true; 
	} 
	else if ( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title);
		return true; 
	}
	else if(window.opera && window.print) { // Opera Hotlist
		return true; 
	}
}

function showBox(sId) {
	document.getElementById(sId).style.display = 'block';
	var currentId = sId.replace(/sub/,'');
	document.getElementById('parent' + currentId).className += ' open';
}


function hideBox(sId) {
	document.getElementById(sId).style.display = 'none';
	var currentId = sId.replace(/sub/,'');
	var currentClass = document.getElementById('parent' + currentId).className;
	currentClass = currentClass.replace(/\s?open/,'');
	document.getElementById('parent' + currentId).className = currentClass;
}

function toggleSubMenu(sId,sLocation) {
	if (!document.getElementById(sId)) {
		location.href = sLocation;
		return;
	}
	else {
		if (document.getElementById(sId).style.display != 'block') {
			showBox(sId);
		}
		else {
			hideBox(sId);
		}
	}
}


function show(sId, display) {
	if (typeof(display) == 'undefined') {
		display = 'block'
	}
	document.getElementById(sId).style.display = display;
};

function hide(sId) {
	document.getElementById(sId).style.display = 'none';
};

function toggleDisplay(sId) {
	if (document.getElementById(sId).style.display != 'block') {
		document.getElementById(sId).style.display = 'block';
	}
	else {
		document.getElementById(sId).style.display = 'none';
	}
};


function slideOpen (sId, finalHeight) {
	var slidingElement = document.getElementById(sId);
	slidingElement.style.height = '1px';
	var actualHeight = 2;
	show (sId);
	var slideInt = setInterval(function () {
		while (actualHeight < finalHeight ) {
			slidingElement.style.height = actualHeight + 'px';
			actualHeight++;
		}
		clearInterval(slideInt);
	}, 500);
};

function slideClose (sId) {
	var slidingElement = document.getElementById(sId);
	var actualHeight = slidingElement.offsetHeight;
	var slideCloseInt = setInterval(function () {
		while (actualHeight >= 1 ) {
			slidingElement.style.height = actualHeight + 'px';
			actualHeight--;
		}
		hide (sId);
		clearInterval(slideCloseInt);
	}, 500);
};



function getInternetExplorerVersion() {
	/* Returns the version of Windows Internet Explorer or a -1
	(indicating the use of another browser).*/
	   var rv = -1; /* Return value assumes failure. (ml> A healthy assumption when dealing with MS) */
	   if (navigator.appName == 'Microsoft Internet Explorer')
	   {
	      var ua = navigator.userAgent;
	      var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
	      if (re.exec(ua) != null)
	         rv = parseFloat( RegExp.$1 );
	   }
	   return rv;
	}


function detectIe6 () {
	var agentVersion = getInternetExplorerVersion();
	if (agentVersion > -1) {
		isIE = true;
	}
	if (8.0 == agentVersion) {
		isIE8 = true;
	}
	if (7.0 == agentVersion) {
		isIE7 = true;
	}
	if (6.0 == agentVersion) {
		isIE6 = true;
		if(document.getElementById('ie6Detector')) {
			try {
				document.getElementById('ie6Detector').innerHTML = '<p><input type="button" id="closeIe6Detector" class="close" width="16px" height="16px" title="close" /><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" target="_blank">Internet Explorer is missing updates required to view this site. Click here to update... </a></p>';
				slideOpen('ie6Detector', 15);
			}
			catch (e) {
				alert(e);
			}
			document.getElementById('ie6Detector').onmouseover = function () {
				document.getElementById('closeIe6Detector').style.backgroundColor = '#3399ff';
				document.getElementById('ie6Detector').style.backgroundColor = '#3399ff';
				document.getElementById('ie6Detector').style.color = '#ffffff';
			}
			document.getElementById('ie6Detector').onmouseout = function () {
				document.getElementById('closeIe6Detector').style.backgroundColor = '#FFFFE1';
				document.getElementById('ie6Detector').style.backgroundColor = '#FFFFE1';
				document.getElementById('ie6Detector').style.color = '#000000';
			}
			document.getElementById('closeIe6Detector').onclick = function() {
				slideClose('ie6Detector');
			}
		}
		var images = document.getElementsByTagName('img');
		for (var i=0;i < images.length;i++) {
			images[i].src = images[i].src.replace(/png/i,'gif');
		}
	}
};

function pickOneof3(box_counter,thumb_counter) {
	$('triplet' + box_counter).getElements('div.tri_details').each(function(triBox) {
		triBox.style.display = 'none';
	});
	$('triplet' + box_counter).getElements('p.thumbHolder').each(function(thumb) {
		thumb.style.backgroundPosition = '0 -70px';
	});
	$('triplet' + box_counter).getElement('div.current' + thumb_counter).style.display = 'block';
	$('triplet' + box_counter).getElement('p.tri_thumb' + thumb_counter).style.backgroundPosition = '0 0';
}

function verifyForm(oForm) {
	var note_phone = oForm.note_phone.value;
	if ('' == note_phone) {
		alert('Please fill in a valid phone number\n');
		return false;
	}
	var phone_exp = /^0\d{1,2}\-?\d{6,10}$/;
	if (!phone_exp.test(note_phone)) {
		alert('Please fill in a valid phone number\n');
		return false;
	}
	return true;
}
/***********************************************

* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)

* This notice MUST stay intact for legal use

* Visit http://http://www.dynamicdrive.com/dynamicindex2/cmarquee2.htm for this script and 100s more.

***********************************************/

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var marqueespeedH=1
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

/* Edited below - to have the scroller move horizontally, instead of vertically -Michal */
var copyspeed=marqueespeed
var copyspeedH=marqueespeedH
var pausespeed=(pauseit==0)? copyspeed: 0
var actualhwidth='';

/* Horizontal marquee */
function scrollHmarquee(){
	if (parseInt(cross_Hmarquee.style.right)>(actualhwidth*(-1)+8)) {
		cross_Hmarquee.style.right=parseInt(cross_Hmarquee.style.right)-copyspeedH+"px" /*move scroller right if scroller hasn't reached the end of its width*/
	}
	else {
		cross_Hmarquee.style.right=parseInt(marqueewidth)+8+"px" /* else, reset to original position*/
	}
	setTimeout(scrollHmarquee, 30);
}

function initializeHmarquee(){
	cross_Hmarquee=document.getElementById("hmarquee");
	if (!cross_Hmarquee) {
		return false;
	}
	cross_Hmarquee.style.top = -1;
	cross_Hmarquee.style.right = 95;
	cross_Hmarquee.onmouseout= function() {
		copyspeedH=marqueespeedH;
	}
	cross_Hmarquee.onmouseover=function() {
		copyspeedH=pausespeed;
	}

	marqueewidth=document.getElementById("hMarqueecontainer").offsetWidth
	actualhwidth=cross_Hmarquee.offsetWidth //width of marquee content (much of which is hidden from view)
	setTimeout(scrollHmarquee, delayb4scroll);
	return true;
}
/* End horizontal marquee */


/* vertical marquee */
function scrollmarquee(){
	if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) {
		cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px" /*move scroller upwards if scroller hasn't reached the end of its height*/
	}
	else {
		cross_marquee.style.top=parseInt(marqueeheight)+8+"px" /* else, reset to original position*/
	}
	setTimeout(scrollmarquee, 30);
}

function initializemarquee(){
	cross_marquee=document.getElementById("vmarquee");
	if (!cross_marquee) {
		return false;
	}
	cross_marquee.style.top = 0;
	cross_marquee.style.right = 0;
	cross_marquee.onmouseout= function() {
		copyspeed=marqueespeed;
	}
	cross_marquee.onmouseover=function() {
		copyspeed=pausespeed;
	}
	marqueeheight=document.getElementById("marqueecontainer").offsetHeight
	actualheight=cross_marquee.offsetHeight //height of marquee content (much of which is hidden from view)
	setTimeout(scrollmarquee, delayb4scroll);
	return true;
}
function stayFixed (sBlock, Xposition, Yposition) {
	var oBlock = document.getElementById(sBlock);
	oBlock.setNewPosition = function(x,y){
		this.style.left=x+"px";
		this.style.top=y+"px";
	}
	window.adjustPosition = function() {
		var pY;
		if (window.innerHeight)
		{
			pY = window.pageYOffset
		}
		else if (document.documentElement && document.documentElement.scrollTop)
		{
			pY = document.documentElement.scrollTop
		}
		else if (document.body)
		{
			pY = document.body.scrollTop
		}
		oBlock.y += (pY + Yposition - oBlock.y)/8;//scrolling from top + given element's top + precedent y.
		oBlock.setNewPosition(oBlock.x, oBlock.y);
		setTimeout("adjustPosition()", 10);
	}
	oBlock.x = Xposition; //static
	oBlock.y = Yposition;
	adjustPosition(); //keep changing
}

function fixSideBannerPosition (Xposition, Yposition) {
	if (document.getElementById('rightBanner')) {
		var oRightBlock = document.getElementById('rightBanner');
		oRightBlock.setNewPosition = function(x,y){
			this.style.left = x + "px";
			this.style.top = y + "px";
		}
	}
	if (document.getElementById('leftBanner')) {
		var oLeftBlock = document.getElementById('leftBanner');
		oLeftBlock.setNewPosition = function(x,y){
			this.style.right = x + "px";
			this.style.top= y + "px";
		}
	}
	window.adjustPosition = function() {
		var pY;
		if (window.innerHeight)
		{
			pY = window.pageYOffset
		}
		else if (document.documentElement && document.documentElement.scrollTop)
		{
			pY = document.documentElement.scrollTop
		}
		else if (document.body)
		{
			pY = document.body.scrollTop
		}
		
		if (document.getElementById('rightBanner')) {
			oRightBlock.y += (pY + Yposition - oRightBlock.y)/8;//scrolling from top + given element's top + precedent y.
			oRightBlock.setNewPosition(oRightBlock.x, oRightBlock.y);
		}
		
		if (document.getElementById('leftBanner')) {
			oLeftBlock.y += (pY + Yposition - oLeftBlock.y)/8;//scrolling from top + given element's top + precedent y.
			oLeftBlock.setNewPosition(oLeftBlock.x, oLeftBlock.y);
		}
		setTimeout("adjustPosition()", 10);
	}
	if (oRightBlock) {
		oRightBlock.x = Xposition; //static
		oRightBlock.y = Yposition;
	}
	if (oLeftBlock) {
		oLeftBlock.x = Xposition; //static
		oLeftBlock.y = Yposition;
	}
	adjustPosition(); //keep changing
}

window.onload = function() {
	if (document.getElementById('rightBanner') || document.getElementById('leftBanner')) {
		fixSideBannerPosition(952, 0);
	}
	

	/* initialize news horizontal scroller */
	initializeHmarquee();
	
	/* initialize side products scroller, if exists */
	if (document.getElementById('marqueecontainer')) {
		initializemarquee()
	}
	
	/* handle side categories if exists and mode = 'box' 
	if (document.getElementById('categoryItems')) {
		var submenus = document.getElementById('categoryItems').getElementsByTagName('ul');
		for (var i = 0;i < submenus.length;i++) {
			if (submenus[i].className == 'submenuBox' && submenus[i].parentNode.className.indexOf('active') < 0) {
				hideBox(submenus[i].id);
			}
		}
	}*/
	
	/* initialize header product ticker if exists */
	if (document.getElementById('hMarqueecontainer2')) {
		var step = 90;
		var stopPoint = (document.getElementById('hMarqueecontainer2').offsetHeight - step)* -1;
		var changeDisplay = setInterval(function() {
			var currentPos = document.getElementById('hMarqueecontainer2').style.top;
			currentPos = 1*currentPos.replace(/px/,'');
			var newPos;
			if (currentPos > stopPoint) {
				newPos = currentPos - step;
			}
			else {
				newPos = 0;
			}
			document.getElementById('hMarqueecontainer2').style.top = newPos + 'px';
		},3000)
	}
	detectIe6 ();
	
	/*Initialize Gallery */
	if (document.getElementById('galleries')) {
		handleGalleryArrows('galleries');
	}
}
