function loadContent(nameFile, nameDiv, callBack, ajaxLoading) {
	if(ajaxLoading != "")
		ajaxLoading = "<img src='" + shop.url + "/ecommerce/images/icons/"+ajaxLoading+"'>";
	if($(nameDiv+'Floater'))$(nameDiv+'Floater').style.top = 30+ (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + 'px';
	loadAjaxFile(nameFile, nameDiv, callBack, ajaxLoading);
}

function closeContent(){
	$('informationBox').innerHTML = '';
	$('informationBox').style.visibility = 'hidden';
}

function submitForm(form, divId, callBack, imageLoading){
	if(imageLoading)
			document.getElementById(divId).innerHTML = "<img src='" + shop.url + "/ecommerce/images/icons/"+imageLoading+"'>";
	Spry.Utils.submitForm(form, function(req){document.getElementById(divId).innerHTML = req.xhRequest.responseText; eval(callBack);} );
}

function initScrollCategoriesLook(step){
	var divId = "indexCategoriesLookContent";
	getWidth(divId);
	interval_IDCategoriesLook = setInterval('startScrollCategoriesLook("'+divId+'",'+step+');',15);
}


function startScrollCategoriesLook(divID, step){
	var the_style = getStyleObject(divID);
	if (the_style)
  {
 		if(the_style.left != "")var current_left = parseInt(the_style.left);
		else var current_left = 0;
		
		var new_left = current_left + step;
		if(step > 0 && current_left < 0 ){ 
			if (document.layers) the_style.left = new_left;
			else the_style.left = new_left + "px";
		} 
		if(step < 0 && current_left >= (-maxWidth + (maxWidthMenuTabs))){
			if (document.layers) the_style.left = new_left;
			else the_style.left = new_left + "px";
		}
  }
}

function stopScrollCategoriesLook(){
	clearInterval(interval_IDCategoriesLook);
}

function loadCategory(obj){
	
	if(obj.value.length)
		window.location.href = obj.value;
}

/*var menuCategoriesTimeout;
function showSubCategories(categoryId, classDiv){
	contineSubCategoriesInTimeout();
	hideSubCategories();
	
	$('subCategories'+categoryId).className = classDiv;
	$('category'+categoryId).className = 'categoriesMenuActived';
	$('category'+categoryId+'Link').className = 'categoriesMenuActived';
}

function hideSubCategories(){
	$$('.categoryMenuBoxVisibleLeft').each(function(el){el.className = 'categoryMenuBox';});
	$$('.categoryMenuBoxVisibleRight').each(function(el){el.className = 'categoryMenuBox';});
	$$('.categoriesMenuActived').each(function(el){el.className = 'categoriesMenu';});
}

function hideSubCategoriesInTimeout(timeout){
	if(!timeout) timeout = 2000;
	menuCategoriesTimeout = setTimeout('hideSubCategories()', timeout);
}
function contineSubCategoriesInTimeout(){
	clearTimeout(menuCategoriesTimeout);
}

$(window).addEvent('click', function(){contineSubCategoriesInTimeout();hideSubCategoriesInTimeout(1);});
*/


function changeClass(obj, nameClass, nameClass2){
	if(obj.className == nameClass) obj.className = nameClass2;
	else obj.className = nameClass;
}

function restartShadowbox(){
	Shadowbox.setup(); 
}

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

