//on load
jQuery(document).ready(function() {

	function callback(eventObject) {
	  this; // dom element
	}
	
	function callback(eventObject) {
	  this; // dom element
	}
	
	$(document).ready(
		function(){ 
		$("div.contentToToggle").hide();
	});
	
    $("li.navBalkMarketing").click(
      function () {
        $(this).css("background-image", "url(images/icoNavMarketing.png)");
      },
      function () {
        $(this).css({"background-image":""});
      }
    );

    $("li.navBalkMarketing").mouseover(function(){
        $(this).css("background-image", "url(images/icoNavMarketing.png)");
        $("li.navBalkMarketingActive").css({"background-image":""});
    }).mouseout(function(){
       	$(this).css({"background-image":""});
    });

    $("li.navBalkInternet").click(
      function () {
        $(this).css("background-image", "url(images/icoNavInternet.png)");
      },
      function () {
        $(this).css({"background-image":""});
      }
    );

    $("li.navBalkInternet").mouseover(function(){
        $(this).css("background-image", "url(images/icoNavInternet.png)");
        $("li.navBalkInternetActive").css({"background-image":""});
    }).mouseout(function(){
       	$(this).css({"background-image":""});
    });

	
	$("a.toggleclick").click( function(){ 
			$("div.contentToToggle").slideToggle("slow", function(){
			 	rePositioning_balk(); 
			 }); 
    });
	
	
    // call method when dom is loaded. 
    rePositioning_balk(); 
	
	jQuery.each(jQuery.browser, function(i, val) {
	  if(i=="mozilla" && jQuery.browser.version.substr(0,3)=="1.9") {
     	$("#navOne li").css({"padding-right":"9px"});
     	$("#navTwo li").css({"padding-right":"2px"});
     	$("li.last").css({"padding-right":"0px"});
     	$("#navOne li.last").css({"padding-left":"1px"});
		}
	});
});

	// Reposition Method 
	function rePositioning_balk() { 
	//alert("balk:"+jQuery('#balk').height()+ "  - content:"+jQuery('#content').height());
        if ((jQuery('#content').height() + 154) < $(window).height()) {
        	jQuery('#balk').css('height','100%');
        } 
        if (jQuery('#balk').height() < (jQuery('#content').height() + 62)) { 
        	jQuery('#balk').css('height',jQuery('#content').height() + 217);
        }
        if((jQuery('#content').height() + 154) > $(window).height()) {
        	jQuery('#balk').css('height',jQuery('#content').height() + 217);
        }
	} 
