
	/*
	 * common routines
	 * org.home.kamara.dev 20080517
	 */
	
	/*
	 * The starting routine is attached to the
	 * page including the script.
	 */
	window.onload = startUp;
	
	
	/*
	 * this function is called at body.onLoad, so
	 * if there is a function that needs to be
	 * executed everytime a page is loaded, it
	 * should be called here.
	 */
	function startUp() {
		
		// new ElementMaxHeight();
		
		// correctExternalLinks();
		// $('#jscroll').jScrollPane({animateTo:true}); // need jquery.mousewheel.js && jquery.scrollPane.js

		$("#timehome").slideToggle();
		
	}
	
	
	/*
	 * forces the external links to open in a new
	 * window, in a manner that validates against
	 * XHTML Strict. This last one does not allow
	 * 'target="_blank"' anymore, but the DOM does.
	 */
	function correctExternalLinks() {
		// run through every a tag in the document
		var serverName = window.location.hostname;
		for (var index = 0; index <= (document.links.length - 1); index++) {
			var URL = document.links[index].href;
	
			// any links not containing the current server name are outbound.
			if (URL.indexOf('javascript') != 0) {
				if (URL.indexOf(serverName) < 0)
					document.links[index].target = "_blank";
				else
					document.links[index].target = "";
				// set link for IE no-cache
				if (URL.indexOf('?') > -1 && URL.indexOf('#') < 0) {
					document.links[index].href = document.links[index].href + "&_dc=" + (new Date).getTime();
				}
			} else {
				document.links[index].target = "";
			}
		}
		
		return true;
	}

	



	/* Modified to support Opera */

	function bookmarkpage() {
	
		var title = document.title;
		var url = document.URL;
		
		var ver = navigator.appName;
		var num = parseInt(navigator.appVersion);
		
		if ((ver == "Microsoft Internet Explorer") && (num >= 4)) {
			window.external.AddFavorite(url, title);
		} else  {
			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);
			}
		}
	}

	
	function mailpage() {
		var mail_str = "mailto:mail_destinatario@dominio.com?subject=" + document.title;
		mail_str = mail_str + "&body=" + "Le han recomendado el siguiente website: "+document.title+" (http://www.madridmastersgolf.com).";
		location.href = mail_str;
	}
	
	function sendMailTo(name, company, domain, subject, body) {
		name = 'mail_destinatario'; company = 'dominio'; domain = 'com';
		subject = document.title;
		body = "Le han recomendado la siguiente página: " + unescape(document.title) +" ("+ unescape(document.URL) +").";
	   locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + domain + "?subject=" + (subject) + "&body=" + (body);
	   window.location.replace(locationstring);
   }

	
	function mailpage2() {
		var subject = document.title;
		var body = escape('Le han recomendado la siguiente web: ')+document.title+' ('+document.URL+').';
		location.href = 'mailto:mail_destinatario@dominio.com?subject='+subject+'&body='+body;
	}


	function openWindow(strUrl, strWindowName, strWindowFeatures){
	    windowName = strWindowName;
	    if (windowName == null)
	       windowName = '';
	
	    if (strWindowFeatures != null) {
	       window.window.open(strUrl, windowName, strWindowFeatures);
	    } else {
	      window.window.open(strUrl, windowName, 'location=0,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1,fullscreen=0,width=600,height=450');
	    }
	}

	
	