<!--




$(document).ready(function(e){
    MSDropDown.init("#lang");
    MSDropDown.init("#groups");
 	/*try{
 		MSDropDown.init("#lang");
 	}catch(e){
 		alert(e);
 	}*/
});








function NewProducts(direction){
	
	newproductsnum = newproductsnum + direction;
	if (newproductsnum >= newproductscount) 	newproductsnum = 0;
	if (newproductsnum < 0) 					newproductsnum = newproductscount - 1;		
	$('#newproductsleft').html(newproducts[newproductsnum]);
	
	var newproductsnumright = newproductsnum + 1;
	if (newproductsnumright >= newproductscount) 	newproductsnumright = 0;
	$('#newproductsright').html(newproducts[newproductsnumright]);
}




function CheckStylesOwen(){
	
	$(".TABLE_striped").find("tr:odd").addClass('bgcolor2');
	$(".TABLE_striped tr").find("td:last").css('border-right', '0');
	
	$(".TABLE_images").find("tr:odd").addClass('bgcolor2');
	$(".TABLE_images").wrap('<table cellpadding="0" cellspacing="0" width="100%"><tr><td style="border:5px solid #d1d8db;"></td></tr></table>');		

	//$(".TABLE_simple tr").find("td:last").css('border-right-width', '0px');
	//$(".TABLE_simple tr:last").find("td").css('border-bottom-width', '0px');	
	
	$(".IMAGE_border").wrap('<table cellpadding="0" cellspacing="0"><tr><td style="border:10px solid #d1d8db;"></td></tr></table>');	

	$(".TABLE_device a").css("margin-right", "7px");

	
	
	/*
	
	$("#maincontent img").each(function(){	
		if ($(this).css('float') == 'right')			$(this).css('margin', "0 0 6px 6px");
        else if ($(this).css('float') == 'left') 		$(this).css('margin', "0 6px 6px 0");
	});	
	
	$(".comments").before('<div style="padding:10px 15px 6px;"><table cellpadding="0" cellspacing="0" width="100%"><tr><td style="border-bottom:#534544 dotted 1px;"><img src="/img/spacer.gif" alt="" width="1" height="1" /></td></tr></table></div>');	
	$("h2").after('<div style="padding:10px 0 10px; z-index:0;"><table cellpadding="0" cellspacing="0" width="100%"><tr><td style="border-bottom:#b7041a solid 3px;"><img src="/img/spacer.gif" alt="" width="1" height="1" /></td></tr></table></div>');		
	$("h3").after('<div style="padding:0 0 8px;"><table cellpadding="0" cellspacing="0" width="100%"><tr><td style="border-bottom:#b7041a solid 1px;"><img src="/img/spacer.gif" alt="" width="1" height="1" /></td></tr></table></div>');*/


	var tables = $(".TABLE_image_text");
	for (var i=0; i<tables.length; i++){
		var table = tables[i];
		var pic = $(table).find("img:first");

	   $(table).attr("width", pic.attr("width"));
	   $(table).find("td").eq(1).css('padding', '3px 14px 8px');
	}
}





function MainCatalogLev1(id){
	
	$(".maincatalog-tr").show();
	$(".maincatalog-trselected").hide();
	
	$("#tr"+ id).hide();
	$("#trselected"+ id).show();
	
	$(".maincatalog_lev2").hide();
	$("#lev2"+ id).show();
}



function MainCatalogLev2(parentid, id){
	
	var hsearch = $("#lev2"+ parentid);
	var curtd = $(hsearch).find("#lev2td"+ id);
	
	
	
	if ($(curtd).find("#lev2trname"+id).css("display") == "none"){
		$(hsearch).find("td").removeClass('mouseover-on');
		$(hsearch).find("td").removeClass('lev2headeron');
		$(hsearch).find(".lev2trname").hide();
		
		curtd.addClass('mouseover-on')
			 .find(".maincatalog-lev2-header").addClass('lev2headeron');
		
		$(hsearch).find("#lev2trname"+ id).show();
		
		var location = document.location.href;
		
		if (location.indexOf("#topcatalog") + 1)   	document.location = location;
		else										document.location = location +'#topcatalog';
		
	}else{
		curtd.removeClass('mouseover-on')
			 .find(".maincatalog-lev2-header").removeClass('lev2headeron');
		
		$(hsearch).find("#lev2trname"+ id).hide();
	}
}





function SelectDealers(obj, name) {

    if (name == 'country') {
        $("select.cityclass").val('');
        
        $("#dealers").find("div[class=country]").show();
        $("select.cityclass").hide();
        $("select[name="+ $("select[name=country]").val() +"]").show();
        
        if ($("select[name=country]").val())    $("#dealers").find("div[class=country][mytitle!="+ obj.value +"]").hide();
        else                                    $("select[name=city]").hide();
        
        $("#dealers").find("div[class=city]").show();  
    } else {
        $("#dealers").find("div[class=city]").show();
        if (obj.value)  $("#dealers").find("div[class=city][mytitle!="+ obj.value +"]").hide();   
    }
}






// -->