/**
	Some logic
*/
function attach_tab_behavior(links, listItems, activeClassName)
{
	$( links ).attr({"href": "javascript:;"}).click(function () {
		$( listItems ).removeClass( activeClassName );
		$(this.parentNode).addClass( activeClassName );
	});
}
function hasClass(element, classname)
{
	var names = element.className.split(' ');
	for (var i=0; i < names.length; i++) {
		if (classname == names[i])
			return true;
	}
	return false;
}
/**
	Events & Behavior attachment
*/
$(document).ready(function ()
{
	if ($.browser.msie && $.browser.version == "6.0") {
		$("#nav li.toplevel").mouseover(function() {
			$(this).addClass("hover");
		}).mouseout(function() {
			$(this).removeClass("hover");
		});
		$("#nav li.katalog").mouseover(function() {
			$("#nav a.toplevel").addClass("hover");
		}).mouseout(function() {
			$("#nav a.toplevel").removeClass("hover");
		});
	}


	attach_tab_behavior("#poll ul a", "#poll li", "checked");

	attach_dropdown_behaviors();

	$("div.textinput input").each(function() {
		if ($.browser.safari && navigator.appVersion.indexOf("1.0") > -1
				|| $.browser.safari && navigator.appVersion.indexOf("2.0") > -1) {
			// alert(navigator.appVersion)
			var width = ($(this).width()+6)+"px";
			$(this).css({
				"top": "-4px",
				"left": "-3px",
				"width": width,
				"height": "auto"
			});
		}
		if ($.browser.msie) {
			$(this).focus(function() {
				$(this).css({"top": "0"});
			});
		}
	});
});


function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=660,height=820,screenX=250,screenY=150,top=150,left=150')
}


function clickStat( type, typeID, blockID ){
/*
  $.ajax({
     type: "POST",
     url: "http://"+document.domain+"/ajax/clickstat",
     async: false,
     data: "section=true&type="+type+"&typeID="+typeID+"&blockID="+blockID
  });
*/
}














