$(document).ready(function(){ // по завершению загрузки страницы
	
	$('#navcontainer ul li').each(function(){
    if(($(this).attr('href')=='/catalog/2.html')) {
		$(this).addClass('parentsub');
	}
  });
	
	var url = location.href;
	var regV = /catalog\/2/gi;
	var result = url.match(regV);
	if (result) {
	$('#navcontainer ul.submenu').show();
	
	
	} else {
	
	$('#navcontainer ul a').each(function(i){
    $(this).click(function(){
		//alert(i);
		$(this).parent("li").toggleClass('expand');
		$(this).parent("li").children("ul").slideToggle("slow");
		if (     ($(this).parent("li").children("ul").html() != null) /*|| ($(this).parent("li").children("ul").attr("class")=="expand") */  ) {  return false;
		 } else {   return true;   }
		
})});
		    $('#navcontainer ul.submenu').hide();
	}
	//alert (location.href);
	/*/$(".content").load("www.internet-technologies.ru/articles/article_1382.html");
			
		$.post("http://sevevrodrive/rss-reader.php", function(data){
		    //alert(data);
			$('#example').html('');
            $(data).find('item').each(function(i){       // заполняем DOM элемент данными из XML
				if (i < 3) {
					$('#example').append('<div class="onenews"><span style="margin-left: 16px;" class="legend">'+ $(this).find('pubDate').text() + '</span><p><b>'+ $(this).find('title').text() + '</b></p><div><img src="images/pfeil_vor_hoch.gif"><a href="' + $(this).find('guid').text() + '">Подробнее</a></div></div>');
				}
				i+=1;
            });
             			
			// $(data).find(".lastUpdated").each(function){
			//	alert("Data Loaded: "+$(this).text());
			// });
			 
		
		});	*/
		
		setStyle();
		$(window).resize(function(){
			setStyle();
		});
		 
});
function setStyle() {
		var wmax = $("body").width();
		//alert(w);
		if (wmax < 1080) { 
			wmax = 1080;
		//	$("html").width(wmax);
		}
		var wcontent =  wmax - 480;
		$("#schachtel").width(wcontent+17);
		$("#soheissich").width(wcontent+20+20);
		$("#wodubist").width(wcontent+240+20);
		$("#linkleiste").width(wcontent+240+20-1);
		
		
		
}

function showfile(filename, width, height)
{
window.open("/files/swf/"+filename,"showfile","toolbar=no,directories=no,menubar=no,scrollbars=no,resizable=yes,status=no,width=" + width + ",height=" + height)
}

