
	
	// ---------------------------------------------------------------------
	// string.trim (our own language addition)
	// ---------------------------------------------------------------------
	if (String.prototype.trim == null) {
		String.prototype.trim = function() {
			return this.replace(/^\s+|\s+$/, '');
		};
	}
	
	
	
	// Show/Hide a DIV using the classes ".show" & ".hide"
	function ShowHide(sDIVID)
	{
		var sClass = "";
		
		switch (document.getElementById(sDIVID).className)
		{
			case "hide":
				sClass = "show";
				break;
			default:
				sClass = "hide";
				break;
		}
		document.getElementById(sDIVID).className = sClass;
	}
	
	
	
	/****************************************************************/
	/***  LIBRARY FUNCTIONS										  ***/
	/****************************************************************/
	
	// Open new window in full-screen mode
	function OpenFullScreenWindow(url, options) {
	  var winOptions = '';
	  switch (options)
	  {
		case 'scroll':
		  winOptions = 'directories=no, menubar=no, status=no, toolbar=no, scrollbars=yes';
		  break;
		  
		default:
		  winOptions = 'directories=no, menubar=no, status=no, toolbar=no';
	  }
	  
	  var newWin = window.open(url, 'newWindow', winOptions + ", height=" + screen.height + ", width=" + screen.width);
	  newWin.moveTo(0,0);
	  newWin.focus();
	  return false;
	}
	
	// Print current page
	function PrintPage()
	{
		window.print();
	}
	
	
	// ---------------------------------------------------------------------
	// Cookies
	// ---------------------------------------------------------------------
	
	 /**
	 * @name cc.cookie.set
	 * @desc Set a cookie
	 * @param String name The name of the cookie.
	 * @param String value The value of the cookie.
	 * @param Hash options A set of key/value pairs for optional cookie parameters.
	 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
	 * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
	 * If set to null or omitted, the cookie will be a session cookie and will not be retained
	 * when the the browser exits.
	 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
	 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
	 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
	 * require a secure protocol (like HTTPS).
	 */
	 function SetCookie (name, value, options) {
		options = options || {};
		var expires = '';
	
		options.expires = options.expires || 356;
	
		var date = new Date();
		date.setTime(date.getTime()+(options.expires*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	
		var path = options.path ? '; path=' + options.path : '';
		var domain = options.domain ? '; domain=' + options.domain : '';
		var secure = options.secure ? '; secure' : '';
		document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
	 }
	
	 /**
	 * @name cc.cookie.get
	 * @desc Get the value of a cookie
	 * @param String name The name of the cookie.
	 * @return The value of the cookie.
	 * @type String
	 */
	 function GetCookie (name) {
		var cookieValue = null;
		if (document.cookie && document.cookie != '') {
			var cookies = document.cookie.split(';');
			for (var i = 0; i < cookies.length; i++) {
				var cookie = cookies[i].trim();
				// Does this cookie string begin with the name we want?
				if (cookie.substring(0, name.length + 1) == (name + '=')) {
					cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
					break;
				}
			}
		}
		return cookieValue;
	 }

	 /**
	 * @name cc.cookie.remove
	 * @desc Delete a cookie
	 * @param String name The name of the cookie.
	 */
	 function DeleteCookie (name) {
		SetCookie(name, "", {expires: -1});
	 }
	
	
	function setBodyFontSize(size) {
		$("#content").css("font-size", size + "%");
	}
	
	
	function newWindow(popup) {
		bookWindow = window.open(popup, 'bookwin', 'width=450,height=200')
		bookWindow.focus()
	}	
function newWindow3(popup) {
		snapshot = window.open(popup, 'snapshot', 'width=500,height=500')
		snapshot.focus()
	}
function newWindowMovie(popup,title) {
		movieWindow = window.open(popup+'&title='+title, 'movieWindow', 'height=320, width=400')
		movieWindow.focus()
	}
	
	/*///////////////////////////////////////////////////////////////////
	Function to open a movie in a popup
	Param:	movieName - Relative url to the movie
	///////////////////////////////////////////////////////////////////*/
	function fnOpenMovie (movieUrl) {
			var win=window.open('','mywindow','height=256, width=320');
			win.document.write('\x3Chtml\x3E\x3Chead\x3E\x3Ctitle\x3EVideo Window\x3C/title\x3E\x3Cstyle\x3Ehtml,body {margin:0;padding:0;}\x3C/style\x3E\x3C/head\x3E\x3Cbody\x3E\x3Cembed src=\''+movieUrl+'\' width=\'320\' height=\'256\' autoplay=\'true\' controller=\'true\' type=\'video/quicktime\' scale=\'tofit\' pluginspage=\'http://www.apple.com/quicktime/download/\'\x3E \x3C/embed\x3E\x3C/body\x3E\x3C/html\x3E');
			return false;
	}
	

