/* To remove the right border of the last child of the menu bottom menus*/
document.observe("dom:loaded", function(){
    $$('div.footer_menu>ul>li:last-child>a').each(function(element){
        element.setStyle({
            border: 'none'
        });
    });
    $$('div.header_top_right>ul>li:last-child', '.article_content_menu ul li:last-child').each(function(element){
        element.setStyle({
            background: 'none'
        });
    });
});

$$("div.header_menu>ul>li>a").invoke('observe', 'mouseover', function(evt){
    active_name = Event.element(evt);
    active_li_element = active_name.up('li');
    var active_tab = $$('div.header_menu>ul>li.active')[0]
    activetab(active_tab);
    active_li_element.addClassName("active")
});

$$("div.header_menu>ul>li>a").invoke('observe', 'mouseout', function(evt){
    active_name = Event.element(evt);
    active_li_element = active_name.up('li');
    active_li_element.removeClassName("active")
    if (active_tab != "" && !Object.isUndefined(active_tab)) {
        active_tab.addClassName("active")
    }
})

function activetab(tab){
    active_tab = tab;
}

$$("div.header_top_right>ul>li>a.search").invoke('observe', 'click', function(evt){
    $('header_search').toggle();
});


/* script to make equal height of coloums */
Event.observe(window, 'load', function(){
    $$('.block_parent').each(function(parent_element){
        var child_elements = parent_element.getElementsBySelector('.block_child')
        var max_height = child_elements.collect(function(child_element){
            return child_element.offsetHeight;
        }).toArray().max()
        child_elements.invoke("setStyle", {
            height: max_height + 'px'
        })
    });
});

function printPreview1(){
	bodyText1 = $('.container_blogs_left')[0].innerHTML;
    //bodyText2 = $('.article_content_block')[0].innerHTML;
    //    //bodyText2 = stripScripts(bodyText2);
    //        myWin = open("", "displayWindow", "status=yes,toolbar=no,menubar=no,scrollbars=yes,width=900");
    //            myWin.document.open();
    //                myWin.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> ");
    //                    myWin.document.write("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">");
    //                        myWin.document.write("<head>");   
    //                        	myWin.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html\" />");
    //                        	    myWin.document.write('<meta name=\"DCSext.incisive_pagetype\" content=\"print\" />');
    //                        	        myWin.document.write("<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />");
    //                        	            myWin.document.write("<title>Paras</title>");
    //                        	                myWin.document.write("</head>");
    //                        	                    myWin.document.write("<body>");
    //                        	                        myWin.document.write("<div class=\"static_page\">");
    //                        	                            myWin.document.write("<a href=\"#\" onclick=\"window.print();window.close();\" class=\"print_link\">Print </a>");
    //                        	                                myWin.document.write(" | ");
    //                        	                                    myWin.document.write("<a href=\"#\" onclick=\"window.close()\" class=\"print_link\">Close</a>");
    //                        	                                        myWin.document.write("</div>");
    //                        	                                            myWin.document.write("<img src=\"/images/paras-logo.jpg\" alt=\"Logo\" class=\"show_for_print\" title=\"Logo\" />");
    //                        	                                                myWin.document.write(bodyText1);
    //                        	                                                    //myWin.document.write(bodyText2);
    //                        	                                                        myWin.document.write("<div class=\"static_page\">");
    //                        	                                                            myWin.document.write("<a href=\"#\" onclick=\"window.print();window.close();\" class=\"print_link\">Print</a>");
    //                        	                                                                myWin.document.write(" | ");
    //                        	                                                                    myWin.document.write("<a href=\"#\" onclick=\"window.close()\" class=\"print_link\">Close</a>");
    //                        	                                                                        myWin.document.write("</div>");
    //                        	                                                                           
    //                        	                                                                               myWin.document.write("</body>");
    //                        	                                                                                   myWin.document.write("</html>");
    //                        	                                                                                       myWin.document.close();
    //                        	                                                                                       }
    //
    //

