function print_r(theObj){
  if(theObj.constructor == Array ||
     theObj.constructor == Object){
    document.write("<ul>")
    for(var p in theObj){
      if(theObj[p].constructor == Array||
         theObj[p].constructor == Object){
document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
        document.write("<ul>")
        print_r(theObj[p]);
        document.write("</ul>")
      } else {
document.write("<li>["+p+"] => "+theObj[p]+"</li>");
      }
    }
    document.write("</ul>")
  }
}
 


//////////////////////////////////////////////////////////////////////////////////////////////////////

/**
 * jQuery Delay - A delay function
 * Copyright (c) 2009 Clint Helfers - chelfers(at)gmail(dot)com | http://blindsignals.com
 * Dual licensed under MIT and GPL.
 * Date: 7/01/2009
 * @author Clint Helfers
 * @version 1.0.0
 *
 * http://blindsignals.com/index.php/2009/07/jquery-delay/
 */


$.fn.delay = function( time, name ) {

    return this.queue( ( name || "fx" ), function() {
        var self = this;
        setTimeout(function() { $.dequeue(self); } , time );
    } );

};


/*********************
//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/
//* Created: Nov 2nd, 08'
//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
*********************/

//Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs):
//var arrowimages={down:['downarrowclass', 'down.gif', 23], right:['rightarrowclass', 'right.gif']}
var arrowimages={down:['downarrowclass', '/img/1px.gif', 0]}

var jqueryslidemenu={

animateduration: {over: 0, out: 0}, //duration of slide in/ out animation, in milliseconds

buildmenu:function(menuid, arrowsvar){
	jQuery(document).ready(function($){
		var $mainmenu=$("#"+menuid+">ul")
		var $headers=$mainmenu.find("ul").parent()
		$headers.each(function(i){
			var $curobj=$(this)
			$curobj.find("li a").addClass("subinactive")
			if(jQuery.browser.msie && jQuery.browser.version=="6.0"){
				$curobj.find("li a").css({"font": "14px Arial", //"background-color":"black"})
										"padding-left": "10px",
										"padding-right": "8px",
										"margin": "0",
										"min-width": "100px",
										"width": "100%",
										"border": "0px",
										"color": "#34438B",
										"color": "#737373",
										"white-space": "nowrap"})
				$curobj.find("a>hover").css({"background-color" : "green"});
			}
			var $subul=$(this).find('ul:eq(0)')
			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
			this.istopheader=$curobj.parents("ul").length==1? true : false
			
			$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
			$curobj.children("a:eq(0)")//.css(this.istopheader? {} : {}).append('')
			$curobj.hover(
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					this._offsets={left:$(this).offset().left, top:$(this).offset().top}
					var menuleft=this.istopheader? 0 : this._dimensions.w
					menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
					//$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+"px"})(
					//$targetul.delay(500)(
						$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+"px"}).slideDown(jqueryslidemenu.animateduration.over)
					//)

					//)
//			//$targetul.setTimeout(function() { 
//			//	$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+"px"}).slideDown(jqueryslidemenu.animateduration.over)
//			// }, 500);

		$curobj.find("a.tlevel").addClass("active")//ставим выделение родителя



				},
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					$targetul.slideUp(jqueryslidemenu.animateduration.out)
		$curobj.find("a.tlevel").removeClass("active") //удаляем выделение родителя
				}
			) //end hover
		}) //end $headers.each()
		$mainmenu.find("ul").css({display:'none', visibility:'visible'})
	}) //end document.ready
}
}

//build menu with ID="myslidemenu" on page:


jqueryslidemenu.buildmenu("myslidemenu", arrowimages)
/*
$.each(jQuery.browser, function(i, val) {

	//alert(i+' - '+val);
    });

//if(jQuery.browser.msie && jQuery.browser.version=="6.0")alert("MAIE!");
*/
