// JavaScript Document

/**
 * Link Matches
 *
 * These are applied to each link during onLoad and the appropriate event
 * is attached to the link.
 */

(function(){
	/**
	 * Link object format
	 * obj.expression -> a regular expression object to match href attribute.
	 * obj.click -> function to be added as an event handler
	 */

	var other = {
		expression : new RegExp('^http://www\.bayer\.com'),
		click : function(evt){
		       return;
		}
	};
	
	var external = {
		expression : new RegExp('^http://.*'),
		click : function(evt){
			alert("You are leaving this Bayer website.\n\nBayer is not responsible for the information on the website to which you are linking");
		}
	};

	/**
	 * Each type of link should be added to the links array in order of importance.
	 * The first matching action will be applied.
	 */

	var links = [other,external];

	$(document).ready(function(){
		$("a").each(function(){
			var href = $(this).attr('href');

			if(href){
				for(var i = 0;i < links.length;i++){
					if(href.match(links[i].expression)){
						$(this).click(links[i].click);
						break;
					}
				}
			}
		});
	});
})();

function setBookmark()
{
bookmarkurl = location.href;
if (document.all) {
window.external.AddFavorite(bookmarkurl,document.title);
} else {
alert('Your Browser does not support this feature');
}
} 

