function Clickheretoprint()
{

	var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
      	disp_setting+="scrollbars=yes,width=700, height=600, left=100, top=25";
  	var content_vlue = document.getElementById("mot_content").innerHTML;
	
    var content_header = jQuery(".mot_ContentHeader").html();
	//remove all classes and IDs and styles
	
	// removing flash object
	content_vlue = content_vlue.replace(/<(object|OBJECT|script|SCRIPT) .*?>(.*?)<\/(object|OBJECT|script|SCRIPT)>/g,'');
	
	// removing all the images inside the article
	content_vlue = content_vlue.replace(/<(IMG|img) .*?>/g,'');
	
	// removing all the classes and styling
	content_vlue = content_vlue.replace(/(class|id|style)=("|')((.)*?)('|")/g,'');
	
	// -- PREVIOUSLY the IMAGE will be changed to [IMAGES: `title`
	// if (iTags){
	// trace("dsadAS");
	// for(i=0; i<iTags.length; i++){
    // var iSrc = iTags[i].match(/title=["'][^"']+["]/);
    // a= iSrc.toString().replace('"',' ').replace('title=',' ').replace('"','');
	// iTags[i] = a;
	// content_vlue = content_vlue.replace(/<IMG .*?>/,'[IMAGES: ' +iTags[i] +']');
	// }
	// }

	
	
	var docprint=window.open("","",disp_setting);
   	docprint.document.open();
   	docprint.document.write('<html><head><title>MOT</title>');
   	docprint.document.write('</head><body onLoad="self.print()"><div id="content">');
   	docprint.document.write('<b>' + content_header + '</b><br><hr>');
   	docprint.document.write(content_vlue);
	docprint.document.write('</div><div class="clear">&nbsp;</div><hr>');
   	docprint.document.write('<div>This is a Printer Friendly Page. It is not accessible according to WCAG standards.</div></body></html>');
   	docprint.document.close();
   	docprint.focus();
}


function Clickheretoemail()
{
	u = window.location;
	m = "Interesting Article in MOT corporate website";
	pagetitle = "Hi,%0A%0AI came across an interesting article in MOT corporate website.%0A%0AThe URL is ";
	window.location = "mailto:email@domain.com?subject="+m+"&body="+pagetitle+": "+u;	
}
function bookmark_us(url, title){

if (window.sidebar) // firefox
    window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click();
}
else if(document.all)// ie
    window.external.AddFavorite(url, title);
}

  jQuery(document).ready(function() {
	//table style
	  jQuery('table.tb1 tbody tr:odd').addClass('odd');
	  jQuery('table.tb1 tbody tr:even').addClass('even');
	   jQuery('table.tb2 tbody tr:odd').addClass('odd');
	  jQuery('table.tb2 tbody tr:even').addClass('even');
	  jQuery('table.xtb2 tbody tr:odd').addClass('odd');
	  jQuery('table.xtb2 tbody tr:even').addClass('even');
	 //HOVER for RSS and Bookmark
	 jQuery('#mot_header_Bookmark').hover(function() {
				jQuery(this).attr("src","/images/mot/mot_starBookmark_hover.gif");
		},
		function(){
			jQuery(this).attr("src","/images/mot/icon_bookmarkthispage.gif");
		});
		
		jQuery('#mot_header_RSS').hover(function() {
				jQuery(this).attr("src","/images/mot/mot_icon_rssHover.gif");
		},
		function(){
			jQuery(this).attr("src","/images/mot/mot_icon_rss.gif");
		});
		
		jQuery('#mot_header_RateWebsite').hover(function() {
				jQuery(this).attr("src","/images/mot/mot_rateWebsite_hover.gif");
		},
		function(){
			jQuery(this).attr("src","/images/mot/mot_rateWebsite.gif");
		});
		
		
	//Bookmark
	jQuery('#mot_header_Bookmark').click(function() { 
		bookmark_us("http://www.mot.gov.sg","Ministry of Transport - Singapore Government");
	});
		
});


function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return "";
}

function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) +
	((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
}

var sitefunctions = {
    textresize: function() {
        // show text resizing links
        var $cookie_name = "MOTFontSize";
        var originalFontSize = jQuery("body").css("font-size");
        // if exists load saved value, otherwise store it
        if (getCookie($cookie_name)) {
            var $getSize = getCookie($cookie_name);
            jQuery("body").css({ fontSize: $getSize + ($getSize.indexOf("px") != -1 ? "" : "px") }); // IE fix for double "pxpx" error
        } else {
            setCookie($cookie_name, originalFontSize);
        }
        // reset link
        jQuery(".FontSizeReset").bind("click", function() {
            jQuery("body").css("font-size", originalFontSize);
            setCookie($cookie_name, originalFontSize);
        });
        // text “+” link
        jQuery(".FontSizeInc").click(function() {

            var currentFontSize = jQuery("body").css("font-size");
            var currentFontSizeNum = parseFloat(currentFontSize, 10);
            if (currentFontSizeNum < 18) {
                var newFontSize = currentFontSizeNum * 1.1;
                if (newFontSize, 11) {
                    jQuery("body").css("font-size", newFontSize);
                    setCookie($cookie_name, newFontSize);
                }
            }
            return false;
        });
        jQuery(".FontSizeDec").bind("click", function() {
            var currentFontSize = jQuery("body").css("font-size");
            var currentFontSizeNum = parseFloat(currentFontSize, 10);
            if (currentFontSizeNum > 9) {
                var newFontSize = currentFontSizeNum * 0.9;
                if (newFontSize, 11) {
                    jQuery("body").css("font-size", newFontSize);
                    setCookie($cookie_name, newFontSize);
                }
            }
            return false;
        });
    }
}


jQuery(document).ready(function() {
    sitefunctions.textresize();
    
    if(document.title.substring(0, 21) != 'Ministry of Transport') 
    {
        document.title = 'Ministry of Transport - ' + document.title;
    }
    
    
})

jQuery(window).load(function() {
	jQuery("#mot_content").find(".mot_imgLeft, .mot_imgRight").each(function() {
        //getting the image's width
        w = jQuery(this).width();
        //getting the image's height
        h = jQuery(this).height();
        //To resize the height of the shadow proposionally
        p = w/349 * 22;
        
        //Get the class
        c = jQuery(this).attr("class");
        //remove the class from the image
        jQuery(this).removeAttr("class");
        
        //add a wrapper elements as well as the shadow images.
        jQuery(this).wrap("<div class='"+c+"' style='width:"+w+"px;z-index:1' >").parent()
        .append("<br><img width='"+w+"' height='"+p+"' src='/DATA/0/images/mot_content/photo_bottomShadow1.jpg' alt='image shadow' />");  
    })
    
    //Add the clear float element at the end of contents to make sure all the floats are cleared.
    jQuery("#mot_content").append("<div class='clear'>&nbsp;</div>");

})

           
<!-- ------------------- Accordion js Starts ----------------------- -->                    

//Cotnet slider 
jQuery (document).ready(function(){
                $(".accordion_link > li").each(function() {
			if ($("ul",this).length > 0) {
				$("ul",this).parent().addClass("parent");
				$("ul",this).addClass("submenu").css({width:$(this).parent().innerWidth()})
				
				$("ul",this).hide();
			}
		})
		
		$('.accordion_link .parent > a').click(function() {
			$(this).css('outline','none');
			if ($(this).parent().hasClass("active")) {
				$(this).next(".submenu").animate({height: "toggle"}, 750,"easeInQuad");
				$(this).parent().removeClass("active");
			}
			else {
				$(this).parent().siblings(".active").find(".submenu").animate({height: "toggle"}, 750,"easeInQuad");
				$(this).next(".submenu").animate({height: "toggle"},750,"easeOutQuad");
				$(this).parent().siblings(".active").removeClass("active");
				$(this).parent().addClass("active");
			}
			return false;
		});
                jQuery(".accordion_mot div").hide();

                jQuery (".accordion_mot h3").click(function(){
                                jQuery (this).next("div").slideToggle("slow")
                                .siblings("div:visible").slideUp("slow");
                                jQuery (this).toggleClass("active");
                                jQuery (this).siblings("h3").removeClass("active");
                });
				
				
Collections =
[
	["within this website", "mot"] ,
	["within all government websites", "default"]
]

	function sendQuery() {
	var index = document.getElementById("Select1").selectedIndex;
	//var a = document.getElementById("Text1").value;
	var a = document.getElementById("ctl00_Header1_Text1_text").value;
	var b = Collections[index][0];
	var b1 = Collections[index][1];
	var c = "mot";
	b=b.split(' ').join('+');
	var d = "http://sgms.internet.gov.sg/Search.aspx?q="+a+"&site="+c+"&filter_s="+b+"%23"+b1;
	window.open(d);
}

		//Catching Enter Key
//jQuery('#Text1').keypress(function(e) {
jQuery('#ctl00_Header1_Text1_text').keypress(function(e) {
        var code = (e.keyCode ? e.keyCode : e.which);  
        
        if(code == 13) {      
			e.preventDefault();
			sendQuery();

			
		}
 
    });

				
	

});

<!--------------------- Accordion js Ends ------------------------->
