
if(!String.trim)String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
var DHTMLSuite_funcs = new Object();
if(!window.DHTML_SUITE_THEME)var DHTML_SUITE_THEME = 'blue';
if(!window.DHTML_SUITE_THEME_FOLDER)var DHTML_SUITE_THEME_FOLDER = 'oggetti/themes/';
if(!window.DHTML_SUITE_JS_FOLDER)var DHTML_SUITE_JS_FOLDER = 'oggetti/js/separateFiles/';


/************************************************************************************************************
*
* Global variables
*
************************************************************************************************************/

	// {{{ DHTMLSuite.createStandardObjects()
/**
 * Create objects used by all scripts
 *
 * @public
 */

var DHTMLSuite = new Object();

var standardObjectsCreated = false;	// The classes below will check this variable, if it is false, default help objects will be created
DHTMLSuite.eventEls = new Array();	// Array of elements that has been assigned to an event handler.

var widgetDep = new Object();
	// Widget dependencies

widgetDep['tabView'] = ['dhtmlSuite-tabView.js','dhtmlSuite-dynamicContent.js','ajax.js'];


var depCache = new Object();

DHTMLSuite.include = function(widget)
{
	if(!widgetDep[widget]){
		alert('Cannot find the files for widget ' + widget + '. Please verify that the name is correct');
		return;
	}
	var files = widgetDep[widget];
	for(var no=0;no<files.length;no++){
		if(!depCache[files[no]]){
		    document.write('<' + 'script');
		    document.write(' language="javascript"');
		    document.write(' type="text/javascript"');
		    document.write(' src="' + DHTML_SUITE_JS_FOLDER + files[no] + '">');
		    document.write('</' + 'script' + '>');
		    depCache[files[no]] = true;
		}
	}
}

DHTMLSuite.discardElement = function(element) { 
	element = DHTMLSuite.commonObj.getEl(element);
    var gBin = document.getElementById('IELeakGBin'); 
    if (!gBin) { 
        gBin = document.createElement('DIV'); 
        gBin.id = 'IELeakGBin'; 
        gBin.style.display = 'none'; 
        document.body.appendChild(gBin); 
    } 
    // move the element to the garbage bin 
    gBin.appendChild(element); 
    gBin.innerHTML = ''; 
} 


DHTMLSuite.createStandardObjects = function()
{
	DHTMLSuite.clientInfoObj = new DHTMLSuite.clientInfo();	// Create browser info object
	DHTMLSuite.clientInfoObj.init();	
	if(!DHTMLSuite.configObj){	// If this object isn't allready created, create it.
		DHTMLSuite.configObj = new DHTMLSuite.config();	// Create configuration object.
		DHTMLSuite.configObj.init();
	}
	DHTMLSuite.commonObj = new DHTMLSuite.common();	// Create configuration object.
	DHTMLSuite.variableStorage = new DHTMLSuite.globalVariableStorage();;	// Create configuration object.
	DHTMLSuite.commonObj.init();
	DHTMLSuite.domQueryObj = new DHTMLSuite.domQuery();

	
	DHTMLSuite.commonObj.addEvent(window,'unload',function(){ DHTMLSuite.commonObj.__clearMemoryGarbage(); });
	
	standardObjectsCreated = true;	
}

    


/************************************************************************************************************
*	Configuration class used by most of the scripts
*
*	Created:			August, 19th, 2006
* 	Update log:
*
************************************************************************************************************/


/**
* @constructor
* @class Store global variables/configurations used by the classes below. Example: If you want to  
*		 change the path to the images used by the scripts, change it here. An object of this   
*		 class will always be available to the other classes. The name of this object is 
*		"DHTMLSuite.configObj".	<br><br>
*			
*		If you want to create an object of this class manually, remember to name it "DHTMLSuite.configObj"
*		This object should then be created before any other objects. This is nescessary if you want
*		the other objects to use the values you have put into the object. <br>
* @version				1.0
* @version 1.0
* @author	Alf Magne Kalleland(www.dhtmlgoodies.com)
**/
DHTMLSuite.config = function()
{
	var imagePath;	// Path to images used by the classes. 
	var cssPath;	// Path to CSS files used by the DHTML suite.	

	var defaultCssPath;
	var defaultImagePath;
}


DHTMLSuite.config.prototype = {
	// {{{ init()
	/**
	 * 	Initializes the config object - the config class is used to store global properties used by almost all widgets
	 *
	 * @public
	 */
	init : function()
	{
		this.imagePath = DHTML_SUITE_THEME_FOLDER + DHTML_SUITE_THEME + '/images/';	// Path to images		
		this.cssPath = DHTML_SUITE_THEME_FOLDER + DHTML_SUITE_THEME + '/css/';	// Path to images	
		
		this.defaultCssPath = this.cssPath;
		this.defaultImagePath = this.imagePath;
			
	}	
	// }}}
	,
	// {{{ setCssPath()
    /**
     * This method will save a new CSS path, i.e. where the css files of the dhtml suite are located(the folder).
     *	This method is rarely used. Default value is the variable DHTML_SUITE_THEME_FOLDER + DHTML_SUITE_THEME + '/css',
     *	which means that the css path is set dynamically based on which theme you choose.
     *
     * @param string newCssPath = New path to css files(folder - remember to have a slash(/) at the end)
     * @public
     */
    	
	setCssPath : function(newCssPath)
	{
		this.cssPath = newCssPath;
	}
	// }}}
	,
	// {{{ resetCssPath()
    /**
     * @deprecated
     * Resets css path back to default value which is ../css_dhtmlsuite/
     * This method is deprecated.
     *
     * @public
     */    	
	resetCssPath : function()
	{
		this.cssPath = this.defaultCssPath;
	}
	// }}}
	,
	// {{{ resetImagePath()
    /**
     * @deprecated
     *
     * Resets css path back to default path which is DHTML_SUITE_THEME_FOLDER + DHTML_SUITE_THEME + '/css'
     * This method is deprecated. 
     * @public
     */    	
	resetImagePath : function()
	{
		this.imagePath = this.defaultImagePath;
	}
	// }}}
	,
	// {{{ setImagePath()
    /**
     * This method will save a new image file path, i.e. where the image files used by the dhtml suite ar located
     *
     * @param string newImagePath = New path to image files (remember to have a slash(/) at the end)
     * @public
     */
	setImagePath : function(newImagePath)
	{
		this.imagePath = newImagePath;
	}
	// }}}
}



DHTMLSuite.globalVariableStorage = function()
{
	var menuBar_highlightedItems;	// Array of highlighted menu bar items
	this.menuBar_highlightedItems = new Array();
	
	var arrayDSObjects;	// Array of objects of class menuItem.
	var arrayOfDhtmlSuiteObjects;
	this.arrayDSObjects = new Array();
	this.arrayOfDhtmlSuiteObjects = this.arrayDSObjects;
	var ajaxObjects;
	this.ajaxObjects = new Array();
}

DHTMLSuite.globalVariableStorage.prototype = {
	
}


/************************************************************************************************************
*	A class with general methods used by most of the scripts
*
*	Created:			August, 19th, 2006
*	Purpose of class:	A class containing common method used by one or more of the gui classes below, 
* 						example: loadCSS. 
*						An object("DHTMLSuite.commonObj") of this  class will always be available to the other classes. 
* 	Update log:
*
************************************************************************************************************/


/**
* @constructor
* @class A class containing common method used by one or more of the gui classes below, example: loadCSS. An object("DHTMLSuite.commonObj") of this  class will always be available to the other classes. 
* @version 1.0
* @author	Alf Magne Kalleland(www.dhtmlgoodies.com)
**/

DHTMLSuite.common = function()
{
	var loadedCSSFiles;	// Array of loaded CSS files. Prevent same CSS file from being loaded twice.
	var cssCacheStatus;	// Css cache status
	var eventEls;
	var isOkToSelect;	// Boolean variable indicating if it's ok to make text selections
	
	this.okToSelect = true;
	this.cssCacheStatus = true;	// Caching of css files = on(Default)
	this.eventEls = new Array();	
}

DHTMLSuite.common.prototype = {
	
	// {{{ init()
    /**
     * This method initializes the DHTMLSuite_common object.
     *	This class contains a lot of useful methods used by most widgets.
     *
     * @public
     */    	
	init : function()
	{
		this.loadedCSSFiles = new Array();
	}	
	// }}}
	,
	// {{{ loadCSS()
    /**
     * This method loads a CSS file(Cascading Style Sheet) dynamically - i.e. an alternative to <link> tag in the document.
     *
     * @param string cssFile = Name of css file. It will be loaded from the path specified in the DHTMLSuite.common object
     * @param Boolean prefixConfigPath = Use config path as prefix.
     * @public
     */	
	loadCSS : function(cssFile,prefixConfigPath)
	{
		if(!prefixConfigPath && prefixConfigPath!==false)prefixConfigPath=true;
		if(!this.loadedCSSFiles[cssFile]){
			this.loadedCSSFiles[cssFile] = true;
			var lt = document.createElement('LINK');
			if(!this.cssCacheStatus){
				if(cssFile.indexOf('?')>=0)cssFile = cssFile + '&'; else cssFile = cssFile + '?';
				cssFile = cssFile + 'rand='+ Math.random();	// To prevent caching
			}
			if(prefixConfigPath){
				lt.href = DHTMLSuite.configObj.cssPath + cssFile;
			}else{
				lt.href = cssFile;
			}
			lt.rel = 'stylesheet';
			lt.media = 'screen';
			lt.type = 'text/css';
			document.getElementsByTagName('HEAD')[0].appendChild(lt);				
		}
	}		
	// }}}
	,
	// {{{ __setTextSelOk()
    /**
     * Is it ok to make text selections ?
     *
     * @param Boolean okToSelect 
     * @private
     */		
	__setTextSelOk : function(okToSelect){
		this.okToSelect = okToSelect;
	}
	// }}}
	,
	// {{{ __setTextSelOk()
    /**
     * Returns true if it's ok to make text selections, false otherwise.
     *
     * @return Boolean okToSelect 
     * @private
     */		
	__isTextSelOk : function()
	{
		return this.okToSelect;
	}
	// }}}	
	,	
	// {{{ setCssCacheStatus()
    /**
     * Specify if css files should be cached or not. 
     *
     *	@param Boolean cssCacheStatus = true = cache on, false = cache off
     *
     * @public
     */	
	setCssCacheStatus : function(cssCacheStatus)
	{		
	  this.cssCacheStatus = cssCacheStatus;
	}
	// }}}	
	,
	// {{{ getEl()
    /**
     * Return a reference to an object
     *
     * @param Object elRef = Id, name or direct reference to element
     * @return Object HTMLElement - direct reference to element
     * @public
     */		
	getEl : function(elRef)
	{
		if(typeof elRef=='string'){
			if(document.getElementById(elRef))return document.getElementById(elRef);
			if(document.forms[elRef])return document.forms[elRef];
			if(document[elRef])return document[elRef];
			if(window[elRef])return window[elRef];
		}
		return elRef;	// Return original ref.
		
	}
	// }}}
	,
	// {{{ isArray()
    /**
     * Return true if element is an array
     *
     * @param Object el = Reference to HTML element
     * @public
     */		
	isArray : function(el)
	{
		if(el.constructor.toString().indexOf("Array") != -1)return true;
		return false;
	}
	// }}}
	,
	// {{{ getStyle()
    /**
     * Return specific style attribute for an element
     *
     * @param Object el = Reference to HTML element
     * @param String property = Css property
     * @public
     */		
	getStyle : function(el,property)
	{		
		el = this.getEl(el);
	    if (document.defaultView && document.defaultView.getComputedStyle) {
            var retVal = null;	            
            var comp = document.defaultView.getComputedStyle(el, '');
            if (comp){
                retVal = comp[property];
            }	            
            return el.style[property] || retVal;
	    }
		if (document.documentElement.currentStyle && DHTMLSuite.clientInfoObj.isMSIE){	
	        var retVal = null;
	        if(el.currentStyle)value = el.currentStyle[property];
	        return (el.style[property] || retVal);                    		
		}
		return el.style[property];				
	}
	// }}}
	,
	// {{{ getLeftPos()
    /**
     * This method will return the left coordinate(pixel) of an HTML element
     *
     * @param Object el = Reference to HTML element
     * @public
     */	
	getLeftPos : function(el)
	{	 
		/*
		if(el.getBoundingClientRect){ // IE
			var box = el.getBoundingClientRect();	
			return (box.left/1 + Math.max(document.body.scrollLeft,document.documentElement.scrollLeft));
		}
		*/
		if(document.getBoxObjectFor){
			if(el.tagName!='INPUT' && el.tagName!='SELECT' && el.tagName!='TEXTAREA')return document.getBoxObjectFor(el).x
		}		 
		var returnValue = el.offsetLeft;
		while((el = el.offsetParent) != null){
			if(el.tagName!='HTML'){
				returnValue += el.offsetLeft;
				if(document.all)returnValue+=el.clientLeft;
			}
		}
		return returnValue;
	}
	// }}}
	,
	// {{{ getTopPos()
    /**
     * This method will return the top coordinate(pixel) of an HTML element/tag
     *
     * @param Object el = Reference to HTML element
     * @public
     */	
	getTopPos : function(el)
	{	
		/*
		if(el.getBoundingClientRect){	// IE
			var box = el.getBoundingClientRect();	
			return (box.top/1 + Math.max(document.body.scrollTop,document.documentElement.scrollTop));
		}
		*/	
		if(document.getBoxObjectFor){
			if(el.tagName!='INPUT' && el.tagName!='SELECT' && el.tagName!='TEXTAREA')return document.getBoxObjectFor(el).y
		}
		
		var returnValue = el.offsetTop;
		while((el = el.offsetParent) != null){
			if(el.tagName!='HTML'){
				returnValue += (el.offsetTop - el.scrollTop);
				if(document.all)returnValue+=el.clientTop;
			}
		} 
		return returnValue;
	}
	// }}}
	,	
	// {{{ getCookie()
    /**
     *
     * 	These cookie functions are downloaded from 
	 * 	http://www.mach5.com/support/analyzer/manual/html/General/CookiesJavaScript.htm
	 *
     *  This function returns the value of a cookie
     *
     * @param String name = Name of cookie
     * @param Object inputObj = Reference to HTML element
     * @public
     */	
	getCookie : function(name) { 
	   var start = document.cookie.indexOf(name+"="); 
	   var len = start+name.length+1; 
	   if ((!start) && (name != document.cookie.substring(0,name.length))) return null; 
	   if (start == -1) return null; 
	   var end = document.cookie.indexOf(";",len); 
	   if (end == -1) end = document.cookie.length; 
	   return unescape(document.cookie.substring(len,end)); 
	} 	
	// }}}
	,	
	// {{{ setCookie()
    /**
     *
     * 	These cookie functions are downloaded from 
	 * 	http://www.mach5.com/support/analyzer/manual/html/General/CookiesJavaScript.htm
	 *
     *  This function creates a cookie. (This method has been slighhtly modified)
     *
     * @param String name = Name of cookie
     * @param String value = Value of cookie
     * @param Int expires = Timestamp - days
     * @param String path = Path for cookie (Usually left empty)
     * @param String domain = Cookie domain
     * @param Boolean secure = Secure cookie(SSL)
     * 
     * @public
     */	
	setCookie : function(name,value,expires,path,domain,secure) { 
		expires = expires * 60*60*24*1000;
		var today = new Date();
		var expires_date = new Date( today.getTime() + (expires) );
	    var cookieString = name + "=" +escape(value) + 
	       ( (expires) ? ";expires=" + expires_date.toGMTString() : "") + 
	       ( (path) ? ";path=" + path : "") + 
	       ( (domain) ? ";domain=" + domain : "") + 
	       ( (secure) ? ";secure" : ""); 
	    document.cookie = cookieString; 
	}
	// }}}
	,
	// {{{ deleteCookie()
    /**
	 *
     *  This function deletes a cookie. (This method has been slighhtly modified)
     *
     * @param String name = Name of cookie
     * @param String path = Path for cookie (Usually left empty)
     * @param String domain = Cookie domain
     * 
     * @public
     */	
	deleteCookie : function( name, path, domain ) 
	{
		if ( this.getCookie( name ) ) document.cookie = name + "=" +
		( ( path ) ? ";path=" + path : "") +
		( ( domain ) ? ";domain=" + domain : "" ) +
		";expires=Thu, 01-Jan-1970 00:00:01 GMT";
	}
	// }}}
	,
	// {{{ cancelEvent()
    /**
     *
     *  This function only returns false. It is used to cancel selections and drag
     *
     * 
     * @public
     */	
    	
	cancelEvent : function()
	{
		return false;
	}
	// }}}	
	,
	// {{{ addEvent()
    /**
     *
     *  This function adds an event listener to an element on the page.
     *
     *	@param Object whichObject = Reference to HTML element(Which object to assigne the event)
     *	@param String eventType = Which type of event, example "mousemove" or "mouseup" (NOT "onmousemove")
     *	@param functionName = Name of function to execute. 
     * 
     * @public
     */	
	addEvent : function( obj, type, fn,suffix ) {
		if(!suffix)suffix = '';
		if ( obj.attachEvent ) {
			if ( typeof DHTMLSuite_funcs[type+fn+suffix] != 'function') {
				DHTMLSuite_funcs[type+fn+suffix] = function() {
					fn.apply(window.event.srcElement);
				};
				obj.attachEvent('on'+type, DHTMLSuite_funcs[type+fn+suffix] );
			}
			obj = null;
		} else {
			obj.addEventListener( type, fn, false );
		}
		this.__addEventEl(obj);
	}	

	// }}}	
	,	
	// {{{ removeEvent()
    /**
     *
     *  This function removes an event listener from an element on the page.
     *
     *	@param Object whichObject = Reference to HTML element(Which object to assigne the event)
     *	@param String eventType = Which type of event, example "mousemove" or "mouseup"
     *	@param functionName = Name of function to execute. 
     * 
     * @public
     */		
	removeEvent : function(obj,type,fn,suffix)
	{ 
		if ( obj.detachEvent ) {
		obj.detachEvent( 'on'+type, DHTMLSuite_funcs[type+fn+suffix] );
			DHTMLSuite_funcs[type+fn+suffix] = null;
			obj = null;
		} else {
			obj.removeEventListener( type, fn, false );
		}
	} 
	// }}}
	,
	// {{{ __clearMemoryGarbage()
    /**
     *
     *  This function is used for Internet Explorer in order to clear memory when the page unloads.
     *
     * 
     * @private
     */	
    __clearMemoryGarbage : function()
    {
   		/* Example of event which causes memory leakage in IE 
   		DHTMLSuite.commonObj.addEvent(expandRef,"click",function(){ window.refToMyMenuBar[index].__changeMenuBarState(this); })
   		We got a circular reference.
   		*/
    	if(!DHTMLSuite.clientInfoObj.isMSIE)return;
   	
    	for(var no=0;no<DHTMLSuite.eventEls.length;no++){
    		try{
    			var el = DHTMLSuite.eventEls[no];
	    		el.onclick = null;
	    		el.onmousedown = null;
	    		el.onmousemove = null;
	    		el.onmouseout = null;
	    		el.onmouseover = null;
	    		el.onmouseup = null;
	    		el.onfocus = null;
	    		el.onblur = null;
	    		el.onkeydown = null;
	    		el.onkeypress = null;
	    		el.onkeyup = null;
	    		el.onselectstart = null;
	    		el.ondragstart = null;
	    		el.oncontextmenu = null;
	    		el.onscroll = null;   
	    		el = null; 		
    		}catch(e){
    		}
    	}    	
    	
    	for(var no in DHTMLSuite.variableStorage.arrayDSObjects){
    		DHTMLSuite.variableStorage.arrayDSObjects[no] = null;    			
    	}
    	
    	window.onbeforeunload = null;
    	window.onunload = null;
    	DHTMLSuite = null;
    }		
    // }}}
    ,
	// {{{ __addEventEl()
    /**
     *
     *  Add element to garbage collection array. The script will loop through this array and remove event handlers onload in ie.
     *
     * 
     * @private
     */	    
    __addEventEl : function(el)
    {
    	DHTMLSuite.eventEls[DHTMLSuite.eventEls.length] = el;    
    }
    // }}}
    ,
	// {{{ getSrcElement()
    /**
     *
     *  Returns a reference to the HTML element which triggered an event.
     *	@param Event e = Event object
     *
     * 
     * @public
     */	       
    getSrcElement : function(e)
    {
    	var el;
		if (e.target) el = e.target;
			else if (e.srcElement) el = e.srcElement;
			if (el.nodeType == 3) // defeat Safari bug
				el = el.parentNode;
		return el;	
    }	
    // }}}
    ,
	// {{{ getKeyFromEvent()
    /**
     *
     *  Returns key from event object
     *	@param Event e = Event object
     * 
     * @public
     */	     
    getKeyFromEvent : function(e)
    {
		var code = this.getKeyCode(e);   	
    	return String.fromCharCode(code);
    }
    // }}}
    ,
	// {{{ getKeyCode()
    /**
     *
     *  Returns key code from event
     *	@param Event e = Event object
     * 
     * @public
     */	     
    getKeyCode : function(e)
    {
    	if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which;  
    	return code;
    }
    // }}}	
    ,
	// {{{ isObjectClicked()
    /**
     *
     *  Returns true if an object is clicked, false otherwise. This method will also return true if you clicked on a sub element
     *	@param Object obj = Reference to HTML element
     *	@param Event e = Event object
     *
     * 
     * @public
     */	      
	isObjectClicked : function(obj,e)
	{
		var src = this.getSrcElement(e);
		var string = src.tagName + '(' + src.className + ')';
		if(src==obj)return true;
		while(src.parentNode && src.tagName.toLowerCase()!='html'){
			src = src.parentNode;
			string = string + ',' + src.tagName + '(' + src.className + ')';
			if(src==obj)return true;			
		}		
		return false;		
	}
	// }}}
	,
	// {{{ getObjectByClassName()
    /**
     *
     *  Walks up the DOM tree and returns first found object with a given class name
     *
     *	@param Event e = Event object
     *	@param String className = CSS - Class name
     *
     * 
     * @public
     */	 	
	getObjectByClassName : function(e,className)
	{
		var src = this.getSrcElement(e);
		if(src.className==className)return src;
		while(src && src.tagName.toLowerCase()!='html'){
			src = src.parentNode;	
			if(src.className==className)return src;
		}
		return false;
	}
	//}}}
	,
	// {{{ getObjectByAttribute()
    /**
     *
     *  Walks up the DOM tree and returns first found object with a given attribute set
     *
     *	@param Event e = Event object
     *	@param String attribute = Custom attribute
     *
     * 
     * @public
     */	 	
	getObjectByAttribute : function(e,attribute)
	{
		var src = this.getSrcElement(e);
		var att = src.getAttribute(attribute);
		if(!att)att = src[attribute];
		if(att)return src;
		while(src && src.tagName.toLowerCase()!='html'){
			src = src.parentNode;	
			var att = src.getAttribute('attribute');
			if(!att)att = src[attribute];		
			if(att)return src;
		}
		return false;
	}
	//}}}
	,
	// {{{ getUniqueId()
    /**
     *
     *  Returns a unique numeric id
     *
     *
     * 
     * @public
     */		
	getUniqueId : function()
	{
		var no = Math.random() + '';
		no = no.replace('.','');		
		var no2 = Math.random() + '';
		no2 = no2.replace('.','');		
		return no + no2;		
	}
	// }}}
	,
	// {{{ getAssociativeArrayFromString()
    /**
     *
     *  Returns an associative array from a comma delimited string
     *  @param String propertyString - commaseparated string(example: "id:myid,title:My title,contentUrl:includes/tab.inc")
     *
     *	@return Associative array of keys + property value(example: key: id, value : myId)
     * @public
     */		
	getAssociativeArrayFromString : function(propertyString)
	{
		if(!propertyString)return;
		var retArray = new Array();
		var items = propertyString.split(/,/g);
		for(var no=0;no<items.length;no++){
			var tokens = items[no].split(/:/);	
			retArray[tokens[0]] = tokens[1];			
		}	
		return retArray;	
	}
	// }}}
	,
	// {{{ correctPng()
    /**
     *
     *  Correct png for old IE browsers
     *  @param Object el - Id or direct reference to image
     *
     * @public
     */	
	correctPng : function(el)
	{
		el = DHTMLSuite.commonObj.getEl(el);	
		var img = el;
		var width = img.width;
		var height = img.height;
		var html = '<span style="display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + img.src + '\',sizingMethod=\'scale\');width:' + width + ';height:' + height + '"></span>';
		img.outerHTML = html;	
					
	}
	,	
	// {{{ __evaluateJs()
    /**
     * Evaluate Javascript in the inserted content
     *
     * @private
     */	
	__evaluateJs : function(obj)
	{
		obj = this.getEl(obj);
		var scriptTags = obj.getElementsByTagName('SCRIPT');
		var string = '';
		var jsCode = '';
		for(var no=0;no<scriptTags.length;no++){	
			if(scriptTags[no].src){
		        var head = document.getElementsByTagName("head")[0];
		        var scriptObj = document.createElement("script");
		
		        scriptObj.setAttribute("type", "text/javascript");
		        scriptObj.setAttribute("src", scriptTags[no].src);  	
			}else{
				if(DHTMLSuite.clientInfoObj.isOpera){
					jsCode = jsCode + scriptTags[no].text + '\n';
				}
				else
					jsCode = jsCode + scriptTags[no].innerHTML;	
			}			
		}
		if(jsCode)this.__installScript(jsCode);
	}
	// }}}
	,
	// {{{ __installScript()
    /**
     *  "Installs" the content of a <script> tag.
     *
     * @private        
     */		
	__installScript : function ( script )
	{		
		try{
		    if (!script)
		        return;		
	        if (window.execScript){        	
	        	window.execScript(script)
	        }else if(window.jQuery && jQuery.browser.safari){ // safari detection in jQuery
	            window.setTimeout(script,0);
	        }else{        	
	            window.setTimeout( script, 0 );
	        } 
		}catch(e){
			
		}
	}	
	// }}}
	,
	// {{{ __evaluateCss()
    /**
     *  Evaluates css
     *
     * @private        
     */	
	__evaluateCss : function(obj)
	{
		obj = this.getEl(obj);
		var cssTags = obj.getElementsByTagName('STYLE');
		var head = document.getElementsByTagName('HEAD')[0];
		for(var no=0;no<cssTags.length;no++){
			head.appendChild(cssTags[no]);
		}	
	}	
}

/************************************************************************************************************
*	Client info class
*
*	Created:			August, 18th, 2006
* 	Update log:
*
************************************************************************************************************/

/**
* @constructor
* @class Purpose of class: Provide browser information to the classes below. Instead of checking for
*		 browser versions and browser types in the classes below, they should check this
*		 easily by referncing properties in the class below. An object("DHTMLSuite.clientInfoObj") of this 
*		 class will always be accessible to the other classes. * @version 1.0
* @author	Alf Magne Kalleland(www.dhtmlgoodies.com)
**/


DHTMLSuite.clientInfo = function()
{
	var browser;			// Complete user agent information
	
	var isOpera;			// Is the browser "Opera"
	var isMSIE;				// Is the browser "Internet Explorer"
	var isOldMSIE;			// Is this browser and older version of Internet Explorer ( by older, we refer to version 6.0 or lower)	
	var isFirefox;			// Is the browser "Firefox"
	var navigatorVersion;	// Browser version
	var isOldMSIE;
}
	
DHTMLSuite.clientInfo.prototype = {
	
	// {{{ init()
    /**
     *  This method initializes the clientInfo object. This is done automatically when you create a widget object.
     *
     * @public
     */	    	
	init : function()
	{
		this.browser = navigator.userAgent;	
		this.isOpera = (this.browser.toLowerCase().indexOf('opera')>=0)?true:false;
		this.isFirefox = (this.browser.toLowerCase().indexOf('firefox')>=0)?true:false;
		this.isMSIE = (this.browser.toLowerCase().indexOf('msie')>=0)?true:false;
		this.isOldMSIE = (this.browser.toLowerCase().match(/msie\s[0-6]/gi))?true:false;
		this.isSafari = (this.browser.toLowerCase().indexOf('safari')>=0)?true:false;
		this.navigatorVersion = navigator.appVersion.replace(/.*?MSIE\s(\d\.\d).*/g,'$1')/1;
		this.isOldMSIE = (this.isMSIE&&this.navigatorVersion<7)?true:false;
	}	
	// }}}		
	,
	// {{{ getBrowserWidth()
    /**
     *
	 *
     *  This method returns the width of the browser window(i.e. inner width)
     *
     * 
     * @public
     */		
	getBrowserWidth : function()
	{
		if(self.innerWidth)return self.innerWidth;
		return document.documentElement.offsetWidth;		
	}
	// }}}
	,
	// {{{ getBrowserHeight()
    /**
     *
	 *
     *  This method returns the height of the browser window(i.e. inner height)
     *
     * 
     * @public
     */		
	getBrowserHeight : function()
	{
		if(self.innerHeight)return self.innerHeight;
		return document.documentElement.offsetHeight;
	}
}



/************************************************************************************************************
*	DOM query class 
*
*	Created:			August, 31th, 2006
*
* 	Update log:
*
************************************************************************************************************/

/**
* @constructor
* @class Purpose of class:	Gives you a set of methods for querying elements on a webpage. When an object
*		 of this class has been created, the method will also be available via the document object.
*		 Example: var elements = document.getElementsByClassName('myClass');
* @version 1.0
* @author	Alf Magne Kalleland(www.dhtmlgoodies.com)
**/

DHTMLSuite.domQuery = function()
{
	// Make methods of this class a member of the document object. 
	document.getElementsByClassName = this.getElementsByClassName;
	document.getElementsByAttribute = this.getElementsByAttribute;
}



	
DHTMLSuite.domQuery.prototype = {
}


/*[FILE_START:dhtmlSuite-tableWidget.js] */
/************************************************************************************************************
*	Table widget page handler class
*
*	Created:		December, 15th, 2006
*	Purpose of class:	Displays paginating below a server sorted table
*
*	CSS used:		
*
* 	Update log:
*
************************************************************************************************************/

/**
* @constructor
* @class Purpose of class:	Make HTML tables sortable<br><br>
*/
DHTMLSuite.tableWidgetPageHandler=function(){
	var tableRef;			
	// Reference to object of class DHTMLSuite.tableWidget
	var targetRef;			
	// Where to insert the pagination.
	
	var txtPrevious;		
	// Label-"Previous"
	var txtNext;			
	// Label-"Next"
	var txtFirst;			
	// Label-"First"
	var txtLast;			
	// Label-"last"
	
	var txtResultPrefix;		
	// Prefix:result-default="Result: "
	var txtResultTo;		
	// Text label Result: 1 "to" 10 of 51-default value="to"
	var txtResultOf;		
	// Text label Result: 1 to 10 "of" 51-default value="of"
	
	var totalNumberOfRows;		
	// Total number of rows in dataset
	var rowsPerPage;		
	// Number of rows per page.
	
	var layoutCSS;			
	// Name of CSS file for the table widget.
	var activePageNumber;		
	// Active page number
	var mainDivEl;		
	// Reference to main div for the page handler
	var resultDivElement;		
	// Reference to div element which is parent for the result
	var pageListDivEl;		
	// Reference to div element which is parent to pages [1],[2],[3]...[Next]
	
	var objectIndex;		
	// Index of this widget in the arrayDSObjects array
	
	var linkPagePrefix;		
	// Text in front of each page link
	var linkPageSuffix;		
	// Text behind each page link
	
	var maximumNumberOfPageLinks;	
	// Maximum number of page links.
	var callbackOnAfterNavigate;	
	// Callback function-executed when someone navigates to a different page
	this.txtPrevious='Previous';	
	// Default label
	this.txtNext='Next';		
	// Default label
	this.txtResultPrefix='Result: ';		
	// Default label
	this.txtResultTo='to';		
	// Default label
	this.txtResultOf='of';		
	// Default label
	this.txtFirst='First';
	this.txtLast='Last';
	
	this.tableRef=false;
	this.targetRef=false;
	this.totalNumberOfRows=false;
	this.activePageNumber=0;
	this.layoutCSS='table-widget-page-handler.css';
	
	this.linkPagePrefix='';
	this.linkPageSuffix='';
	this.maximumNumberOfPageLinks=false;
	this.callbackOnAfterNavigate=false;
	
	
	this.objectIndex=DHTMLSuite.variableStorage.arrayDSObjects.length;
	DHTMLSuite.variableStorage.arrayDSObjects[this.objectIndex]=this;
	
	
}

DHTMLSuite.tableWidgetPageHandler.prototype={
	
	// {{{ setTableRef()
	 /**
	  *	Connect to a tableWidget object.
	  *
	 *	@param Object tableRef=An object of class DHTMLSuite.tableWidget. It makes it possible for the tableWidget and this object to communicate.
	 *
	 *@public
	  */	
	setTableRef:function(tableRef)
	{
		this.tableRef=tableRef;
		this.tableRef.setPageHandler(this);
	}	
	
	// }}}
	,
	
	// {{{ setTargetId()
	 /**
	  *	Where do you want to insert the navigation links for the table
	  *
	 *	@param String idOfHTMLElement=Id of HTML Element on your page.
	 *
	 *@public
	  */	
	setTargetId:function(idOfHTMLElement)
	{
		if(!document.getElementById(idOfHTMLElement)){
			alert('ERROR IN tableWidgetPageHandler.setTargetId:\nElement with id '+idOfHTMLElement+' does not exists');
			return;
		}
		this.targetRef=document.getElementById(idOfHTMLElement);	
	}
	
	// }}}
	,
	
	// {{{ setTxtPrevious()
	 /**
	  *	Set text label (previous page link)
	  *
	 *	@param String newText=Text previous page link
	 *
	 *@public
	  */	
	setTxtPrevious:function(newText)
	{
		this.txtPrevious=newText;
	}
	
	// }}}
	,
	
	// {{{ setLinkPagePrefix()
	 /**
	  *	Set text/characters in front of each page link, example "[" to get page number in brackets
	  *
	 *	@param String linkPagePrefix=Character(s)in front of page links
	 *
	 *@public
	  */	
	setLinkPagePrefix:function(linkPagePrefix)
	{
		this.linkPagePrefix=linkPagePrefix;
	}
	
	// }}}
	,
	
	// {{{ setLinkPageSuffix()
	 /**
	  *	Set text/characters in front of each page link, example "[" to get page number in brackets
	  *
	 *	@param String linkPageSuffix=Character(s)in front of page links
	 *
	 *@public
	  */	
	setLinkPageSuffix:function(linkPageSuffix)
	{
		this.linkPageSuffix=linkPageSuffix;
	}
	
	
	// }}}
	,
	
	// {{{ setTxtNext()
	 /**
	  *	Set text label (next page link)
	  *
	 *	@param String newText=Text next page link
	 *
	 *@public
	  */	
	setTxtNext:function(newText)
	{
		this.txtNext=newText;
	}
	
	// }}}
	,
	
	// {{{ setTxtResultOf()
	 /**
	  *	Set text label ("of"-result)
	  *
	 *	@param String txtResultOf=Result of search, the "of" label ( Result: 1 to 10 "of" 51 )
	 *
	 *@public
	  */	
	setTxtResultOf:function(txtResultOf)
	{
		this.txtResultOf=txtResultOf;
	}
	
	// }}}
	,
	
	// {{{ setTxtResultTo()
	 /**
	  *	Set text label ("to"-result)
	  *
	 *	@param String txtResultTo=Result of search, the "to" label ( Result: 1 "to" 10 of 51 )
	 *
	 *@public
	  */	
	setTxtResultTo:function(txtResultTo)
	{
		this.txtResultTo=txtResultTo;
	}
	
	// }}}
	,
	
	// {{{ setTxtResultPrefix()
	 /**
	  *	Set text label (prefix-result)
	  *
	 *	@param String txtResultPrefix=Text next page link
	 *
	 *@public
	  */	
	setTxtResultPrefix:function(txtResultPrefix)
	{
	this.txtResultPrefix=txtResultPrefix;
	}
	
	// }}}
	,
	
	// {{{ setTxtFirstPage()
	 /**
	  *	Set text label ("Last" page)
	  *
	 *	@param String txtFirst=Label of link to "First" page ( default="First" ).This option is only used when you are limiting the number of pages shown.
	 *
	 *@public
	  */	
	setTxtFirstPage:function(txtFirst)
	{
		this.txtFirst=txtFirst;
	}
	
	// }}}
	,
	
	// {{{ setTxtLastPage()
	 /**
	  *	Set text label ("First" page)
	  *
	 *	@param String txtLast=Label of link to "Last" page ( default="Last" ).This option is only used when you are limiting the number of pages shown.
	 *
	 *@public
	  */	
	setTxtLastPage:function(txtLast)
	{
		this.txtLast=txtLast;
	}
	
	// }}}
	,
	
	// {{{ setTotalNumberOfRows()
	 /**
	  *	Specify total number of rows in the entire dataset
	  *
	 *	@param Integer totalNumberOfRows=Total number of rows in the entire dataset.
	 *
	 *@public
	  */	
	setTotalNumberOfRows:function(totalNumberOfRows)
	{
		this.totalNumberOfRows=totalNumberOfRows;
	}
	
	// }}}
	,
	
	// {{{ setCallbackOnAfterNavigate()
	 /**
	 *Specify call back function to execute after page navigatoin
	  *
	 *@param String callbackOnAfterNavigate-name of javascript function.
	  *
	 *@public
	  */	
	setCallbackOnAfterNavigate:function(callbackOnAfterNavigate)
	{
		this.callbackOnAfterNavigate=callbackOnAfterNavigate;
	}
	
	// }}}
	,
	
	// {{{ setLayoutCss()
	 /**
	 *set new CSS file
	  *
	 *@param String cssFileName-name of new css file(example: drag-drop.css). Has to be set before init is called. 
	  *
	 *@public
	  */	
	setLayoutCss:function(layoutCSS)
	{
		this.layoutCSS=layoutCSS;
	}
	
	// }}}
	,
	
	// {{{ setMaximumNumberOfPageLinks()
	 /**
	 *Set maximum number of page links displayed below the table, i.e. if you have 50 pages, you can limit number of page links to 10 by sending 10 to this method.
	  *
	 *@param Integer maximumNumberOfPageLinks-(0 or false means=no limitation)
	  *
	 *@public
	  */	
	setMaximumNumberOfPageLinks:function(maximumNumberOfPageLinks)
	{
		this.maximumNumberOfPageLinks=maximumNumberOfPageLinks;
	}
	
	// }}}
	,
	
	// {{{ init()
	 /**
	 *Initializes the script widget. Set methods should be called before your call this method.
	  *
	  *
	 *@public
	  */	
	init:function()
	{
		this.rowsPerPage=this.tableRef.getServersideSortNumberOfRows();
		DHTMLSuite.commonObj.loadCSS(this.layoutCSS);
		this.__createMainDivEls();
		this.setHTMLOfResultList();
		this.__createPageLinks();
		this.goToPage(1);
	}
	
	// }}}
	,
	
	// {{{ __createMainDivEls()
	 /**
	 *Create main div elements for the page handler
	  *
	  *
	 *@private
	  */	
	__createMainDivEls:function()
	{
		if(!this.targetRef){
			alert('Error creating table widget page handler. Remember to specify targetRef');
			return;
		}
		this.mainDivEl=document.createElement('DIV');
		this.mainDivEl.className='DHTMLSuite_tableWidgetPageHandler_mainDiv';
		this.targetRef.appendChild(this.mainDivEl);	
		
		this.resultDivElement=document.createElement('DIV');
		this.resultDivElement.className='DHTMLSuite_tableWidgetPageHandler_result';
		this.mainDivEl.appendChild(this.resultDivElement);
		
		this.pageListDivEl=document.createElement('DIV');
		this.pageListDivEl.className='DHTMLSuite_tableWidgetPageHandler_pageList';
		this.mainDivEl.appendChild(this.pageListDivEl);
	}
	
	,
	
	// {{{ setHTMLOfResultList()
	 /**
	  *
	 *	Create result list div
	  *	
	 *
	 *
	 *@public
	  */  	
	setHTMLOfResultList:function()
	{
		this.resultDivElement.innerHTML='';	
		var html=this.txtResultPrefix+(((this.activePageNumber-1)* this.rowsPerPage)+1)+' '+this.txtResultTo+' '+Math.min(this.totalNumberOfRows,(this.activePageNumber*this.rowsPerPage))+' '+this.txtResultOf+' '+this.totalNumberOfRows;
		this.resultDivElement.innerHTML=html;
	}
	
	// }}}
	,
	
	// {{{ __createPageLinks()
	 /**
	  *
	 *	Create page links
	  *	
	 *@private
	  */  	
	__createPageLinks:function()
	{
		var ind=this.objectIndex;	
		this.pageListDivEl.innerHTML='';	
		// Clearing the div element if it allready got content.
		var numberOfPages=Math.ceil(this.totalNumberOfRows/this.rowsPerPage);
		
		/* link to first page */
		if(this.maximumNumberOfPageLinks&&this.maximumNumberOfPageLinks<numberOfPages){
			var span=document.createElement('SPAN');
			span.innerHTML=this.linkPagePrefix;
			this.pageListDivEl.appendChild(span);	
			span.className='DHTMLSuite_pageHandler_firstLink';
				
			var fl=document.createElement('A'); 
		// "first" link
			fl.innerHTML=this.txtFirst;
			fl.href='#';
			fl.id='pageLink_1';
			fl.onclick=function(e){ return DHTMLSuite.variableStorage.arrayDSObjects[ind].__navigate(e); }
			span.appendChild(fl);
			DHTMLSuite.commonObj.__addEventEl(fl);		
		}			
		
		
		var span=document.createElement('SPAN');
		span.innerHTML=this.linkPagePrefix;
		this.pageListDivEl.appendChild(span);	
		span.className='DHTMLSuite_pageHandler_previousLink';
			
		var previousLink=document.createElement('A');	
		// "Previous" link
		previousLink.innerHTML=this.txtPrevious;
		previousLink.href='#';
		previousLink.id='previous';
		previousLink.onclick=function(e){ return DHTMLSuite.variableStorage.arrayDSObjects[ind].__navigate(e); }
		span.appendChild(previousLink);
		DHTMLSuite.commonObj.__addEventEl(previousLink);
		if(this.activePageNumber==1)previousLink.className='previousLinkDisabled'; else previousLink.className='previousLink';	
		
		var startNumberToShow=1;
		var endNumberToShow=numberOfPages;
		if(this.maximumNumberOfPageLinks&&this.maximumNumberOfPageLinks<numberOfPages){
			startNumberToShow=Math.max(1,Math.round(this.activePageNumber-this.maximumNumberOfPageLinks/2));
			endNumberToShow=Math.min(numberOfPages,startNumberToShow+this.maximumNumberOfPageLinks-1);	
			
			if(endNumberToShow-startNumberToShow < this.maximumNumberOfPageLinks){
			startNumberToShow=Math.max(1,endNumberToShow-this.maximumNumberOfPageLinks+1);
			}			
		}	
		for(var no=startNumberToShow;no<=endNumberToShow;no++){		
			var span=document.createElement('SPAN');
			span.innerHTML=this.linkPagePrefix;
			this.pageListDivEl.appendChild(span);		
			var pageLink=document.createElement('A');
			if(no==this.activePageNumber)pageLink.className='DHTMLSuite_tableWidgetPageHandler_activePage'; else pageLink.className='DHTMLSuite_tableWidgetPageHandler_inactivePage';
			pageLink.innerHTML=no;
			pageLink.href= '#';
			pageLink.id='pageLink_'+no;
			pageLink.onclick=function(e){ return DHTMLSuite.variableStorage.arrayDSObjects[ind].__navigate(e); }
			DHTMLSuite.commonObj.__addEventEl(pageLink);
			this.pageListDivEl.appendChild(pageLink);	
			
			var span=document.createElement('SPAN');
			span.innerHTML=this.linkPageSuffix;
			this.pageListDivEl.appendChild(span);				
		}	
		var span=document.createElement('SPAN');
		span.innerHTML=this.linkPagePrefix;
		this.pageListDivEl.appendChild(span);	
		span.className='DHTMLSuite_pageHandler_nextLink';
				
		var nextLink=document.createElement('A');	
		// "Next" link
		nextLink.innerHTML=this.txtNext;
		nextLink.id='next';
		nextLink.href='#';
		nextLink.onclick=function(e){ return DHTMLSuite.variableStorage.arrayDSObjects[ind].__navigate(e); }
		DHTMLSuite.commonObj.__addEventEl(nextLink);
		span.appendChild(nextLink);
		if(this.activePageNumber==numberOfPages)nextLink.className='nextLinkDisabled'; else nextLink.className='nextLink';
		
		/* link to Last page */
		if(this.maximumNumberOfPageLinks&&this.maximumNumberOfPageLinks<numberOfPages){
			var span=document.createElement('SPAN');
			span.innerHTML=this.linkPagePrefix;
			this.pageListDivEl.appendChild(span);	
			span.className='DHTMLSuite_pageHandler_lastLink';		
			var ll=document.createElement('A');	
		// "Last" link
			ll.innerHTML=this.txtLast;
			ll.href='#';
			ll.id='pageLink_'+(numberOfPages);
			ll.onclick=function(e){ return DHTMLSuite.variableStorage.arrayDSObjects[ind].__navigate(e); }
			span.appendChild(ll);
			DHTMLSuite.commonObj.__addEventEl(ll);		
		}	
	}
	
	// }}}
	,
	
	// {{{ __navigate()
	 /**
	  *
	 *	Navigate-click on "next" or "previous" link or click on a page
	  *	
	  *	@param Event e	= Reference to event object. used to get a reference to the element triggering this action.
	 *
	 *
	 *@private
	  */  	
	__navigate:function(e)
	{
		if(document.all)e=event;
		var src=DHTMLSuite.commonObj.getSrcElement(e);
		var initActivePageNumber=this.activePageNumber;
		var numberOfPages=Math.ceil(this.totalNumberOfRows/this.rowsPerPage);
		
		if(src.id.indexOf('pageLink_')>=0){
			var pageNo=src.id.replace(/[^0-9]/gi,'')/1;
			this.activePageNumber=pageNo;
			
		}
		if(src.id=='next'){	
		// next link clicked
			this.activePageNumber++;
			if(this.activePageNumber>numberOfPages)this.activePageNumber=numberOfPages;	
		}
		if(src.id=='previous'){
			this.activePageNumber--;
			if(this.activePageNumber<1)this.activePageNumber=1;
		}
			
		if(this.activePageNumber!=initActivePageNumber){
			this.tableRef.serversideSortCurrentStartIndex=((this.activePageNumber-1)*this.rowsPerPage);
			this.tableRef.__getItemsFromServer(this.callbackOnAfterNavigate);
			this.setHTMLOfResultList();
			this.__createPageLinks();
		}
		return false;
	
	}
	
	// }}}
	,
	
	// {{{ __resetActivePageNumber()
	 /**
	  *
	 *	Reset active page number-called from the tableWidget
	 *
	 *
	 *@private
	  */		
	__resetActivePageNumber:function()
	{
		this.activePageNumber=1;
		this.setHTMLOfResultList();
		this.__createPageLinks();
	}
	
	// }}}
	,
	
	// {{{ goToPage()
	 /**
	  *
	 *	Go to a page
	  *	@param Integer pageNumber
	 *
	 *
	 *@public
	  */ 	
	goToPage:function(pageNo)
	{
		var initActivePageNumber=this.activePageNumber;
		this.activePageNumber=pageNo;
		if(this.activePageNumber!=initActivePageNumber){
			this.tableRef.serversideSortCurrentStartIndex=((this.activePageNumber-1)*this.rowsPerPage);
			this.tableRef.__getItemsFromServer(this.callbackOnAfterNavigate);
			this.setHTMLOfResultList();
			this.__createPageLinks();
		}	
	}
}






/*[FILE_START:dhtmlSuite-tabView.js] */	
/************************************************************************************************************
*	Tab view class
*
*	Created:			August, 21st, 2006
*
* 	Update log:
*
************************************************************************************************************/

	
if(!window.DHTMLSuite)var DHTMLSuite=new Object();/************************************************************************************************************ 
*	Tab view class 
* 
*	Created:		August, 21st, 2006 
* 
*	 Update log: 
* 
************************************************************************************************************/ 

	 
var refToTabViewObjects=new Array();	 
// Reference to objects of this class. 
				
// We need this because the script doesn't allways know which object to use 

/** 
* @constructor 
* @class Purpose of class:	Tab view class-transfors plain HTML into tabable layers.<br> 
* (See <a target="_blank" href="../../demos/demo-tabs-1.html">demo 1</A> and <a target="_blank" href="../../demos/demo-tabs-2.html">demo 2</A>) 
* @version 1.0 
* @author	Alf Magne Kalleland(www.dhtmlgoodies.com) 
**/ 

DHTMLSuite.tabView=function(){ 
	var textPadding;		 
	// Tab spacing 
	var strictDocType ;		
	// Using a strict document type, i.e. <!DOCTYPE> 

	var DHTMLSuite_tabObj;	 
	// Reference to div surrounding the tab set 
	var activeTabIndex;		 
	// Currently displayed tab(index-0=first tab) 
	var initActiveTabIndex;		 
	// Initially displayed tab(index-0=first tab) 
	var ajaxObjects;		 
	// Reference to ajax objects 
	var tabView_countTabs; 
	var tabViewHeight; 
	var tabSetParentId;		 
	// Id of div surrounding the tab set. 
	var tabTitles;			 
	// Tab titles 
	var width;			 
	// width of tab view 
	var height;			 
	// height of tab view 
	var layoutCSS; 
	var outsideObjectRefIndex;	 
	// Which index of refToTabViewObjects refers to this object. 
	var maxNumberOfTabs; 
	var dynamicContentObj;	 
	var closeButtons; 
	var refActiveTabContent; 
	 
	var callbackOnTabSwitch; 
	 
	this.initActiveTabIndex=0; 
	this.callbackOnTabSwitch=''; 
	this.refActiveTabContent=''; 
	 
	// Default variable values 
	this.textPadding=3; 
	this.strictDocType=true;	
	this.ajaxObjects=new Array(); 
	this.tabTitles=new Array(); 
	this.layoutCSS='tab-view.css'; 
	this.maxNumberOfTabs=6; 
	this.dynamicContentObj=false; 
	this.closeButtons=new Array(); 
	this.width='100%'; 
	this.height='500'; 
	 
	try{ 
		if(!standardObjectsCreated)DHTMLSuite.createStandardObjects();	 
		// This line starts all the init methods 
	}catch(e){ 
		alert('You need to include the dhtmlSuite-common.js file'); 
	} 
} 

DHTMLSuite.tabView.prototype={ 
	 
	// {{{ init() 
	 /** 
	 *Initialize the script 
	 * 
	 *@public 
	*/	 
	init:function() 
	{	 
		DHTMLSuite.commonObj.loadCSS(this.layoutCSS); 
		this.outsideObjectRefIndex=refToTabViewObjects.length; 
		refToTabViewObjects[this.outsideObjectRefIndex]=this; 
		try{ 
			this.dynamicContentObj=new DHTMLSuite.dynamicContent(); 
		}catch(e){ 
			alert('You need to include DHTMLSuite-dynamicContent.js'); 
		} 
		this.__initializeAndParseTabs(false,false); 
	 
	} 
	 
	// }}} 
	, 
	 
	// {{{ setCallbackOnTabSwitch() 
	 /** 
	 *Set callback on tab switch 
	 * 
	 *@param String callbackOnTabSwitch=Name of function to execute when the user switches to a different tab. 
	* 
	 *@public 
	*/		 
	setCallbackOnTabSwitch:function(callbackOnTabSwitch) 
	{ 
		this.callbackOnTabSwitch=callbackOnTabSwitch; 
	} 
	 
	// }}} 
	, 
	 
	// {{{ getMaximumNumberOfTabs() 
	 /** 
	 *Return maximum number of tabs 
	 * 
	 *@return Int maximumNumberOfTabs=Maximum number of tabs 
	* 
	 *@public 
	*/	 
	getMaximumNumberOfTabs:function() 
	{ 
		return this.maxNumberOfTabs; 
	} 
	 
	// }}}	 
	, 
	 
	// {{{ setMaximumTabs() 
	 /** 
	 *Set maximum number of tabs 
	 * 
	 *@param Int maximumNumberOfTabs=Maximum number of tabs 
	* 
	 *@public 
	*/	 
	setMaximumTabs:function(maximumNumberOfTabs) 
	{ 
		this.maxNumberOfTabs=maximumNumberOfTabs; 
	}		
	 
	// }}}	 
	 , 
	 
	// {{{ setParentId() 
	 /** 
	 *Set padding on tabs 
	 * 
	 *@param String idOfParentHTMLElement=id of parent div 
	* 
	 *@public 
	*/	 
	setParentId:function(idOfParentHTMLElement) 
	{ 
		this.tabSetParentId=idOfParentHTMLElement; 
		this.DHTMLSuite_tabObj=document.getElementById(idOfParentHTMLElement); 
	}		
	 
	// }}}	 
	 , 
	 
	// {{{ setWidth() 
	 /** 
	 *Set width of tab view 
	 * 
	 *@param String Width of tab view 
	* 
	 *@public 
	*/	 
	setWidth:function(newWidth) 
	{ 
		this.width=newWidth; 
	}	 
	 
	// }}}	 
	 , 
	 
	// {{{ setHeight() 
	 /** 
	 *Set height of tab view on tabs 
	 * 
	 *@param String Height of tab view 
	* 
	 *@public 
	*/	 
	setHeight:function(newHeight) 
	{ 
		this.height=newHeight; 
	}	 
	 
	// }}}	 
	 ,	 
	 
	// {{{ setIndexActiveTab() 
	 /** 
	 *Set index of initially active tab 
	 * 
	 *@param Int indexOfNewActiveTab=Index of active tab(0=first tab) 
	* 
	 *@public 
	*/	 
	setIndexActiveTab:function(indexOfNewActiveTab) 
	{ 
		this.initActiveTabIndex=indexOfNewActiveTab; 
	}	 
	 
	 
	// }}}	 
	 ,	 
	 
	// {{{ setTabTitles() 
	 /** 
	 *Set title of tabs 
	 * 
	 *@param Array titleOfTabs=Title of tabs 
	* 
	 *@public 
	*/	 
	setTabTitles:function(titleOfTabs) 
	{ 
		this.tabTitles=titleOfTabs; 
	}	 
	 
	 
	// }}}	 
	 ,	 
	 
	// {{{ setCloseButtons() 
	 /** 
	 *Specify which tabs that should have close buttons 
	 * 
	 *@param Array closeButtons=Array of true or false 
	* 
	 *@public 
	*/	 
	setCloseButtons:function(closeButtons) 
	{ 
		this.closeButtons=closeButtons; 
	}	 
	 
	// }}} 
	 , 
	 
	// {{{ getReferenceToDivElement() 
	 /** 
	 * 
	 *Returns a reference to the div element of a tab. 
	 * 
	 *@param String tabTitle=Title of tab 
	 *@return Object Element to HTML div element for this tab. 
	 * 
	 *@public 
	*/		 
	 getReferenceToDivElementByTitle:function(tabTitle) 
	 { 
		 var index=this.getTabIndexByTitle(tabLabel);	 
		 // Get index of tab 
		 if(index!=-1){ 
		 var obj=document.getElementById('tabView'+this.tabSetParentId+'_'+index); 
		 return obj;		
		 }		 
		 return false; 
	 } 
	 
	// }}} 
	 , 
	 
	// {{{ getReferenceToDivElementById() 
	 /** 
	 * 
	 *Returns a reference to the div element of a tab. 
	* 
	 *@param String idOfTab=id of tab 
	 *@return Object Element to HTML div element for this tab. 
	* 
	 *@public 
	*/			
	 getReferenceToDivElementById:function(idOfTab) 
	 { 
		var divs=this.DHTMLSuite_tabObj.getElementsByTagName('DIV'); 
		 
		for(var no=0;no<divs.length;no++){ 
			var attr=divs[no].getAttribute('originalId'); 
			if(!attr)attr=divs[no].originalid; 
			if(attr==idOfTab)return divs[no]; 
		} 
		return false; 
			
	 } 
	 
	// }}}	 
	, 
	 
	// {{{ createNewTab() 
	 /** 
	 * 
	 *Creates new tab dynamically 
	* 
	 *@param String parentId=Id of tabset 
	 *@param String tabTitle=Title of new tab 
	 *@param String tabContent=Content of new tab(Optional) 
	 *@param String tabContentUrl=Url to content of new tab(Optional)- Ajax is used to get this content 
	* 
	 *@return Boolean Success-true if the tab was created, false otherwise, i.e. tab with same label already exists. 
	* 
	 *@public 
	*/	 
	createNewTab:function(parentId,tabTitle,tabContent,tabContentUrl,closeButton) 
	 { 
		var index=this.getTabIndexByTitle(tabTitle);	 
		// Get index of tab 
			if(index!=-1){	 
		// Tab exists if index<>-1 
				this.displayATab(tabTitle,index); 
				return false; 
			} 
			if(this.tabView_countTabs>=this.maxNumberOfTabs)return;	 
		// Maximum number of tabs reached-return 
			var div=document.createElement('DIV');	 
		// Create new tab content div. 
			div.className='DHTMLSuite_aTab';	 
		// Assign new tab to CSS class DHTMLSuite_aTab 
			this.DHTMLSuite_tabObj.appendChild(div);			 
		// Appending new tab content div to main tab view div 
			var tabId=this.__initializeAndParseTabs(true,tabTitle,closeButton);	 
		// Call the init method in order to create tab header and tab images 
			if(tabContent)div.innerHTML=tabContent;	 
		// Static tab content specified, put it into the new div 
			if(tabContentUrl){	 
		// Get content from external file 
				this.dynamicContentObj.loadContent('tabView'+parentId +'_'+tabId,tabContentUrl); 
			} 
		// update tabTitles -- batur 
		this.tabTitles[tabId] = tabTitle; 
			
		return true; 
	} 

	 
	// }}}		 
	 ,	 
	
	// {{{ deleteTab() 
	 /** 
	* 
	 *Delete a tab 
	* 
	 *@param String tabLabel=Label of tab to delete(Optional) 
	 *@param Int tabIndex=Index of tab to delete(Optional) 
	* 
	 *@public 
	*/	 
	deleteTab:function(tabLabel,tabIndex) 
	{	 
		if(tabLabel){	 
		// Delete tab by tab title 
			var index=this.getTabIndexByTitle(tabLabel);	 
		// Get index of tab 
			if(index!=-1){	 
		// Tab exists if index<>-1 
			this.deleteTab(false,index); 
			} 
			 
		}else if(tabIndex>=0){	 
		// Delete tab by tab index. 
			if(document.getElementById('tabTab'+this.tabSetParentId+'_'+tabIndex)){ 
			var obj=document.getElementById('tabTab'+this.tabSetParentId+'_'+tabIndex); 
			var id=obj.parentNode.parentNode.id; 
			DHTMLSuite.discardElement(obj); 
			var obj2=document.getElementById('tabView'+this.tabSetParentId+'_'+tabIndex); 
			DHTMLSuite.discardElement(obj2); 
			this.__resetTabIds(this.tabSetParentId); 
			this.initActiveTabIndex=-1; 
			var newIndex=0; 
			if(refToTabViewObjects[this.outsideObjectRefIndex].activeTabIndex==tabIndex)refToTabViewObjects[this.outsideObjectRefIndex].activeTabIndex=-1; 
			this.__showTab(this.tabSetParentId,newIndex,this.outsideObjectRefIndex); 
			}		 
		}	 
	} 
	 
	// }}}	 
	,		
	// {{{ addContentToTab() 
	 /** 
	 *Add content to a tab dynamically. 
	 * 
	 *@param String tabLabel=Label of tab to delete(Optional) 
	 *@param String filePath=Path to file you want to show inside the tab. 
	* 
	 *@public 
	*/	 
	addContentToTab:function(tabLabel,filePath) 
	{	 
		var index=this.getTabIndexByTitle(tabLabel);	 
		// Get index of tab 
		if(index!=-1){	 
		// Tab found 
			this.dynamicContentObj.loadContent('tabView'+this.tabSetParentId+'_'+index,filePath);	 
		} 
	} 
	 
	// }}}	 
	, 
	
	// {{{ displayATab() 
	 /** 
	 *Display a tab manually 
	 * 
	 *@param String tabTitle=Label of tab to show(Optional) 
	 *@param Int tabIndex=Index of tab to show(Optional) 
	* 
	 *@public 
	*/	 

	displayATab:function(tabLabel,tabIndex) 
	{	 
		if(tabLabel){	 
		// Delete tab by tab title 
			var index=this.getTabIndexByTitle(tabLabel);	 
		// Get index of tab 
			if(index!=-1){	 
		// Tab exists if index<>-1 
			this.initActiveTabIndex=index; 
			}else return false; 
			 
		}else{ 
			this.initActiveTabIndex=tabIndex; 
		} 
	
		this.__showTab(this.tabSetParentId,this.initActiveTabIndex,this.outsideObjectRefIndex) 
	}	 
	 
	// }}}	 
	,		
	
	// {{{ getTabIndex() 
	 /** 
	 *Return index of active tab 
	 * 
	 *@type Integer tabIndex=Index of active tab(0=first tab) 
	* 
	 *@public 
	*/	 
	getTabIndex:function() 
	{ 
		var divs=this.DHTMLSuite_tabObj.getElementsByTagName('DIV'); 
		var tabIndex=0; 
		for(var no=0;no<divs.length;no++){ 
			if(divs[no].id.indexOf('tabTab')>=0){ 
			if(divs[no].className!='tabInactive')return tabIndex; 
			tabIndex++;	 
			} 
		}	 
		 
		//tabInactive	 
		return tabIndex;	 
	}	 
	 
	// }}} 
	,	 
	 
	 
	// {{{ __setPadding() 
	 /** 
	 *Set padding on tabs 
	 * 
	 *@private 
	*/	 
	__setPadding:function(obj,padding){ 
		var span=obj.getElementsByTagName('SPAN')[0]; 
		span.style.paddingLeft=padding+'px';	 
		span.style.paddingRight=padding+'px';	 
	}	 
	 
	// }}}	 
	, 
	 
	// {{{ __showTab() 
	 /** 
	 *Set padding 
	 * 
	 *@param String parentId=id of parent div 
	 *@param Int tabIndex=Index of tab to show 
	 *@param Int objectIndex=Index of refToTabViewObjects, reference to the object of this class. 
	* 
	 *@private 
	*/	 
	__showTab:function(parentId,tabIndex,objectIndex) 
	{ 
		var parentId_div=parentId+"_"; 
		if(!document.getElementById('tabView'+parentId_div+tabIndex)){		 
			return; 
		} 
		 
		if(refToTabViewObjects[objectIndex].activeTabIndex>=0){ 
			if(refToTabViewObjects[objectIndex].activeTabIndex==tabIndex){ 
			return; 
			}	 
			var obj=document.getElementById('tabTab'+parentId_div+refToTabViewObjects[objectIndex].activeTabIndex);	 
			if(!obj){ 
			refToTabViewObjects[objectIndex].activeTabIndex=0; 
			var obj=document.getElementById('tabTab'+parentId_div+refToTabViewObjects[objectIndex].activeTabIndex);	 
			} 
			obj.className='tabInactive'; 
			obj.style.backgroundImage='url(\''+DHTMLSuite.configObj.imagePath+'tab-view/tab_left_inactive.gif'+'\')'; 
			var imgs=obj.getElementsByTagName('IMG'); 
			var img=imgs[imgs.length-1]; 
			img.src=DHTMLSuite.configObj.imagePath+'tab-view/tab_right_inactive.gif'; 
			document.getElementById('tabView'+parentId_div+refToTabViewObjects[objectIndex].activeTabIndex).style.display='none'; 
		} 
		 
		var thisObj=document.getElementById('tabTab'+ parentId_div +tabIndex);	 
			 
		thisObj.className='tabActive'; 
		thisObj.style.backgroundImage='url(\''+DHTMLSuite.configObj.imagePath+'tab-view/tab_left_active.gif'+'\')'; 
		var imgs=thisObj.getElementsByTagName('IMG'); 
		var img=imgs[imgs.length-1];	 
		img.src=DHTMLSuite.configObj.imagePath+'tab-view/tab_right_active.gif'; 
		 
		document.getElementById('tabView'+parentId_div+tabIndex).style.display='block'; 
		this.refActiveTabContent=document.getElementById('tabView'+parentId_div+tabIndex); 
		refToTabViewObjects[objectIndex].activeTabIndex=tabIndex; 
		 
		refToTabViewObjects[objectIndex].__handleCallback('tabSwitch'); 
	
		var parentObj=thisObj.parentNode; 
		var aTab=parentObj.getElementsByTagName('DIV')[0]; 
		countObjects=0; 
		var startPos=2; 
		var previousObjectActive=false; 
		while(aTab){ 
			if(aTab.tagName=='DIV'){ 
			if(previousObjectActive){ 
				previousObjectActive=false; 
				startPos-=2; 
			} 
			if(aTab==thisObj){ 
				startPos-=2; 
				previousObjectActive=true; 
				refToTabViewObjects[objectIndex].__setPadding(aTab,refToTabViewObjects[objectIndex].textPadding+1); 
			}else{ 
				refToTabViewObjects[objectIndex].__setPadding(aTab,refToTabViewObjects[objectIndex].textPadding); 
			} 
			 
			aTab.style.left=startPos+'px'; 
			countObjects++; 
			startPos+=2; 
			}		 
			aTab=aTab.nextSibling; 
		} 
		 
		return; 
	} 
	 
	// }}} 
	, 
	 
	// {{{ __handleCallback() 
	 /** 
	 *Set padding 
	 * 
	 *@param String action=Which call back action 
	* 
	 *@private 
	*/	 
	__handleCallback:function(action) 
	{	 
		var callbackString=''; 
		switch(action) 
		{ 
			case "tabSwitch": 
			callbackString=this.callbackOnTabSwitch;		 
			break;		 
		}	 
		 
		if(callbackString){ 
			callbackString=callbackString+'(this.refActiveTabContent)'; 
			eval(callbackString); 
		}	 
	} 
	 
	// }}}	 
	, 
	 
	// {{{ tabClick() 
	 /** 
	 *Set padding 
	 * 
	 *@param String parentId=id of parent div 
	 *@param Int tabIndex=Index of tab to show 
	* 
	 *@private 
	*/	 
	__tabClick:function(inputObj,index) 
	{ 
		var idArray=inputObj.id.split('_');	 
		var parentId=inputObj.getAttribute('parentRefId'); 
		if(!parentId)parentId=inputObj.parentRefId; 
		this.__showTab(parentId,idArray[idArray.length-1].replace(/[^0-9]/gi,''),index); 
	 
	}	 
	 
	// }}} 
	, 
	 
	// {{{ rolloverTab() 
	 /** 
	 *Set padding 
	 * 
	* 
	 *@private 
	*/	 
	__rolloverTab:function() 
	{ 
		if(this.className.indexOf('tabInactive')>=0){ 
			this.className='inactiveTabOver'; 
			this.style.backgroundImage='url(\''+DHTMLSuite.configObj.imagePath+'tab-view/tab_left_over.gif'+'\')'; 
			var imgs=this.getElementsByTagName('IMG'); 
			var img=imgs[imgs.length-1]; 
			 
			img.src=DHTMLSuite.configObj.imagePath+'tab-view/tab_right_over.gif'; 
		} 
	 
	}	 
	 
	// }}} 
	,	 
	 
	// {{{ rolloutTab() 
	 /** 
	 * 
	* 
	 *@private 
	*/		 
	__rolloutTab:function() 
	{ 
		if(this.className== 'inactiveTabOver'){ 
			this.className='tabInactive'; 
			this.style.backgroundImage='url(\''+DHTMLSuite.configObj.imagePath+'tab-view/tab_left_inactive.gif'+'\')'; 
			var imgs=this.getElementsByTagName('IMG'); 
			var img=imgs[imgs.length-1]; 
			img.src=DHTMLSuite.configObj.imagePath+'tab-view/tab_right_inactive.gif'; 
		}	 
	} 
	 
	// }}} 
	, 
	 
	// {{{ __initializeAndParseTabs() 
	 /** 
	 * 
	 *@param Int additionalTab=Additional tabs to the existing 
	 *@param String nameOfAdditionalTab=Title of additional tab. 
	* 
	 *@private 
	*/	 
	__initializeAndParseTabs:function(additionalTab,nameOfAdditionalTab,additionalCloseButton) 
	{ 
		this.DHTMLSuite_tabObj.className=' DHTMLSuite_tabWidget'; 
		 
		window.refToThisTabSet=this; 
		if(!additionalTab||additionalTab=='undefined'){		 
			this.DHTMLSuite_tabObj=document.getElementById(this.tabSetParentId); 
			this.width=this.width+''; 
			if(this.width.indexOf('%')<0)this.width= this.width+'px'; 
			this.DHTMLSuite_tabObj.style.width=this.width; 
				 
			this.height=this.height+''; 
			if(this.height.length>0){ 
			if(this.height.indexOf('%')<0)this.height= this.height+'px'; 
			this.DHTMLSuite_tabObj.style.height=this.height; 
			} 
			 
			var tabDiv=document.createElement('DIV');	 
			var firstDiv=this.DHTMLSuite_tabObj.getElementsByTagName('DIV')[0];	 
			 
			this.DHTMLSuite_tabObj.insertBefore(tabDiv,firstDiv);	 
			tabDiv.className='DHTMLSuite_tabContainer';		 
			this.tabView_countTabs=0; 
			var tmpTabTitles=this.tabTitles;	 
		// tmpTab titles set to current tab titles-this variable is used in the loop below 
							 
		// We don't want to loop through all the tab titles in the object when we add a new one manually. 
			 
		}else{	 
		// A new tab being created dynamically afterwards. 
			var tabDiv=this.DHTMLSuite_tabObj.getElementsByTagName('DIV')[0]; 
			var firstDiv=this.DHTMLSuite_tabObj.getElementsByTagName('DIV')[1]; 
			this.initActiveTabIndex=this.tabView_countTabs;	 
			var tmpTabTitles=Array(nameOfAdditionalTab);	 
		// tmpTab titles set to only the new tab 
		}		 
		for(var no=0;no<tmpTabTitles.length;no++){ 
			var aTab=document.createElement('DIV'); 
			aTab.id='tabTab'+this.tabSetParentId+"_"+ (no+this.tabView_countTabs); 
			aTab.onmouseover=this.__rolloverTab; 
			aTab.onmouseout=this.__rolloutTab; 
			aTab.setAttribute('parentRefId',this.tabSetParentId); 
			aTab.parentRefId=this.tabSetParentId; 
			var numIndex=window.refToThisTabSet.outsideObjectRefIndex+''; 
			aTab.onclick=function(){ window.refToThisTabSet.__tabClick(this,numIndex); }; 
			DHTMLSuite.commonObj.__addEventEl(aTab); 
			aTab.className='tabInactive'; 
			aTab.style.backgroundImage='url(\''+DHTMLSuite.configObj.imagePath+'tab-view/tab_left_inactive.gif'+'\')'; 
			tabDiv.appendChild(aTab); 
			var span=document.createElement('SPAN'); 
			span.innerHTML=tmpTabTitles[no]; 
			aTab.appendChild(span); 
	
			if((!additionalTab&&this.closeButtons[no])||(additionalTab&&additionalCloseButton)){		 
			var closeButton=document.createElement('IMG'); 
			closeButton.src=DHTMLSuite.configObj.imagePath+'tab-view/tab-view-close.gif'; 
			closeButton.style.position='absolute'; 
			closeButton.style.top='4px'; 
			closeButton.style.right='2px'; 
			closeButton.onmouseover=this.__mouseOverEffectCloseButton; 
			closeButton.onmouseout=this.__mouseOutEffectForCloseButton; 
			DHTMLSuite.commonObj.__addEventEl(closeButton); 
			span.innerHTML=span.innerHTML+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';		 
			var deleteTxt=span.innerHTML+''; 
			closeButton.onclick=function(){ refToTabViewObjects[numIndex].deleteTab( this.parentNode.innerHTML)}; 
			span.appendChild(closeButton); 
			} 
				 
			var img=document.createElement('IMG'); 
			img.valign='bottom'; 
			img.src=DHTMLSuite.configObj.imagePath+'tab-view/tab_right_inactive.gif'; 
			 
		// IE5.X FIX 
			if((DHTMLSuite.clientInfoObj.navigatorVersion&&DHTMLSuite.clientInfoObj.navigatorVersion<6)||(DHTMLSuite.clientInfoObj.isMSIE&&!this.strictDocType)){ 
			img.style.styleFloat='none'; 
			img.style.position='relative';	 
			img.style.top='4px' 
			span.style.paddingTop='4px'; 
			aTab.style.cursor='hand'; 
			}	 
		// End IE5.x FIX 
			aTab.appendChild(img); 
		} 
	
		var tabs=this.DHTMLSuite_tabObj.getElementsByTagName('DIV'); 
		var divCounter=0; 
		for(var no=0;no<tabs.length;no++){ 
			if(tabs[no].className=='DHTMLSuite_aTab'&&tabs[no].parentNode==this.DHTMLSuite_tabObj){ 
			if(this.height.length>0){ 
				if(this.height.indexOf('%')==-1){ 
				var tmpHeight=(this.height.replace('px','')/1-22); 
				tabs[no].style.height=tmpHeight+'px'; 
				}else 
				tabs[no].style.height=this.height; 
			} 
			tabs[no].style.display='none'; 
			if(tabs[no].id){ 
				tabs[no].setAttribute('originalId',tabs[no].id); 
				tabs[no].originalId=tabs[no].id;			 
			} 
			tabs[no].id='tabView'+this.tabSetParentId+"_"+divCounter; 
			divCounter++; 
			}		 
		}	 
		if(additionalTab){ 
			this.tabView_countTabs++; 
		}else{ 
			this.tabView_countTabs=this.tabView_countTabs+this.tabTitles.length;	 
		} 
		 
		this.__showTab(this.tabSetParentId,this.initActiveTabIndex,this.outsideObjectRefIndex); 
	
		return this.activeTabIndex; 
	} 
	 
	// }}}	 
	, 
	 
	// {{{ __mouseOutEffectForCloseButton() 
	 /** 
	 * 
	 *@private 
	*/			
	__mouseOutEffectForCloseButton:function() 
	{ 
		this.src=this.src.replace('close-over.gif','close.gif');	 
	}	 
	 
	// }}}	 
	,	 
	 
	// {{{ __mouseOverEffectCloseButton() 
	 /** 
	 * 
	 *@private 
	*/			
	__mouseOverEffectCloseButton:function() 
	{ 
		this.src=this.src.replace('close.gif','close-over.gif');	 
	}	 
	 
	// }}}	 
	,	 
	 
	// {{{ __fillTabWithContentFromAjax() 
	 /** 
	 * 
	*@param Int ajaxIndex=Index of Ajax array 
	*@param String objId=Id of element where content from Ajax should be displayed 
	*@param Int tabId=Id of element where content from Ajax should be displayed 
	* 
	 *@private 
	*/			
	__fillTabWithContentFromAjax:function(ajaxIndex,objId,tabId) 
	{ 
		var obj=document.getElementById('tabView'+objId+'_'+tabId); 
		obj.innerHTML=this.ajaxObjects[ajaxIndex].response;	 
	}	 
	 
	// }}}	 
	, 
	 
	// {{{ __resetTabIds() 
	 /** 
	 * 
	 *@private 
	*/	 
	__resetTabIds:function(parentId) 
	{ 
		var tabTitleCounter=0; 
		var tabContentCounter=0;	 
		var divs=this.DHTMLSuite_tabObj.getElementsByTagName('DIV');	 
	
		for(var no=0;no<divs.length;no++){ 
			if(divs[no].className=='DHTMLSuite_aTab'&&divs[no].parentNode==this.DHTMLSuite_tabObj){ 
			divs[no].id='tabView'+parentId+'_'+tabTitleCounter; 
			tabTitleCounter++; 
			} 
			if(divs[no].id.indexOf('tabTab')>=0&&divs[no].parentNode.parentNode==this.DHTMLSuite_tabObj){ 
			divs[no].id='tabTab'+parentId+'_'+tabContentCounter;	 
			tabContentCounter++; 
			}	 
				 
		}	 
		this.tabView_countTabs=tabContentCounter; 
	} 
	 
	// }}}	 
	, 
	 
	// {{{ getTabIndexByTitle() 
	 /** 
	 * 
	 *@private 
	*/	 
	getTabIndexByTitle:function(tabTitle) 
	{ 
		tabTitle=tabTitle.replace(/(.*?)&nbsp.*$/gi,'$1'); 
		var divs=this.DHTMLSuite_tabObj.getElementsByTagName('DIV'); 
		 
		for(var no=0;no<divs.length;no++){ 
			if(divs[no].id.indexOf('tabTab')>=0){ 
			var span=divs[no].getElementsByTagName('SPAN')[0];	 
			var spanTitle=span.innerHTML.replace(/(.*?)&nbsp.*$/gi,'$1'); 
			if(spanTitle==tabTitle){ 
				var tmpId=divs[no].id.split('_');			 
				return tmpId[tmpId.length-1].replace(/[^0-9]/g,'')/1; 
			}	 
			} 
		}	 
		return -1;	 
	} 
	, 
	// batur 
	// {{{ getTabTitle() 
	 /** 
	 * return active tab title 
	 *@public 
	*/		 
	getTabTitle:function() {					 
		return (this.tabTitles[this.activeTabIndex]);		 
	} 
		 
	// }}}		 
} 




/*[FILE_START:dhtmlSuite-dynamicContent.js] */	
/************************************************************************************************************
*	Ajax dynamic content script
*
*	Created:					August, 23rd, 2006
*
*			
* 	Update log:
*
************************************************************************************************************/
/**
* @constructor
* @class The purpose of this class is to load content of external files into HTML elements on your page(<a href="../../demos/demo-dynamic-content-1.html" target="_blank">demo</a>).<br>
*		 The pane splitter, window widget and the ajax tooltip script are also using this class to put external content into HTML elements.
* @version				1.0
* @version 1.0
* 
* @author	Alf Magne Kalleland(www.dhtmlgoodies.com)
**/

DHTMLSuite.dynamicContent = function()
{
	var enableCache;	// Cache enabled.
	var jsCache;
	var ajaxObjects;
	var waitMessage;
	
	this.enableCache = true;
	this.jsCache = new Object();
	this.ajaxObjects = new Array();
	this.waitMessage = 'Loading content - please wait...';
	this.waitImage = 'dynamic-content/ajax-loader-darkblue.gif';
	try{
		if(!standardObjectsCreated)DHTMLSuite.createStandardObjects();	// This line starts all the init methods
	}catch(e){
		alert('You need to include the dhtmlSuite-common.js file');
	}
	var objectIndex;
	
	this.objectIndex = DHTMLSuite.variableStorage.arrayDSObjects.length;
	DHTMLSuite.variableStorage.arrayDSObjects[this.objectIndex] = this;
		
}

DHTMLSuite.dynamicContent.prototype = {

	// {{{ loadContent()
    /**
     * Load content from external files into an element on your web page.
     *
     * @param String divId = Id of HTML element
     * @param String url = Path to content on the server(Local content only)
     * @param String functionToCallOnLoaded = Function to call when ajax is finished. This string will be evaulated, example of string: "fixContent()" (with the quotes).
     * 
     * @public
     */	
	loadContent : function(divId,url,functionToCallOnLoaded)
	{
		
		var ind = this.objectIndex;
		if(this.enableCache && this.jsCache[url]){
			document.getElementById(divId).innerHTML = this.jsCache[url];
			DHTMLSuite.commonObj.__evaluateJs(divId);
			DHTMLSuite.commonObj.__evaluateCss(divId);	
			if(functionToCallOnLoaded)eval(functionToCallOnLoaded);	
			return;
		}
		var ajaxIndex = 0;
		
		/* Generating please wait message */
		var waitMessageToShow = '';
		if(this.waitImage){	// Wait image exists ?
			waitMessageToShow = waitMessageToShow + '<div style="text-align:center;padding:10px"><img src="' + DHTMLSuite.configObj.imagePath + this.waitImage + '" border="0" alt=""></div>';
		}
		if(this.waitMessage){	// Wait message exists ?
			waitMessageToShow = waitMessageToShow + '<div style="text-align:center">' + this.waitMessage + '</div>';
		}	
		
		if(this.waitMessage!=null && this.waitImage!=null){	
			try{
				if(waitMessageToShow.length>0)document.getElementById(divId).innerHTML=waitMessageToShow; 
			}catch(e){			
			}		
		}
		waitMessageToShow = false;
		var ajaxIndex = this.ajaxObjects.length;		
		
		try{
			this.ajaxObjects[ajaxIndex] = new sack();
		}catch(e){
			alert('Could not create ajax object. Please make sure that ajax.js is included');
		}
	
		
		
		if(url.indexOf('?')>=0){	// Get variables in the url
			this.ajaxObjects[ajaxIndex].method='GET';	// Change method to get
			var string = url.substring(url.indexOf('?'));	// Extract get variables
			url = url.replace(string,'');
			string = string.replace('?','');
			var items = string.split(/&/g);
			for(var no=0;no<items.length;no++){
				var tokens = items[no].split('=');
				if(tokens.length==2){
					this.ajaxObjects[ajaxIndex].setVar(tokens[0],tokens[1]);
				}	
			}	
			url = url.replace(string,'');
		}	

		
		
			
		this.ajaxObjects[ajaxIndex].requestFile = url;	// Specifying which file to get
		this.ajaxObjects[ajaxIndex].onCompletion = function(){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__ajax_showContent(divId,ajaxIndex,url,functionToCallOnLoaded); };	// Specify function that will be executed after file has been found
		this.ajaxObjects[ajaxIndex].onError = function(){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__ajax_displayError(divId,ajaxIndex,url,functionToCallOnLoaded); };	// Specify function that will be executed after file has been found
		this.ajaxObjects[ajaxIndex].runAJAX();		// Execute AJAX function	
	}
	// }}}		
	,
	// {{{ setWaitMessage()
    /**
     * Specify which message to show when Ajax is busy.
     *
     * @param String newWaitMessage = New wait message (Default = "Loading content - please wait") - use false if you don't want any wait message
     * 
     * @public
     */		
	setWaitMessage : function(newWaitMessage)
	{
		this.waitMessage = newWaitMessage;		
	}
	// }}}
	,
	// {{{ setWaitImage()
    /**
     * Specify an image to show when Ajax is busy working.
     *
     * @param String newWaitImage = New wait image ( default = ajax-loader-blue.gif - it is by default located inside the image_dhtmlsuite folder. - If you like a new image, try to generate one at http://www.ajaxload.info/
     * 
     * @public
     */		
	setWaitImage : function(newWaitImage)
	{
		this.waitImage = newWaitImage;
	}
	// }}}
	,
	// {{{ setCache()
    /**
     * Cancel selection when drag is in process
     *
     * @param Boolean enableCache = true if you want to enable cache, false otherwise(default is true). You can also send HTMl code in here, example an &lt;img> tag.
     * 
     * @public
     */		
	setCache : function(enableCache)
	{
		this.enableCache = enableCache;		
	}
	// }}}
	,
	// {{{ __ajax_showContent()
    /**
     * Evaluate Javascript in the inserted content
     *
     * @private
     */		
	__ajax_showContent :function(divId,ajaxIndex,url,functionToCallOnLoaded)
	{
		document.getElementById(divId).innerHTML = '';
		document.getElementById(divId).innerHTML = this.ajaxObjects[ajaxIndex].response;
		if(this.enableCache){	// Cache is enabled
			this.jsCache[url] = document.getElementById(divId).innerHTML + '';	// Put content into cache
		}	
		DHTMLSuite.commonObj.__evaluateJs(divId);	// Call private method which evaluates JS content
		DHTMLSuite.commonObj.__evaluateCss(divId);	// Call private method which evaluates JS content
		if(functionToCallOnLoaded)eval(functionToCallOnLoaded);
		this.ajaxObjects[ajaxIndex] = null;	// Clear sack object
		return false;
	}
	// }}}
	,
	// {{{ __ajax_displayError()
    /**
     * Display error message when the request failed.
     *
     * @private
     */		
	__ajax_displayError : function(divId,ajaxIndex,url,functionToCallOnLoaded)
	{
		document.getElementById(divId).innerHTML = '<h2>Message from DHTMLSuite.dynamicContent</h2><p>The ajax request for ' + url + ' failed</p>';		
	}
	// }}}		
}


