/**
 * @fileoverview
 * The following file contains all object which allow to display an ajax page, those object must
 * extend of CW_AjaxPage_MODEL and are used with CW_AjaxPage_Manager object in order to be displayed
 */
/**
 * @class the following class allow to display the "home" page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>home</td>
 *			<td>home</td>
 *			<td>X_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_home () {this.initialize();}
CW_AjaxPage_home.prototype = {
	/**
	 * The foolowing function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: home</li>
	 * 		<li>statId: home</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 */
	initialize: function(){
		this.name = "home";
		this.statId = "home";
		this.menuId = "X_X";
		this.classStyle = "index";
	},
	/**
	 * The following function allow to load html/home/home.html html template in the htmlDivElement identified by "masterPage" and:
	 * <ul>
	 * 		<li>display the 3 showcase videos </li>
	 * 		<li>display the 6 last uploaded videos </li>
	 * 		<li>display the video home category list </li>
	 * <ul>
	 * Then set the history page, with dhtmlHistory.add("Home");
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see #_displayShowcaseVideo
	 * @see #_displayLastVideo
	 * @see #_displayCategory
	 */
	display:function(params,identifier){
		CW_comwebAjax.loadHtml("html/home/home.html","masterPage");
		CW_comwebAjax.loadHtml("html/home/homeListing.html","topListHome");
		this._displayShowcaseVideo();
		this._displayMostViewVideo();
		this._displayLastVideo();
		//this._displayLastPhoto();
		//this._displayLastMember();
		this._displayCategory();
		//this._displayPlaylist();
		dhtmlHistory.add("Home");
	},
	/**
	 * The following function allow to display the 3 first showcase videos in the HtmlDivElement
	 * identified by "videooftheday where html/video/videoOfTheDay.html  html template was loaded.
	 * In order to realise this, this function used CW_comwebAjax to load the html template, and
	 * CW_Action_Site.displayShowcaseMedia with _displayShowcaseVideoCallback callback to retrieve
	 * and display the 3 showcase video
	 *
	 * @see CW_comwebAjax#loadHtml
	 * @see CW_Action_Site#displayShowcaseMedia
	 * @see #_displayShowcaseVideoCallback
	 * @return {void}
	 */
	_displayShowcaseVideo:function(){

		if (CacheManager.contentFirstShowcaseVideo!=null){
			document.getElementById("videooftheday").innerHTML = CacheManager.contentFirstShowcaseVideo;
		}else{
			CW_comwebAjax.loadHtml("html/video/videoOfTheDay.html","videooftheday");
		}
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayShowcaseVideoCallback";
		CW_Filter.setOrderFilterValue(CW_Filter.Filter_MEDIA,CW_util.getFormElement(document.forms["formVideoUneHome"],"listing.order"));
		document.forms["formVideoUneHome"].style.display = "none";		
		CW_Action_Site.displayShowcaseMedia(callback,CW_Action_Media.Media_TYPE_VIDEO,1,3,null);
	},

	/**
	 * The following function is the _displayShowcaseVideo callback. So the comwebBean is the result of the
	 * CW_Action_Site.displayShowcaseMedia action and in this case contain the first 3 showcase video. after
	 * has retrieve the showcase videos the first one is displayed in the htmldivelement identified by
	 * "videoUne_home_left" with loadBrick_video_videoOfTheDayLeftElement function, and the 2 others are
	 * displayed in the htmldivelement identified by"videoUne_home_right_element" with loadBrick_video_videoOfTheDayRightElement function,
	 * *
	 * @see GLOBALS#loadBrick_video_videoOfTheDayLeftElement
	 * @see GLOBALS#loadBrick_video_videoOfTheDayLeftElement
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_Site.displayShowcaseMedia launched by _displayShowcaseVideo
	 * @param {RequestResume} requestResume request resume of CW_Action_Site.displayShowcaseMedia launched by _displayShowcaseVideo
	 * @return {void}
	 */
	_displayShowcaseVideoCallback:function(comwebBean, requestResume){

		var comwebBeanMediaArray = comwebBean.getSpecificChildren('list')[0].getSpecificChildren('media');
		var comwebBeanMedia = null;
		var previewMedia = null;
		var uid =0;
		var href="";
		var listingParam = requestResume.queryString;
		if (comwebBeanMediaArray.length >0){
			if (CacheManager.contentFirstShowcaseVideo==null){
				comwebBeanMedia = comwebBeanMediaArray[0];
				uid = comwebBeanMedia.getUid();
				href = "goToMediaPlay('" + listingParam+"',"+uid+" );";
				loadBrick_video_videoOfTheDayLeftElement(comwebBeanMedia,"videoUne_home_left",href);
			}
			var parentDiv = document.getElementById("videoUne_home_right_element");
			parentDiv.innerHTML = "";
			for (var i=1;i<3 && i< comwebBeanMediaArray.length;i++){
				comwebBeanMedia = comwebBeanMediaArray[i];
				uid = comwebBeanMedia.getUid();
				href = "goToMediaPlay('" + listingParam+"',"+uid+" );";
				loadBrick_video_videoOfTheDayRightElement(comwebBeanMedia,"videoUne_home_right_element",href,true);
			}
		}
	},

	/**
	 * The following function allow to display the 4 last uploaded videos in the HtmlDivElement
	 * identified by "topListHome where html/home/homeListing.html  html template was loaded.
	 * In order to realise this, this function used CW_comwebAjax to load the html template, and
	 * CW_Action_Media.displayLastMediaList with _displayLastVideoCallback callback to retrieve
	 * and display the 4 videos
	 *
	 * @see CW_comwebAjax#loadHtml
	 * @see CW_Action_Media#displayLastMediaList
	 * @see #_displayLastVideoCallback
	 * @return {void}
	 */
	 _displayLastVideo:function(){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayLastVideoCallback";
		CW_Action_Media.displayLastMediaList(callback,6,CW_Action_Media.Media_TYPE_VIDEO);
	 },

	 /* Disabled, the fonction _displayMostViewedVideo in _config.js already load most viewed videos */
	  _displayMostViewVideo:function(){
		//var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayMostViewVideoCallback";
		//CW_Action_Media.displayMediaList(callback,4,CW_Action_Media.Media_TYPE_VIDEO,CW_Filter.SINCE_THISWEEK,CW_Filter.ORDER_MOSTVIEWED);
	 },


 _displayMostViewVideoCallback:function(comwebBean, requestResume){
		var comwebBeanListMediaArray = comwebBean.getSpecificChildren("list");
		var uid=0;
		var href="";
		var divId ="mostviewVideoListHomeContent";
		var listingParam = requestResume.queryString;

		if(comwebBeanListMediaArray.length>0){
			var comwebBeanMediaArray = comwebBeanListMediaArray[0].getSpecificChildren("media");
			if(comwebBeanMediaArray.length>0){
				for(var i=0;i<comwebBeanMediaArray.length;i++){
					var comwebBeanMedia=comwebBeanMediaArray[i];
					uid = comwebBeanMedia.getUid();
					href = "goToMediaPlay('" + listingParam+"',"+uid+" );";
					loadBrick_media_mediaElement3(comwebBeanMedia,divId,href,true);
				}
			}
		}
	 },
	/*
	 * The following function is the _displayLastVideo callback. So the comwebBean is the result of the
	 * CW_Action_Site.displayLastMediaList action and in this case contain the 4 last uploaded videos. after
	 * has retrieve the 4 videos, videos are displayed in the htmldivelement identified by
	 * "videoTopListHomeContent" with loadBrick_media_mediaElement3 function
	 *
	 * @see GLOBALS#loadBrick_media_mediaElement3
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_Media.displayLastMediaListlaunched by _displayLastVideo
	 * @param {RequestResume} requestResume request resume of CW_Action_Media.displayLastMediaList launched by _displayLastVideo
	 * @return {void}
	 */
	 _displayLastVideoCallback:function(comwebBean, requestResume){
		var comwebBeanListMediaArray = comwebBean.getSpecificChildren("list");
		var uid=0;
		var href="";
		var divId ="videoTopListHomeContent";
		var listingParam = requestResume.queryString;

		if(comwebBeanListMediaArray.length>0){
			var comwebBeanMediaArray = comwebBeanListMediaArray[0].getSpecificChildren("media");
			if(comwebBeanMediaArray.length>0){
				for(var i=0;i<comwebBeanMediaArray.length;i++){
					var comwebBeanMedia=comwebBeanMediaArray[i];
					uid = comwebBeanMedia.getUid();
					href = "goToMediaPlay('" + listingParam+"',"+uid+" );";
					loadBrick_media_mediaElement2(comwebBeanMedia,divId,href,true);
					//loadBrick_media_mediaElement3(comwebBeanMedia,divId,href,true); modif mat 04_01
				}
			}
		}
	 },
	 /**
	 * The following function allow to display the 3 last uploaded photos in the HtmlDivElement
	 * identified by "photoTopListHome" where html/home/homeListing.html  html template was loaded.
	 * In order to realise this, this function used CW_comwebAjax to load the html template, and
	 * CW_Action_Media.displayLastMediaList with _displayLastPhotoCallback callback to retrieve
	 * and display the 3 photos
	 *
	 * @see CW_comwebAjax#loadHtml
	 * @see CW_Action_Media#displayLastMediaList
	 * @see #_displayLastPhotoCallback
	 * @return {void}
	 */
	 _displayLastPhoto:function(){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayLastPhotoCallback";
		CW_Action_Media.displayLastMediaList(callback,3,CW_Action_Media.Media_TYPE_IMAGE);
	 },

	 /**
	 * The following function is the _displayLastPhoto callback. So the comwebBean is the result of the
	 * CW_Action_Site.displayLastMediaList action and in this case contain the 3 last uploaded photos. after
	 * has retrieve the 3 photos, photos are displayed in the htmldivelement identified by
	 * "photoTopListHomeContent" with loadBrick_media_mediaElement3 function
	 *
	 * @see GLOBALS#loadBrick_media_mediaElement3
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_Media.displayLastMediaListlaunched by _displayLastVideo
	 * @param {RequestResume} requestResume request resume of CW_Action_Media.displayLastMediaList launched by _displayLastVideo
	 * @return {void}
	 */
	 _displayLastPhotoCallback:function(comwebBean, requestResume){
		var comwebBeanListMediaArray = comwebBean.getSpecificChildren("list");
		var uid=0;
		var href="";
		var divId ="photoTopListHomeContent";
		var listingParam = requestResume.queryString;

		if(comwebBeanListMediaArray.length>0){
			var comwebBeanMediaArray = comwebBeanListMediaArray[0].getSpecificChildren("media");
			if(comwebBeanMediaArray.length>0){
				for(var i=0;i<comwebBeanMediaArray.length;i++){
					var comwebBeanMedia=comwebBeanMediaArray[i];
					uid = comwebBeanMedia.getUid();
					href = "goToMediaPlay('" + listingParam+"',"+uid+" );";
					loadBrick_media_mediaElement3(comwebBeanMedia,divId,href,true);
				}
			}
		}
	 },
	 /**
	 * The following function allow to display the 4 last members in the HtmlDivElement
	 * identified by "memberTopListHomeContent" where html/home/homeListing.html  html template was loaded.
	 * In order to realise this, this function used CW_comwebAjax to load the html template, and
	 * CW_Action_User.displayLastUserList with _displayLastMemberCallback callback to retrieve
	 * and display the 4 members
	 *
	 * @see CW_comwebAjax#loadHtml
	 * @see CW_Action_User#displayLastUserList
	 * @see #_displayLastPhotoCallback
	 * @return {void}
	 */
	 _displayLastMember:function(){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayLastMemberCallback";
		CW_Action_User.displayLastUserList(callback,4,false,null);
	 },

	 _displayLastMemberCallback:function(comwebBean, requestResume){
	 		var comwebBeanListUserArray = comwebBean.getSpecificChildren("list");
			var divId = "memberTopListHomeContent";
			if(comwebBeanListUserArray.length>0){
				var comwebBeanUserArray = comwebBeanListUserArray[0].getSpecificChildren("user");
				if(comwebBeanUserArray.length>0){
					for(var i=0;i<comwebBeanUserArray.length;i++){
						var comwebBeanUser=comwebBeanUserArray[i];
						loadBrick_member_memberElement2(comwebBeanUser,divId,true);
						//loadBrick_member_memberElement(comwebBeanUser,"html/member/memberElement.html",divId,true);
					}
				}
			}
	 },
	/**
	 * The following function allow to display the video home category list in the HtmlDivElement
	 * identified by "categoryHome" where html/category/categoryHome.html  html template was loaded.
	 * In order to realise this, this function used CW_comwebAjax to load the html template, and
	 * CW_Action_Site.displayCategoryHome with _displayCategoryCallback callback to retrieve
	 * and display the video home category
	 *
	 * @see CW_comwebAjax#loadHtml
	 * @see CW_Action_Site#displayCategoryHome
	 * @see #_displayCategoryCallback
	 * @return {void}
	 */
	 _displayCategory:function(){
	 	//CW_comwebAjax.loadHtml("html/category/categoryHome.html","categoryHome");
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayCategoryCallback";
		CW_Action_Site.displayCategoryHome(callback,CW_Action_Media.Media_TYPE_VIDEO,false);
	 },
	/**
	 * The following function is the _displayCategory callback. So the comwebBean is the result of the
	 * CW_Action_Site.displayCategoryHome action and in this case contain the video home category. after
	 * has retrieve the video home category, categories are displayed in the htmldivelement identified by
	 * "category_home_all" with loadBrick_category_categoryHomeElement function
	 *
	 * @see GLOBALS#loadBrick_category_categoryHomeElement
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_Site.displayCategoryHome launched by _displayLastVideo
	 * @param {RequestResume} requestResume request resume of CW_Action_Site.displayCategoryHome launched by _displayLastVideo
	 * @return {void}
	 */
	 _displayCategoryCallback:function(comwebBean, requestResume){
		var comwebBeanCategoryArray = comwebBean.getSpecificChildren("category");
		for (var i=0;i<comwebBeanCategoryArray.length;i++){
			var comwebBeanCategory = comwebBeanCategoryArray[i];
			loadBrick_category_categoryHomeElement(comwebBeanCategory,"category_home_all","href",true);
		}
	 },

	/**
	 */
	_displayPlaylist:function(){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayPlaylistCallback";
		var parameters = new Array();
		parameters.push("action=get.pl");
		parameters.push("listing.nbre.elements=4");
		parameters.push("listing.order=0");
		parameters.push("listing.page=1");
		parameters.push("listing.since=0");
		//the site.uid parameter is automatically  set by ajax
		CW_comwebAjax.sendRequest(CW_Action_User.SERVLET_URI,callback,null,'homeplaylist',parameters,null);
	},
	_displayPlaylistCallback:function(comwebBean, requestResume){
		var comwebBeanGroupArray = comwebBean.getSpecificChildren("list")[0].getSpecificChildren("group");
		for (var i=0;i<comwebBeanGroupArray.length;i++){
			var comwebBeanGroup = comwebBeanGroupArray[i];
			loadBrick_playlist_playlistElement2(comwebBeanGroup,"playlistListHomeContent","href",true);
			//loadBrick_playlist_palylistElement2(comwebBeanGroup,"playlistListHomeContent","href",true);			
		}
	}

}
//set the extends class
CW_AjaxPage_home.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_home.prototype);
/**
 * @class the following class allow to display the "player" page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>player</td>
 *			<td>player</td>
 *			<td>X_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no default parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_player () {this.initialize();}
CW_AjaxPage_player.prototype = {
	/**
	 * The foolowing function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: player</li>
	 * 		<li>statId: player</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "player";
		this.statId = "player";
		this.menuId = "X_X";
	},
	/**
	 * The following function allow to load html/media/mediaPlay.html html template in the htmlDivElement identified by "masterPage",
	 * then load html/media/mediaPlay_player.html html template in the htmlDivElement identified by "playerBrowserContainer", and:
	 * <ul>
	 * 		<li>display the flash player and browser, which illustrate the media listing identified by given identifier </li>
	 * <ul>
	 * Then set the history page, with dhtmlHistory.add("Player:" + [first media id] + "/"+[flash listing parameters]);
	 * @param {String} params not used
	 * @param {String} identifier determines the media listing given to the flash browser, this string must be like "[first media id]/[flash listing parameters]"
	 * @see GLOBALS#setBrowserAndPlayer
	 * @return {void}
	 */
	display:function(params,identifier){
		var mediaId = identifier.substr(0,identifier.indexOf("/"));
		var listingParams = identifier.substring(identifier.indexOf("/") + 1);
		/*if (params == null){
			var dhtmlHistoryParam = "";
			var HashTableQueryString =  new String(listingParams).toHashTable('&');
			switch(parseInt(HashTableQueryString.get("media.type"))){
				case CW_Action_Media.Media_TYPE_VIDEO : dhtmlHistoryParam += "Video/";break;
				case CW_Action_Media.Media_TYPE_IMAGE : dhtmlHistoryParam += "Photo/";break;
				case CW_Action_Media.Media_TYPE_MUSIC : dhtmlHistoryParam += "Music/";break;
				default: dhtmlHistoryParam += "Media/";break;
			}
			var page = parseInt(HashTableQueryString.get("listing.page"));
			if (page == NaN)page =1;
			dhtmlHistoryParam += "Page=" + page;

			dhtmlHistoryParam += CW_Filter.convertSinceIntToHistValue(parseInt(HashTableQueryString.get("listing.since"))) + "/";
			dhtmlHistoryParam += CW_Filter.convertOrderIntToHistValue(parseInt(HashTableQueryString.get("listing.order"))) + "/";
			dhtmlHistoryParam += "lng=" +  CW_config.langId + "/";
		}*/

		if (CacheManager.getFlashPlayerVersion() >=8){
			if (((new String(window.location.hash)).indexOf("play="+mediaId)) >=0){
				PlayerFlash.comeFromPermanentLink = true;
			}
			CW_comwebAjax.loadHtml("html/media/mediaPlay.html","masterPage");
			CW_comwebAjax.loadHtml("html/media/mediaPlay_player.html","playerBrowserContainer");
			setBrowserAndPlayer(listingParams,false,false,mediaId);
		}else{
			CW_comwebAjax.loadHtml("html/media/noFlashPlugin.html","masterPage");
		}

		dhtmlHistory.add("Player:" + mediaId + "/" + listingParams);
	}
}
//set the extends class
CW_AjaxPage_player.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_player.prototype);
/**
 * @class the following class allow to display the category page (by default display video category)
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th></tr>
 *		<tr>
 *			<td>category</td>
 *			<td>category</td>
 *			<td>4_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no default parameters</td>
  *			<td>no identifier</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_category() {this.initialize();}
CW_AjaxPage_category.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: category</li>
	 * 		<li>statId: category</li>
	 * 		<li>menuId: 4_X</li>
	 * </ul>
	 * another attribute ust be set, it's mediaTypeId attribute which has the default value CW_Action_Media.Media_TYPE_VIDEO,
	 * extended object must set it in order to display the correct media type category
	 * @return {void}
	 */
	initialize: function(){
		this.name = "category";
		this.statId = "category";
		this.menuId = "4_X";
		this.mediaTypeId = CW_Action_Media.Media_TYPE_VIDEO;

		this.classStyle = "categories";
	},
	/**
	 * The following function allow to display the mediaTypeId category list in the HtmlDivElement
	 * identified by "masterPage" where hhtml/category/categoryList.html  html template was loaded.
	 * In order to realise this, this function used CW_comwebAjax to load the html template, and
	 * CW_Action_Site.displayCategoryList with _displayCallback callback to retrieve
	 * and display the category, the category media type is determined by mediaTypeId object attribute
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @see CW_Action_Site#displayCategoryList
	 * @see #_displayCallback
	 * @return {void}
	 */
	display:function(params,identifier){
		CW_comwebAjax.loadHtml("html/category/categoryList.html","masterPage");
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayCallback";
		CW_Action_Site.displayCategoryList(callback,this.mediaTypeId ,false);
		dhtmlHistory.add(this.getHistoryPageName());
	},
	/**
	 * The following function is the _displayCallback callback. So the comwebBean is the result of the
	 * CW_Action_Site.displayCategoryList( action and in this case contain the category (the media category type
	 * is determined by mediaTypeId object attribute). after
	 * has retrieve the category, categories are displayed in the htmldivelement identified by
	 * "categoryList_container" with loadBrick_category_categoryListElement function, if there is
	 * no categoriy to display  the categoryList_container will be contain the i18n general.noContent text
	 *
	 * @see GLOBALS#loadBrick_category_categoryListElement
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_Site.displayCategoryList launched by display
	 * @param {RequestResume} requestResume request resume of CW_Action_Site.displayCategoryList launched by display
	 * @return {void}
	 */
	_displayCallback:function(comwebBean,requestResume){
		var comwebBeanCategoryArray = comwebBean.getSpecificChildren("category");
		var masterDiv = document.getElementById("categoryList_container");
		masterDiv.innerHTML = "";
		if(comwebBeanCategoryArray.length>0){
			for (var i=0;i<comwebBeanCategoryArray.length;i++){
				var comwebBeanCategory = comwebBeanCategoryArray[i];
				loadBrick_category_categoryListElement(comwebBeanCategory,"categoryList_container",true,this.mediaTypeId);
			}
		}else{
			masterDiv.innerHTML = CW_internationalization.getValue("general.noContent");
		}
	}
}
//set the extends class
CW_AjaxPage_category.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_category.prototype);
/**
 * @class the following class allow to display the video category listing page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>video_category</td>
 *			<td>video</td>
 *			<td>4_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no default parameters</td>
  *			<td>no identifier</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_category
 */
function CW_AjaxPage_video_category() {	this.initialize();}
CW_AjaxPage_video_category.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: video_category</li>
	 * 		<li>statId: video</li>
	 * 		<li>menuId: 4_X</li>
	 * </ul>
	 * the other attribute mediaTypeId (CW_AjaxPage_category attribute) take CW_Action_Media.Media_TYPE_VIDEO value because this page must displayed the video category listing
	 * @return {void}
	 */
	initialize: function(){
		this.name = "video_category";
		this.statId = "video";
		this.menuId = "4_X";
		this.mediaTypeId = CW_Action_Media.Media_TYPE_VIDEO;

		this.classStyle = "categories videos";
	}
}
//set the extends class
CW_AjaxPage_video_category.prototype = Object.extend(new CW_AjaxPage_category(),CW_AjaxPage_video_category.prototype);
/**
 * @class the following class allow to display the photo category listing page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th></tr>
 *		<tr>
 *			<td>photo_category</td>
 *			<td>photo</td>
 *			<td>4_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no default parameters</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_category
 */
function CW_AjaxPage_photo_category() {this.initialize();}
CW_AjaxPage_photo_category.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: photo_category</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 4_X</li>
	 * </ul>
	 * the other attribute mediaTypeId (CW_AjaxPage_category attribute) take CW_Action_Media.Media_TYPE_IMAGE value because this page must displayed the photo category listing
	 * @return {void}
	 */
	initialize: function(){
		this.name = "photo_category";
		this.statId = "photo";
		this.menuId = "2_1";
		this.mediaTypeId = CW_Action_Media.Media_TYPE_IMAGE;

		this.classStyle = "categories pictures";
	}
}
CW_AjaxPage_photo_category.prototype = Object.extend(new CW_AjaxPage_category(),CW_AjaxPage_photo_category.prototype);



function CW_AjaxPage_music_category() {this.initialize();}
CW_AjaxPage_music_category.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: photo_category</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 4_X</li>
	 * </ul>
	 * the other attribute mediaTypeId (CW_AjaxPage_category attribute) take CW_Action_Media.Media_TYPE_IMAGE value because this page must displayed the photo category listing
	 * @return {void}
	 */
	initialize: function(){
		this.name = "music_category";
		this.statId = "music";
		this.menuId = "3_1";
		this.mediaTypeId = CW_Action_Media.Media_TYPE_MUSIC;
		this.classStyle = "categories audio";
	}
}
CW_AjaxPage_music_category.prototype = Object.extend(new CW_AjaxPage_category(),CW_AjaxPage_music_category.prototype);

/**
 * @class the following class allow to display the "upload" page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>upload</td>
 *			<td>upload</td>
 *			<td>6_X</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>no parameters</td>
  *			<td>no identifier</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_upload () {this.initialize();}
CW_AjaxPage_upload.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: upload</li>
	 * 		<li>statId: upload</li>
	 * 		<li>menuId: 6_X</li>
	 * 		<li>mustBeConnected:true</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	initialize: function(){
		this.name = "upload";
		this.statId = "upload";
		this.menuId = "6_X";
		this.mustBeConnected = true;
	},
	/**
	 * The following function allow to display the display form in the HtmlDivElement
	 * identified by "masterPage" where html/upload/uploadMediaAll.html"  html template was loaded.
	 * In order to realise this, this function used CW_comwebAjax.
	 * This function initialize too some upload form attribute in order to generate the correct request,
	 * so the document must contain the upload form which is nammed by "uploadForm" and have the following input attribute:
	 * <ul>
	 *		<li>host</li>
	 * 		<li>USESSION</li>
	 * 		<li>site.uid</li>
	 * 		<li>owner.uid</li>
	 * 		<li>lang.uid</li>
	 * </ul>
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @see CW_comwebAjax#getUploadWrapper
	 * @return {void}
	 */
	display:function(params,identifier){
		var params = new HashTable();
		var comwebBeanUser = CW_config.getConnectedUser();
		params.put("username",(comwebBeanUser.getUsername()+comwebBeanUser.getValues("user.upload.code")));
		//params.put("username",(comwebBeanUser.getUsername()+"_"+comwebBeanUser.getValues("user.upload.code")));		
		//params.put("postcode",comwebBeanUser.getValues("user.upload.code"));
		uploadFormSubmitted = false;

		CW_comwebAjax.loadHtml("html/upload/uploadMediaAll.html","masterPage",params);
		// Old code: var host= CW_comwebAjax.getHost();
		// Now, we retrieve the JS bean that wraps the response to the
		// request that delivers a static IP address, to also be able
		// to know about the user's session identifier.
		var comwebBean_upload = null;
		var host = null;
		var sessionUid = null;

		var counter = 0;

		while ((host==null||host=="null"||sessionUid==null||sessionUid=="null") &&(counter<6)){
			comwebBean_upload = CW_comwebAjax.getUploadWrapper();
			host =  comwebBean_upload.getHost();
			sessionUid = comwebBean_upload.getSessionUid();
			counter = counter + 1;
		}
		if (host==null||host=="null"||sessionUid==null||sessionUid=="null"){
			showDialog_Message_Feedback("Error","This page is inalienable at this moment, try again later");
			CW_AjaxPage_Manager.displayPage("home");
			return ;
		}
		try{
			var uploadIframeTarget = window.frames["upload_iframe"];
			uploadIframeTarget.location.replace("html/upload/uploadJSProcess.html");
		}catch(e){}
		var form = document.forms["uploadForm"];

		var host =  comwebBean_upload.getHost();
		CW_util.getFormElement(form,"host").value = host;
		CW_util.getFormElement(form,"USESSION").value = comwebBean_upload.getSessionUid();
		CW_util.getFormElement(form,"site.uid").value = CW_config.serviceId;
		CW_util.getFormElement(form,"owner.uid").value = CW_config.getConnectedUser().getUid();
		CW_util.getFormElement(form,"lang.uid").value =  CW_internationalization.getUid();
		
		CW_util.setUserPlaylistContent("uploadForm","addplaylist");		

		uploadChangeMediaType();
		dhtmlHistory.add("Upload");
	}
}
//set the extends class
CW_AjaxPage_upload.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_upload.prototype);
/**
 * @class the following class allow to display the "cgu" page, display the "Terms of use"
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>cgu</td>
 *			<td>cgu</td>
 *			<td>X_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_cgu () {this.initialize();}
CW_AjaxPage_cgu.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: cgu</li>
	 * 		<li>statId: cgu</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	initialize: function(){
		this.name = "cgu";
		this.statId = "cgu";
		this.menuId = "X_X";
		this.classStyle = "default";
	},
	/**
	 * The following function allow to display the html/upload/uploadMediaAll.html template
	 * in the HtmlDivElement identified by "masterPage" using CW_comwebAjax.loadHtml
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @return {void}
	 */
	display:function(params,identifier){
		CW_comwebAjax.loadHtml("html/other/cgu/cgu_"+CW_config.langId +".html","masterPage");
		dhtmlHistory.add("Cgu");
	}
}
//set the extends class
CW_AjaxPage_cgu.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_cgu.prototype);
/**
 * @class the following class allow to display the "faq" (Frequently Asked Questions) page,
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>faq</td>
 *			<td>faq</td>
 *			<td>X_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_faq () {this.initialize();}
CW_AjaxPage_faq.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: faq</li>
	 * 		<li>statId: faq</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	initialize: function(){
		this.name = "faq";
		this.statId = "faq";
		this.menuId = "X_X";
		this.classStyle = "default";
	},
	/**
	 * The following function allow to display the faq.html template
	 * in the HtmlDivElement identified by "masterPage" using CW_comwebAjax.loadHtml
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @return {void}
	 */
	display:function(params,identifier){
		CW_comwebAjax.loadHtml("html/other/faq/faq_"+CW_config.langId +".html","masterPage");
		dhtmlHistory.add("Faq");
	}
}
//set the extends class
CW_AjaxPage_faq.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_faq.prototype);

function CW_AjaxPage_contact() {this.initialize();}
CW_AjaxPage_contact.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: faq</li>
	 * 		<li>statId: faq</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	initialize: function(){
		this.name = "contact";
		this.statId = "contact";
		this.menuId = "X_X";
		this.classStyle = "default";
	},
	/**
	 * The following function allow to display the faq.html template
	 * in the HtmlDivElement identified by "masterPage" using CW_comwebAjax.loadHtml
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @return {void}
	 */
	display:function(params,identifier){
		CW_comwebAjax.loadHtml("html/other/contact/contact_"+CW_config.langId +".html","masterPage");
		CW_util.getFormElement(document.forms["sendContactMail"],"burl").value =  CW_config.webappUri;
		dhtmlHistory.add("Contact");
	}
}
//set the extends class
CW_AjaxPage_contact.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_contact.prototype);


/**
 * @class the following class allow to display the "inscription" (first inscription form) page,
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>inscription</td>
 *			<td>inscription</td>
 *			<td>X_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_inscription () {this.initialize();}
CW_AjaxPage_inscription.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: inscription</li>
	 * 		<li>statId: inscription</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	initialize: function(){
		this.name = "inscription";
		this.statId = "inscription";
		this.menuId = "X_X";
		this.classStyle = "inscription";
	},
	/**
	 * The following function allow to display the html/inscription/inscription1.html template
	 * in the HtmlDivElement identified by "masterPage" using CW_comwebAjax.loadHtml
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @return {void}
	 */
	display:function(params,identifier){
		CW_comwebAjax.loadHtml("html/inscription/inscription1.html","masterPage");
		dhtmlHistory.add("Inscription");
	}
}
//set the extends class
CW_AjaxPage_inscription.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_inscription.prototype);
/**
 * @class the following class allow to load the "member" page, the member page display profile member which is determined
 * by the username given to the display function as identifier parameter
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>member</td>
 *			<td>member</td>
 *			<td>3_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>username</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Member:[username]
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_member () {this.initialize();}

CW_AjaxPage_member.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: member</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	initialize: function(){
		this.name = "member";
		this.statId = "member";
		this.menuId = "3_0";
		this.classStyle = "members";
	},
	/**
	 * Call CW_Action_User.displayUser width displayCallback callback in order to display member
	 * profile page (the member is identified by the given identifier)
	 *
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, must be the username value of the member which be displayed
	 * @return {void}
	 * @see CW_Action_User#displayUser
	 *
	 */
	display:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayCallback";
		identifier = this._getIndentifier(identifier);


		var parameters = new Array();
		parameters.push('action=userbyid');
		parameters.push('user.uid=' + identifier);
		parameters.push('user.fullview=1');
		parameters.push('user.profil=1');

		CW_comwebAjax.sendRequest(CW_Action_User.SERVLET_URI, callback, null, 'member', parameters,null);
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * CW_Action_User.displayUsert( action and in this case contain the wanted member to displayed. after
	 * has retrieve the member, member is displayed with loadBrick_member_memberProfile function
	 *
	 * @see GLOBALS#loadBrick_member_memberProfile
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_User.displayUser launched by display
	 * @param {RequestResume} requestResume request resume of CW_Action_User.displayUser launched by display
	 * @return {void}
	 */
	displayCallback:function(comwebBean,requestResume){
		var comwebBeanUserArray = comwebBean.getSpecificChildren('user');
		if (comwebBeanUserArray.length > 0){
			var comwebBeanUser =  comwebBeanUserArray[0];
			loadBrick_member_memberProfile(comwebBeanUser,"masterPage");
			dhtmlHistory.add("Member:" + encode64(new String(comwebBeanUser.getUid()))+ "/" + (escape(comwebBeanUser.getNickname())).replace(new RegExp('%[1-9]{2}',"g"),"_"));
			//dhtmlHistory.add("Member:" + comwebBeanUser.getNickname());
		}
	},

	_getIndentifier:function(identifier){
		identifier = new String (identifier) + "/";
		var indexOfSep = identifier.indexOf('/');
		if (indexOfSep > 0){
			var decodIdentifier = identifier.substring(0,indexOfSep);
			decodIdentifier = new String(decode64(decodIdentifier));
			return decodIdentifier;
		}else{
			return identifier;
		}
	}
}

//set the extends class
CW_AjaxPage_member.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_member.prototype);


function CW_AjaxPage_playlist () {this.initialize();}

CW_AjaxPage_playlist.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: member</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	initialize: function(){
		this.name = "playlist";
		this.statId = "member";
		this.menuId = "3_1";
		this.classStyle = "playlists";
	},
	/**
	 * Call CW_Action_User.displayUser width displayCallback callback in order to display member
	 * profile page (the member is identified by the given identifier)
	 *
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, must be the username value of the member which be displayed
	 * @return {void}
	 * @see CW_Action_User#displayUser
	 *
	 */
	display:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayCallback";
		CW_Action_User.displayPlaylist(callback,identifier,null);
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * CW_Action_User.displayUsert( action and in this case contain the wanted member to displayed. after
	 * has retrieve the member, member is displayed with loadBrick_member_memberProfile function
	 *
	 * @see GLOBALS#loadBrick_member_memberProfile
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_User.displayUser launched by display
	 * @param {RequestResume} requestResume request resume of CW_Action_User.displayUser launched by display
	 * @return {void}
	 */
	displayCallback:function(comwebBean,requestResume){
		var comwebBeanGroup = comwebBean.getSpecificChildren("list")[0].getSpecificChildren("group")[0];
		loadBrick_playlist_playlist(comwebBeanGroup,"masterPage");
		dhtmlHistory.add("Playlist:"  + comwebBeanGroup.getUid() );
	}
}

//set the extends class
CW_AjaxPage_playlist.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_playlist.prototype);




/**
 * @class the following class allow to load the "my profil" page, the member page display the connected member simple profile
 * the connected user is retrieve with CW_config.getConnectedUser()
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_profil</td>
 *			<td>member</td>
 *			<td>3_X</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Profil/
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_my_count_profil(){this.initialize();}
CW_AjaxPage_my_count_profil.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_profil</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 0_X</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	initialize:function(){
		this.name="my_count_profil";
		this.statId = "member";
		this.menuId = "0_X";
		this.mustBeConnected = true;
		this.classStyle = "myScroon members";
	},
	/**
	 * Call CW_Action_User.displayUser width displayCallback callback in order to display
	 * the connected member profile page (the connected member is retrieve with CW_config.getConnectedUser())
	 *
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 *
	 */
	display:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayCallback";

		var parameters = new Array();
		parameters.push('action=userbyid');
		parameters.push('user.uid=' + CW_config.getConnectedUser().getUid());
		parameters.push('user.fullview=1');
		parameters.push('user.profil=1');

		CW_comwebAjax.sendRequest(CW_Action_User.SERVLET_URI, callback, null, 'member', parameters,null);


	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * CW_Action_User.displayUser action and in this case contain the connected member to displayed. after
	 * has retrieve the member, member is displayed with loadBrick_member_myProfile function
	 *
	 * @see GLOBALS#loadBrick_member_myProfile
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_User.displayUser launched by display
	 * @param {RequestResume} requestResume request resume of CW_Action_User.displayUser launched by display
	 * @return {void}
	 */
	displayCallback:function(comwebBean,requestResume){
		var comwebBeanUserArray=comwebBean.getSpecificChildren("user");
		if(comwebBeanUserArray.length>0){
			var comwebBeanUser=comwebBeanUserArray[0];
			loadBrick_member_myProfile(comwebBeanUser,"masterPage");
			var historyName= this.getHistoryPageName();
			dhtmlHistory.add(historyName);
		}
	}
}
//set the extends class
CW_AjaxPage_my_count_profil.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_my_count_profil.prototype);
/**
 * @class the following class allow to load the "media edition" page, the display method must be invoke with the media identifier
 * which must be edit, note that this media must be owned by connected user
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_media_edit</td>
 *			<td>video</td>
 *			<td>0_X</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>media identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Media/Edit:[media identifier]
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_my_count_media_edit(){
	this.initialize();
}
CW_AjaxPage_my_count_media_edit.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_media_edit</li>
	 * 		<li>statId: video</li>
	 * 		<li>menuId: 0_X</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *
	 * @return {void}
	 */
	 initialize: function(){
		this.name = "my_count_media_edit";
		this.statId = "video";
		this.menuId = "0_0";
		this.mustBeConnected = true;
		this.classStyle = "default";
	},
	/**
	 * Call CW_Action_Media.displayMedia with displayCallback callback in order to display
	 * the media edtion page of the given media determined by its identifier
	 *
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, must be the media identifier which must be edit
	 * @see CW_Action_Media#displayMedia
	 * @return {void}
	 *
	 */
	display:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayCallback";
		CW_Action_Media.displayMedia(callback,identifier);
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * CW_Action_Media.displayMedia  action and in this case contain the media to edit. after
	 * has retrieve the media, media is displayed with loadBrick_media_myMediaEdit function
	 *
	 * @see GLOBALS#loadBrick_media_myMediaEdit
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_Media.displayMedialaunched by display
	 * @param {RequestResume} requestResume request resume of CW_Action_Media.displayMedia launched by display
	 * @return {void}
	 */
	displayCallback:function(comwebBean,requestResume){
		var comwebBeanMediaArray=comwebBean.getSpecificChildren("media");
		if(comwebBeanMediaArray.length>0){
			var comwebBeanMedia=comwebBeanMediaArray[0];
			loadBrick_media_myMediaEdit(comwebBeanMedia,"masterPage");
			dhtmlHistory.add("My/Count/Media/Edit:" + comwebBeanMedia.getUid());
		}
	}
}
//set the extends class
CW_AjaxPage_my_count_media_edit.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_my_count_media_edit.prototype);
/**
 * @class the following class allow to set the behavior of item listing page, those pages must contain a filter (CW_Filter),
 * must contain too a pager ,and must displayed an item list like member or video. So don't use directly this class but use extended class
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>item_listing</td>
 *			<td>item</td>
 *			<td>X_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>can be used for extended objeet</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Item/listing:[identifier]/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_item_listing () {this.initialize();}
CW_AjaxPage_item_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: member</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 *other attributes which used by extended object:
	 * <ul>
	 * 		<li>loadedHTMLPage: page which is load in the htmlDivElment identified by "masterPage"</li>
	 *	 	<li>filterType: corresponding to the displayed item (allow to manage filter list), can be CW_Filter.Filter_MEDIA, CW_Filter.Filter_MEMBER or CW_Filter.Filter_PLAYLIST</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "item_listing";
		this.statId = "item";
		this.menuId = "X_X";
		this.mustRefreshElement = false;
		//specific itemListing
		this.loadedHTMLPage = "html/media/mediaListing.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		this.classStyle = "default";
	},
	/**
	 * Guetter
	 * @return {String} default page parameters, used in history push, this parameters must be separate by "/" and must be like [CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
	 */
	getParams:function(){
		return CW_Filter.convertSinceIntToHistValue("") + "/" + CW_Filter.convertOrderIntToHistValue("")  + "/Page=1/lng=" +  CW_config.langId;
	},
	/**
	 * Guetter this function must return all parameters (with their values) which are requiered to build
	 * the request which allow to deliver the item content
	 * we know that some request attribute are already managed:
	 * <ul>
	 * 		<li>listing.order, is managed by loadBrick_filter_common which write a form containing listing.order select list, this form will be used to build the request by ComwebPagerManager</li>
	 * 		<li>listing.since, is managed by loadBrick_filter_common which write a form containing listing.order select list, this form will be used to build the request by ComwebPagerManager</li>
	 * <ul>
	 * we know too that there are obligatory parameters:
	 * <ul>
	 * 		<li>action</li>
	 * 		<li>listing.nbre.elements</li>
	 * 		<li>listing.page</li>
	 * </ul>
	 * note that if the current object must have other parameters you can add it in the hashtableRequestParameter, and
	 * the history push identifier must be added as parameter idntifier in order to mananageHistoryAndPager can be processed it
	 * <br/>
	 * This function must be overrided by extended class
	 * @return {ComwebPager} which contains all needed request parameters (except:listing.order,listing.since), and all pager managment parameters for this current page
	 * @see GLOABALS#loadBrick_filter_common
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action",CW_Action_Media.ACTION_MEDIA_ALL);
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_media);
		if (identifier!=null){
			hashtableRequestParameters.put("identifier",identifier);
		}
		//ComwebPager2(pageDivId,pagerDivId,callbackDisplayContent,requestServletUri,hashtableRequestParameters);
		return new ComwebPager("media_Listing","mediaListing_pager",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * The following function realise:
	 * <ul>
	 * 		<li> the html template (determined by loadedHTMLPage attribute) loading in the htmlDivElement identified by "masterPage"</li>
	 * 		<li> extract since filter, order filter, current page values from history parameters </li>
	 * 		<li> display the filter with loadBrick_filter_common function</li>
	 * 		<li> set the corresponding pager object with this.getPager function</li>
	 * 		<li> invoke displayMore function</li>
	 * 		<li> launch the pager managment (CW_Page_Manager) , this managment will build the ajax request which deliver the item list content
	 * 		and then invoke this displayContent function as a callback</li>
	 * </ul>
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @see CW_comwebAjax#loadHtml
	 * @see GLOBALS#loadBrick_filter_common
	 * @return {void}
	 */
	display:function(params,identifier){
		//Load html templates
		if (this.loadedHTMLPage != null){
			CW_comwebAjax.loadHtml(this.loadedHTMLPage,"masterPage");
		}
		var paramArray = (new String(params)).split("/");
		var CW_Filter_SINCE = CW_Filter.convertHistValueToSinceInt(new String(paramArray[0]));
		var CW_Filter_ORDER = CW_Filter.convertHistValueToOrderInt(new String(paramArray[1]));
		var page = parseInt((new String(paramArray[2])).replace("Page=",""));
		//load the common filter in member page (div filter_common)
		//set the common filter values
		//CW_logger.log(CW_logger.LEVEL_INFORMATION,"ComwebPage request callback:" + callback);
		var pager =  this.getPager(page,params,identifier);
		loadBrick_filter_common(pager.pagerName,"filter_common",this.filterType,CW_Filter_ORDER,CW_Filter_SINCE);
		pager.display();
		try{ this.displayMore(params,identifier);}catch(e){}
	},
	/**
	 * Function which is invoke when display function was been processed
	 *
	 * @return {void}
	 */
	displayMore:function(params,identifier){},
	/**
	 * realise the history push and the pager management
	 * used it in displayContent function
	 * @param {ComwebBean} comwebBean xml wrapper of the ajax request
	 * @param {RequestResume} requestResume request resume of the ajax request
	 */
	mananageHistoryAndPager:function(comwebBean,requestResume){
		CW_AjaxPage_Manager.refreshElement(this);
		var pagerFormName = requestResume.hashTableStore.get("pagerFormName");
		CW_logger.log(CW_logger.LEVEL_INFORMATION, " comebPage item listning : " + pagerFormName + " .mananageHistoryAndPager");
		CW_Page_Manager.changePageCheck(comwebBean,requestResume);
		var reg = new RegExp("[.]","g");
	 	var queryHash = (new String(requestResume.queryString)).replace(reg,"_").toQueryParams();
		var page = parseInt(queryHash.listing_page);
		var since =  CW_Filter.convertSinceIntToHistValue(parseInt(queryHash.listing_since));
		var order =  CW_Filter.convertOrderIntToHistValue(parseInt(queryHash.listing_order));
		var historyName= new String(this.getHistoryPageName());
		historyName = historyName.substr(0,historyName.length -1);
		var identifier = "";
		try{
			identifier = document.forms[pagerFormName].identifier.value;
			identifier = ":" + identifier;
		}catch(e){}
		dhtmlHistory.add(historyName+ identifier + "/_/" + since + "/" + order  + "/Page="+page+"/lng=" +  CW_config.langId,historyName);
	},
	/**
	 * Display the content page, using ajax request result
	 * must used mananageHistoryAndPager(comwebBean,requestResume) in this function in order to have the history push and the pager management
	 * <br/>
	 * This function must be overrided by extended class
	 * @param {ComwebBean} comwebBean xml wrapper of the ajax request
	 * @param {RequestResume} requestResume request resume of the ajax request
	 */
	displayContent:function(comwebBean,requestResume){}
}
//set the extends class
CW_AjaxPage_item_listing.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_item_listing.prototype);
/**
 * @class the following class allow to set the behavior of member listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an member listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>member_listing</td>
 *			<td>item</td>
 *			<td>member</td>
 *			<td>3_0</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Member/listing/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @extends CW_AjaxPage_item_listing
 */
function CW_AjaxPage_member_listing () {this.initialize();}
CW_AjaxPage_member_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: member_listing</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 3_0</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/member/memberListing.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEMBER</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "member_listing";
		this.statId = "member";
		this.menuId = "3_0";

		//overwrite CW_AjaxPage_item_listing
		this.loadedHTMLPage = "html/member/memberListing.html";
		this.filterType = CW_Filter.Filter_MEMBER;

		this.displayContentDivId = "member_listing";
		this.classStyle = "members";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:"user.all"</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:16, (nb member in this page)</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "member_container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_User.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","user.all");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_membre);
		return new ComwebPager("member_container","pager_id",callback,CW_Action_User.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * of the getPager function builded request, and in this case contain a list of 16 users. after
	 * has retrieve the user, user are displayed with loadBrick_member_memberElement function in htmlDivelement
	 * identified by "member_listing"
	 *
	 * @see GLOBALS#loadBrick_media_myMediaEdit
	 * @param {ComwebBean} comwebBean xml bean result of CW_Action_Media.displayMedialaunched by display
	 * @param {RequestResume} requestResume request resume of CW_Action_Media.displayMedia launched by display
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		var userArray = comwebBean.getSpecificChildren("list")[0].getSpecificChildren('user');
		var parentDiv = document.getElementById(this.displayContentDivId);
		if (parentDiv){
			this.mananageHistoryAndPager(comwebBean,requestResume);
			parentDiv.innerHTML = "";
			if(userArray.length>0){
				for (var i=0;i<userArray.length;i++){
					//loadBrick_member_memberElement(userArray[i],"html/member/memberElement.html",this.displayContentDivId,true); modif par mat le 03/01
					loadBrick_member_memberElement(userArray[i],"html/member/memberElement3.html",this.displayContentDivId,true);
				}
			}else{
				parentDiv.innerHTML = CW_internationalization.getValue("general.noContent");
			}
		}
	}
}
//set the extends class
CW_AjaxPage_member_listing.prototype = Object.extend(new CW_AjaxPage_item_listing(),CW_AjaxPage_member_listing.prototype);
/**
 * @class the following class allow to set the behavior of item listing page, those pages must contain a filter (CW_Filter),
 * must contain too a pager ,and must displayed an item list which owne to the current connected user. So don't use directly this class but use extended class
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_item</td>
 *			<td>item</td>
 *			<td>X_X</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>can be used for extended objeet</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Item/Listing:[identifier]/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_item_listing
 */
function CW_AjaxPage_my_count_item() {this.initialize();}
CW_AjaxPage_my_count_item.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: member_listing</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: X_X</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/myScroon/myVideo.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which used by extended object:
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: possible values are CW_Action_Media.Media_TYPE_[VIDEO|IMAGE|MUSIC] set it only if the filter type is CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "my_count_item";
		this.statId = "item";
		this.menuId = "X_X";
		this.mustBeConnected = true;
		//overwrite CW_AjaxPage_item_listing
		this.loadedHTMLPage = "html/myScroon/myVideo.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specific to CW_AjaxPage_my_count_item
		this.CW_Action_Media_media_TYPE  = CW_Action_Media.Media_TYPE_VIDEO;

		this.selectedMyScroonMenuIndex = 0;
		this.classStyle = "default";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:[CW_Action_Media.ACTION_MEDIA_USER]</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:9, (nb member in this page)</li>
	 * 		<li>media.type:[this.CW_Action_Media_media_TYPE] </li>
	 * 		<li>user.uid:[CW_config.getConnectedUser().getUid()]</li>
	 * 		<li>user.myspace:"true"</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "myScroon_Container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_Media.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action",CW_Action_Media.ACTION_MEDIA_USER);
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_myscroon_media);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE );
		hashtableRequestParameters.put("user.uid",CW_config.getConnectedUser().getUid());
		hashtableRequestParameters.put("user.myspace","true");
		return new ComwebPager("myScroon_Container","pager_id",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * of the getPager function builded request, and in this case contain a list of 9 media. after
	 * has retrieve the media, medias are displayed with loadBrick_myMedia_mediaElement function in htmlDivelement
	 * identified by "myScroon_Content_video"
	 *
	 * @see GLOBALS#loadBrick_myMedia_mediaElement
	 * @param {ComwebBean} comwebBean xml bean
	 * @param {RequestResume} requestResume request resume
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		var comwebBeanListMediaArray = comwebBean.getSpecificChildren("list");
		var uid=0;
		var href="";
		var listingParam = requestResume.queryString;

		document.getElementById("myScroon_Content_video").innerHTML = "";
		CW_util.setUserPlaylistContent("selectUserPlayList","pl.name");
		var form = document.forms["selectUserPlayList"];
		CW_util.getFormElement(form,"page.type").value =  this.CW_Action_Media_media_TYPE;
		this.mananageHistoryAndPager(comwebBean,requestResume);
		if(comwebBeanListMediaArray.length>0){
			var comwebBeanMediaArray = comwebBeanListMediaArray[0].getSpecificChildren("media");
			if(comwebBeanMediaArray.length>0){
				for(var i=0;i<comwebBeanMediaArray.length;i++){
					var comwebBeanMedia=comwebBeanMediaArray[i];
					uid = comwebBeanMedia.getUid();
					href = "goToMediaPlay('" + listingParam+"',"+uid+" );";
					loadBrick_myMedia_mediaElement(comwebBeanMedia,"myScroon_Content_video",href,true);
				}
			}else{
				this.displayNoContent();
			}
		}
	},

	displayNoContent:function(){
		document.getElementById("masterBloc1_Body").innerHTML = CW_internationalization.getValue("general.noContent");
	},

	displayMore:function(params,identifier){

		/*if (this.selectedMyScroonMenuIndex != null){
			CW_comwebAjax.loadHtml("html/myScroon/menuMyScroon.html","myScroon_ContainerMenu");
			document.getElementById("menuMyScroon").getElementsByTagName("li").item(this.selectedMyScroonMenuIndex).className = "menuMyScroonSelected";
		}*/
	}
}
//set the extends class
CW_AjaxPage_my_count_item.prototype = Object.extend(new CW_AjaxPage_item_listing(),CW_AjaxPage_my_count_item.prototype);
/**
 * @class the following class allow to displaye an video list which owne to the current connected user.
 * this page contains a filter (CW_Filter), and a pager too
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_video</td>
 *			<td>video</td>
 *			<td>0_0</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Item/Video/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_my_count_item
 */
function CW_AjaxPage_my_count_video () {this.initialize();}
CW_AjaxPage_my_count_video.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_video</li>
	 * 		<li>statId: my_count_video</li>
	 * 		<li>menuId: 0_0</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/myScroon/myVideo.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_my_count_item attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE:CW_Action_Media.Media_TYPE_VIDEO</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "my_count_video";
		this.statId = "video";
		this.menuId = "0_0";
		this.mustBeConnected = true;
		//overwrite CW_AjaxPage_item_listing
		this.loadedHTMLPage = "html/myScroon/myVideo.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//overwrite CW_AjaxPage_my_count_item
		this.CW_Action_Media_media_TYPE  = CW_Action_Media.Media_TYPE_VIDEO;
		this.selectedMyScroonMenuIndex = 0;

		this.classStyle = "myScroon videos";
	},
	displayNoContent:function(){
		var params = new HashTable();
		params.put("mediatype",CW_internationalization.getValue("upload.uploadMedia.video").toLowerCase());
		params.put("mediatypeid",CW_Action_Media.Media_TYPE_VIDEO);
		document.getElementById("myScroon_Container").innerHTML = CW_internationalization.getValueParams("general.myscroon.noContent.media",params);
	}

}
//set the extends class
CW_AjaxPage_my_count_video.prototype = Object.extend(new CW_AjaxPage_my_count_item(),CW_AjaxPage_my_count_video.prototype);
/**
 * @class the following class allow to display an photo list which owne to the current connected user.
 * this page contains a filter (CW_Filter), and a pager too
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_photo</td>
 *			<td>photo</td>
 *			<td>0_1</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Item/Photo/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_my_count_item
 */
function CW_AjaxPage_my_count_photo () {this.initialize();}
CW_AjaxPage_my_count_photo.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_photo</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 0_1</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/myScroon/myPhoto.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *ther attributes which overwrite specifical CW_AjaxPage_my_count_item attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_IMAGE</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "my_count_photo";
		this.statId = "photo";
		this.menuId = "6_1";
		this.mustBeConnected = true;
		//overwrite CW_AjaxPage_item_listing
		this.loadedHTMLPage = "html/myScroon/myPhoto.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//overwrite CW_AjaxPage_my_count_item
		this.CW_Action_Media_media_TYPE  = CW_Action_Media.Media_TYPE_IMAGE;
		this.selectedMyScroonMenuIndex = 1;

		this.classStyle = "myScroon pictures";
	},
	displayNoContent:function(){
		var params = new HashTable();
		params.put("mediatype",CW_internationalization.getValue("upload.uploadMedia.photo").toLowerCase());
		params.put("mediatypeid",CW_Action_Media.Media_TYPE_IMAGE);
		document.getElementById("myScroon_Container").innerHTML = CW_internationalization.getValueParams("general.myscroon.noContent.media",params);
	}
}
//set the extends class
CW_AjaxPage_my_count_photo.prototype = Object.extend(new CW_AjaxPage_my_count_item(),CW_AjaxPage_my_count_photo.prototype);



function CW_AjaxPage_my_count_music () {this.initialize();}
CW_AjaxPage_my_count_music.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_photo</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 0_1</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/myScroon/myPhoto.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *ther attributes which overwrite specifical CW_AjaxPage_my_count_item attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_IMAGE</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "my_count_music";
		this.statId = "music";
		this.menuId = "6_2";
		this.mustBeConnected = true;
		//overwrite CW_AjaxPage_item_listing
		this.loadedHTMLPage = "html/myScroon/myPhoto.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//overwrite CW_AjaxPage_my_count_item
		this.CW_Action_Media_media_TYPE  = CW_Action_Media.Media_TYPE_MUSIC;
		this.selectedMyScroonMenuIndex = 2;

		this.classStyle = "myScroon audio";
	},
	displayNoContent:function(){
		var params = new HashTable();
		params.put("mediatype",CW_internationalization.getValue("upload.uploadMedia.audio").toLowerCase());
		params.put("mediatypeid",CW_Action_Media.Media_TYPE_MUSIC);
		document.getElementById("myScroon_Container").innerHTML = CW_internationalization.getValueParams("general.myscroon.noContent.media",params);
	}
}
//set the extends class
CW_AjaxPage_my_count_music.prototype = Object.extend(new CW_AjaxPage_my_count_item(),CW_AjaxPage_my_count_music.prototype);



/**
 * @class the following class allow to displaye an video list which owne to the current connected user,
 * and the displayed video must be the favorite connected user vide.
 * this page contains a filter (CW_Filter), and a pager too
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_favorite_video</td>
 *			<td>video</td>
 *			<td>0_2</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Favorite/Video/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_my_count_item
 */
function CW_AjaxPage_my_count_favorite_video(){	this.initialize();}
CW_AjaxPage_my_count_favorite_video.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_favorite_video</li>
	 * 		<li>statId: video</li>
	 * 		<li>menuId: 0_2</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/myScroon/myFavorite/myFavorite.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *ther attributes which overwrite specifical CW_AjaxPage_my_count_item attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_VIDEO</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "my_count_favorite_video";
		this.statId = "video";
		this.menuId = "0_1";
		this.mustBeConnected = true;
		//overwrite CW_AjaxPage_item_listing attribute
		this.loadedHTMLPage = "html/myScroon/myFavorite/myFavorite.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//overwrite CW_AjaxPage_my_count_item attribute
		this.CW_Action_Media_media_TYPE_VIDEO  = CW_Action_Media.Media_TYPE_VIDEO;
		this.CW_Action_Media_media_TYPE  = CW_Action_Media.Media_TYPE_VIDEO;
		this.selectedMyScroonMenuIndex = 4;

		this.classStyle = "myScroon videos";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:"get.favr"</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:9, (nb member in this page)</li>
	 * 		<li>media.type:[this.CW_Action_Media_media_TYPE] </li>
	 * 		<li>user.uid:[CW_config.getConnectedUser().getUid()]</li>
	 * 		<li>user.myspace:"true"</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "myScroon_Container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_Media.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","get.favr");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_myscroon_media);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE );
		hashtableRequestParameters.put("user.uid",CW_config.getConnectedUser().getUid());
		hashtableRequestParameters.put("user.myspace","true");
		return new ComwebPager("myScroon_Container","pager_id",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * the following function is invoked at the end of display function process and allow to
	 * display the onglet (video and photo) and select the first one which is the video tab
	 * @see GLOBALS#createOngletCategory
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		//CW_comwebAjax.loadHtml("html/myScroon/menuMyScroon.html","myScroon_ContainerMenu");
		//document.getElementById("menuMyScroon").getElementsByTagName("li").item(this.selectedMyScroonMenuIndex).className = "menuMyScroonSelected";
		//premiere : hide the favorites tabs
		//createOngletCategory().selectTab(0,false);
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * of the getPager function builded request, and in this case contain a list of 9 media. after
	 * has retrieve the media, medias are displayed with loadBrick_my_scroon_myFavoriteElement function in htmlDivelement
	 * identified by "myScroon_Content_video"
	 *
	 * @see GLOBALS#loadBrick_my_scroon_myFavoriteElement
	 * @param {ComwebBean} comwebBean xml bean
	 * @param {RequestResume} requestResume request resume
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		var comwebBeanListMediaArray = comwebBean.getSpecificChildren("list");
		var listingParam = requestResume.queryString;
		var uid=0;
		var href="";
		document.getElementById("myScroon_Content_video").innerHTML = "";
		CW_util.setUserPlaylistContent("selectUserPlayList","pl.name");
		var form = document.forms["selectUserPlayList"];
		CW_util.getFormElement(form,"page.type").value =  this.CW_Action_Media_media_TYPE_VIDEO;
		this.mananageHistoryAndPager(comwebBean,requestResume);
		if(comwebBeanListMediaArray.length>0){
			var comwebBeanMediaArray = comwebBeanListMediaArray[0].getSpecificChildren("media");
			if(comwebBeanMediaArray.length>0){
				for(var i=0;i<comwebBeanMediaArray.length;i++){
					var comwebBeanMedia=comwebBeanMediaArray[i];
					uid = comwebBeanMedia.getUid();
					href = "goToMediaPlay('" + listingParam+ "&group.type.uid=2&group.type=2&group.uid=0"+"',"+uid+" );";
					loadBrick_my_scroon_myFavoriteElement(comwebBeanMedia,"myScroon_Content_video",href,true);
				}
			}else{
				document.getElementById("myScroon_Content_video").innerHTML = "<p id='myScroonNoContent'>" + CW_internationalization.getValue("general.noContent") + "</p>";
			}
		}
	}
}
//set the extends class
CW_AjaxPage_my_count_favorite_video.prototype = Object.extend(new CW_AjaxPage_my_count_item(),CW_AjaxPage_my_count_favorite_video.prototype);
/**
 * @class the following class allow to displaye an video list which owne to the current connected user,
 * and the displayed video must be the favorite connected user vide.
 * this page contains a filter (CW_Filter), and a pager too
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_favorite_photo</td>
 *			<td>photo</td>
 *			<td>0_2</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Favorite/Photo/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_my_count_item
 */
function CW_AjaxPage_my_count_favorite_photo(){this.initialize();}
CW_AjaxPage_my_count_favorite_photo.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_favorite_photo</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 0_2</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/myScroon/myFavorite/myFavorite.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *ther attributes which overwrite specifical CW_AjaxPage_my_count_item attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_IMAGE</li>
	 * </ul>
	 *@return {void}
	 */
	initialize:function(){
		this.name = "my_count_favorite_photo";
		this.statId = "photo";
		this.menuId = "0_1";
		this.mustBeConnected = true;
		//specific itemListing
		this.loadedHTMLPage = "html/myScroon/myFavorite/myFavorite.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		this.selectedMyScroonMenuIndex = 4;

		this.CW_Action_Media_media_TYPE_VIDEO  = CW_Action_Media.Media_TYPE_IMAGE;
		this.CW_Action_Media_media_TYPE  = CW_Action_Media.Media_TYPE_IMAGE;

		this.classStyle = "myScroon pictures";
	},
	/**
	 * the following function is invoked at the end of display function process and allow to
	 * display the onglet (video and photo) and select the scond one which is the photo tab
	 * @see GLOBALS#createOngletCategory
	 */
	displayMore:function(params,identifier){
		//CW_comwebAjax.loadHtml("html/myScroon/menuMyScroon.html","myScroon_ContainerMenu");
		//document.getElementById("menuMyScroon").getElementsByTagName("li").item(this.selectedMyScroonMenuIndex).className = "menuMyScroonSelected";
		createOngletCategory().selectTab(1,false);
	}
}
CW_AjaxPage_my_count_favorite_photo.prototype = Object.extend(new CW_AjaxPage_my_count_favorite_video(),CW_AjaxPage_my_count_favorite_photo.prototype);




function CW_AjaxPage_my_count_favorite_music(){this.initialize();}
CW_AjaxPage_my_count_favorite_music.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_favorite_photo</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 0_2</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/myScroon/myFavorite/myFavorite.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *ther attributes which overwrite specifical CW_AjaxPage_my_count_item attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_IMAGE</li>
	 * </ul>
	 *@return {void}
	 */
	initialize:function(){
		this.name = "my_count_favorite_music";
		this.statId = "music";
		this.menuId = "0_1";
		this.mustBeConnected = true;
		//specific itemListing
		this.loadedHTMLPage = "html/myScroon/myFavorite/myFavorite.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		this.selectedMyScroonMenuIndex = 4;

		this.CW_Action_Media_media_TYPE_VIDEO  = CW_Action_Media.Media_TYPE_MUSIC;
		this.CW_Action_Media_media_TYPE  = CW_Action_Media.Media_TYPE_MUSIC;

		this.classStyle = "myScroon audio";
	},
	/**
	 * the following function is invoked at the end of display function process and allow to
	 * display the onglet (video and photo) and select the scond one which is the photo tab
	 * @see GLOBALS#createOngletCategory
	 */
	displayMore:function(params,identifier){
		//CW_comwebAjax.loadHtml("html/myScroon/menuMyScroon.html","myScroon_ContainerMenu");
		//document.getElementById("menuMyScroon").getElementsByTagName("li").item(this.selectedMyScroonMenuIndex).className = "menuMyScroonSelected";
		createOngletCategory().selectTab(2,false);
	}
}
CW_AjaxPage_my_count_favorite_music.prototype = Object.extend(new CW_AjaxPage_my_count_favorite_video(),CW_AjaxPage_my_count_favorite_music.prototype);









/**
 * @class the following class allow to display connected user fiiend member
 * and the displayed video must be the favorite connected user vide.
 * this page contains a filter (CW_Filter), and a pager too
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_friends</td>
 *			<td>member</td>
 *			<td>0_4</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Favorite/Photo/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_item_listing
 */
function CW_AjaxPage_my_count_friends(){this.initialize();}
CW_AjaxPage_my_count_friends.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_friends</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 0_4</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: html/myScroon/myFriend/myFriend.html"</li>
	 *	 	<li>filterType:  CW_Filter.Filter_MEMBER</li>
	 * </ul>
	 *@return {void}
	 */
	initialize:function(){
		this.name = "my_count_friends";
		this.statId = "member";
		this.menuId = "0_3";
		this.mustBeConnected = true;
		//specific itemListing
		this.loadedHTMLPage = "html/myScroon/myFriend/myFriend.html";
		this.filterType = CW_Filter.Filter_MEMBER;
		this.selectedMyScroonMenuIndex = 6;

		this.classStyle = "myScroon";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:"user.friends"</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:16, (nb member in this page)</li>
	 * 		<li>user.uid:[CW_config.getConnectedUser().getUid()]</li>
	 * 		<li>user.myspace:"true"</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "myFriend_container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_User.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","user.friends");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_myscroon_membre);
		hashtableRequestParameters.put("user.uid",CW_config.getConnectedUser().getUid());
		hashtableRequestParameters.put("user.myspace","true");
		return new ComwebPager("myFriend_container","pager_id",callback,CW_Action_User.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * of the getPager function builded request, and in this case contain a list of 16 members. after
	 * has retrieve the members, membrers are displayed with loadbrick_myscroon_myFriendElement function in htmlDivelement
	 * identified by "myFriend_listing"
	 *
	 * @see GLOBALS#loadbrick_myscroon_myFriendElement
	 * @param {ComwebBean} comwebBean xml bean
	 * @param {RequestResume} requestResume request resume
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		var userArray = comwebBean.getSpecificChildren("list")[0].getSpecificChildren('user');
		parentDiv = document.getElementById("myFriend_listing");
		if (parentDiv){
			this.mananageHistoryAndPager(comwebBean,requestResume);
			parentDiv.innerHTML = "";
			if(userArray.length>0){
				for (var i=0;i<userArray.length;i++){
					var user = userArray[i];
					loadbrick_myscroon_myFriendElement(user,"myFriend_listing",true);
				}
			}else{
				parentDiv.innerHTML = CW_internationalization.getValue("general.noContent");
			}
		}
	},
	displayMore:function(params,identifier){
		//CW_comwebAjax.loadHtml("html/myScroon/menuMyScroon.html","myScroon_ContainerMenu");
		//document.getElementById("menuMyScroon").getElementsByTagName("li").item(this.selectedMyScroonMenuIndex).className = "menuMyScroonSelected";
	}
}
CW_AjaxPage_my_count_friends.prototype = Object.extend(new CW_AjaxPage_item_listing(),CW_AjaxPage_my_count_friends.prototype);
/**
 * @class the following class allow to set the behavior of medi (video,image,music) listing page, those pages must contain a filter (CW_Filter),
 * must contain too a pager ,and must displayed an item list like member or video. So don't use directly this class but use extended class
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>media_listing</td>
 *			<td>media</td>
 *			<td>X_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>can be used for extended object</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Media/Listing/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_item_listing
 */
function CW_AjaxPage_media_listing () {this.initialize();}

CW_AjaxPage_media_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: media_listing</li>
	 * 		<li>statId: media</li>
	 * 		<li>menuId: X_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/media/mediaListing.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which  must be overwriteed by extended object
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_[VIDEO|IMAGE|MUSIC]</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "media_listing";
		this.statId = "media";
		this.menuId = "X_X";
		//specific itemListing
		this.loadedHTMLPage = "html/media/mediaListing.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;

		this.displayContentDivId = "media_Listing_content";
		this.classStyle = "default";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:[CW_Action_Media.ACTION_MEDIA_ALL]</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:9, (nb member in this page)</li>
	 *		<li>media.type:[this.CW_Action_Media_media_TYPE] </li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "media_Listing"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_Media.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action",CW_Action_Media.ACTION_MEDIA_ALL);
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_media);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE);
		return new ComwebPager("media_Listing","mediaListing_pager",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * of the getPager function builded request, and in this case contain a list of 9 medias. after
	 * has retrieve the medias, medias are displayed with loadBrick_media_mediaElement function in htmlDivelement
	 * identified by "media_Listing_content"
	 *
	 * @see GLOBALS#loadBrick_media_mediaElement
	 * @param {ComwebBean} comwebBean xml bean
	 * @param {RequestResume} requestResume request resume
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		var parentDiv = document.getElementById(this.displayContentDivId);
		CW_logger.log(CW_logger.LEVEL_INFORMATION, " comebPage media listning : " + this.pagerName + " .displayContent");
		var listingParam = requestResume.queryString;
		var href= "";
		if (parentDiv){
			this.mananageHistoryAndPager(comwebBean,requestResume);
			parentDiv.innerHTML = "";
			var comwebBeanMediaArray = comwebBean.getSpecificChildren("list")[0].getSpecificChildren("media");
			if(comwebBeanMediaArray.length>0){
				for(var i=0;i<comwebBeanMediaArray.length;i++){
					var ComwebBeanMedia = comwebBeanMediaArray[i];
					href = "goToMediaPlay('" + listingParam+"',"+ComwebBeanMedia.getUid()+" );";
					loadBrick_media_mediaElement(ComwebBeanMedia,this.displayContentDivId,href,true);
				}
			}
			else{
				parentDiv.innerHTML = CW_internationalization.getValue("general.noContent");
			}
		}
	}
}
//set the extends class
CW_AjaxPage_media_listing.prototype = Object.extend(new CW_AjaxPage_item_listing(),CW_AjaxPage_media_listing.prototype);
/**
 * @class the following class allow to set the behavior of video listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an video listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>video_listing</td>
 *			<td>video</td>
 *			<td>1_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Media/Listing/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_media_listing
 */
function CW_AjaxPage_video_listing () {this.initialize();}
CW_AjaxPage_video_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: video_listing</li>
	 * 		<li>statId: video</li>
	 * 		<li>menuId: 1_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_VIDEO</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "video_listing";
		this.statId = "video";
		this.menuId = "2_X";

		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;

		this.classStyle = "videos";
	}
}
//set the extends class
CW_AjaxPage_video_listing.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_video_listing.prototype);
/**
 * @class the following class allow to set the behavior of music listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an music listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>music_listing</td>
 *			<td>music</td>
 *			<td>1_4</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Media/Listing/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_media_listing
 */
function CW_AjaxPage_music_listing () {this.initialize();}
CW_AjaxPage_music_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: music_listing</li>
	 * 		<li>statId: music</li>
	 * 		<li>menuId: 1_4</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_MUSIC</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "music_listing";
		this.statId = "music";
		this.menuId = "3_0";
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_MUSIC;
		this.loadedHTMLPage = "html/media/musicListing.html";

		this.classStyle = "audio";
	}
}

//set the extends class
CW_AjaxPage_music_listing.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_music_listing.prototype);
/**
 * @class the following class allow to set the behavior of music listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an music listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>photo_listing</td>
 *			<td>photo</td>
 *			<td>2_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Media/Listing/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_media_listing
 */
function CW_AjaxPage_photo_listing () {this.initialize();}

CW_AjaxPage_photo_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: photo_listing</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 2_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/media/photoListing.html"</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_IMAGE</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "photo_listing";
		this.statId = "photo";
		this.menuId = "2_0";
		this.loadedHTMLPage = "html/media/photoListing.html";
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_IMAGE;

		this.classStyle = "pictures";
	}
}
//set the extends class
CW_AjaxPage_photo_listing.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_photo_listing.prototype);

/**
 * @class the following class allow to display the playlist listing page, this pages must contain a filter (CW_Filter),
 * must contain too a pager ,and must displayed an item list like member or video.
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>playlist_listing</td>
 *			<td>playlist</td>
 *			<td>3_1</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Playlist/listing/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @extends CW_AjaxPage_item_listing
 */
function CW_AjaxPage_playlist_listing(){this.initialize();}
CW_AjaxPage_playlist_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: playlist_listing</li>
	 * 		<li>statId: playlist</li>
	 * 		<li>menuId: 3_1</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/playlists/playlistListing.html"</li>
	 *	 	<li>filterType: CW_Filter.Filter_PLAYLIST</li>
	 * 		<li>displayContentDivId:"playlist_Listing_content"</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "playlist_listing";
		this.statId = "playlist";
		this.menuId = "3_1";

		//specific CW_AjaxPage_item_listing
		this.loadedHTMLPage = "html/playlists/playlistListing.html";
		this.filterType = CW_Filter.Filter_PLAYLIST;
		this.displayContentDivId = "playlist_Listing_content";

		this.classStyle = "playlists";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "playlistListing_pager", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:"get.pl"</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:5, (nb playlist item in this page)</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "playlist_Listing"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_User.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","get.pl");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_playlist);
		return new ComwebPager("playlist_Listing","playlistListing_pager",callback,CW_Action_User.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * of the getPager function builded request, and in this case contain a list of 5 playlist. after
	 * has retrieve the playlist, playlist are displayed with loadBrick_playlist_playlistElement function in htmlDivelement
	 * identified by "playlist_Listing_content"
	 *
	 * @see GLOBALS#loadBrick_playlist_playlistElement
	 * @param {ComwebBean} comwebBean xml bean
	 * @param {RequestResume} requestResume request resume
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		//alert(requestResume.queryString);
		var parentDiv = document.getElementById(this.displayContentDivId);
		CW_logger.log(CW_logger.LEVEL_INFORMATION, " comebPage playlist listing : " + this.pagerName + " .displayContent");
		if (parentDiv){
			if(comwebBean!=null){
				this.mananageHistoryAndPager(comwebBean,requestResume);
				parentDiv.innerHTML = "";
				var comwebBeanGroupArray = comwebBean.getSpecificChildren("list")[0].getSpecificChildren("group");
				for(var i=0;i<comwebBeanGroupArray.length;i++){
					var comwebBeanGroup = comwebBeanGroupArray[i];
					loadBrick_playlist_playlistElement(comwebBeanGroup,this.displayContentDivId,"href",true);
				}
			}
			else{
				parentDiv.innerHTML = CW_internationalization.getValue("general.noContent");
			}
		}
	}
}
//set the extends class
CW_AjaxPage_playlist_listing.prototype = Object.extend(new CW_AjaxPage_item_listing(),CW_AjaxPage_playlist_listing.prototype);


/**
 * @class the following class allow to set the behavior of category video listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an music listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>video_listing_category</td>
 *			<td>video</td>
 *			<td>4_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>category uid</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Video/Listing/Category:[category uid]/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_media_listing
 */
 
var categoryName = "autres"; 

function CW_AjaxPage_video_listing_category () {this.initialize();}
CW_AjaxPage_video_listing_category.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: video_listing_category</li>
	 * 		<li>statId: video</li>
	 * 		<li>menuId: 4_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/category/categoryListMedia.htmll"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which  set CW_AjaxPage_video_listing_category page behavior
	 * <ul>
	 * 		<li>indexOngletCategory (indicates which onglet must be selected with createOngletCategory function called in displayMore ): 0</li>
	 * </ul>
	 * and tmpVar, this is the attribute which allow to stores the user uid between  preDisplay and displayFunction
	 *@return {void}
	 */
	initialize: function(){
		this.name = "video_listing_category";
		this.statId = "video";
		this.menuId = "4_X";

		//specific itemListing
		this.loadedHTMLPage = "html/category/categoryListMedia.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;

		//
		this.indexOngletCategory = 0;

		this.classStyle = "categories videos";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "category_pager", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:[CW_Action_Media.ACTION_MEDIA_CATEGORY]</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:9, (nb video in this page)</li>
	 * 		<li>media.type:[this.CW_Action_Media_media_TYPE] </li>
	 * 		<li>category.uid:[given identifier]</li>
	 * 		<li>identifier:[given identifier]</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "category_ListMedia_Container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_Media.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action",CW_Action_Media.ACTION_MEDIA_CATEGORY);
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_media);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE );
		hashtableRequestParameters.put("identifier",identifier);
		hashtableRequestParameters.put("category.uid",identifier);
		
		/* zone html category id */
		var categoryId = identifier;
		CW_Action_Site.displaySingleCategory("loadCategoryZone1",categoryId);		
	
		return new ComwebPager("category_ListMedia_Container","category_pager",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * of the getPager function builded request, and in this case contain a list of 9 medias. after
	 * has retrieve the medias, medias are displayed with loadBrick_media_categoryMediaElement function in htmlDivelement
	 * identified by "category_ListMedia_Content"
	 *
	 * @see GLOBALS#loadBrick_media_categoryMediaElement
	 * @param {ComwebBean} comwebBean xml bean
	 * @param {RequestResume} requestResume request resume
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		var parentDiv = document.getElementById( "category_ListMedia_Content");
		var ComwebBeanMedia = null;
		var listingParam = requestResume.queryString;
		var href = "";
		if (parentDiv){
			this.mananageHistoryAndPager(comwebBean,requestResume);
			parentDiv.innerHTML = "";
			var comwebBeanMediaArray = comwebBean.getSpecificChildren("list")[0].getSpecificChildren("media");
			if(comwebBeanMediaArray.length>0){
				for(var i=0;i<comwebBeanMediaArray.length;i++){
					ComwebBeanMedia = comwebBeanMediaArray[i];
					href = "goToMediaPlay('" + listingParam+"',"+ComwebBeanMedia.getUid()+" );";
					loadBrick_media_categoryMediaElement(ComwebBeanMedia, "category_ListMedia_Content",href,true);
				}
			}
			else{
				parentDiv.innerHTML = CW_internationalization.getValue("general.noContent");
			}
		}
	},
	/**
	 * the following function is invoked at the end of display function process and allow to
	 * display the onglet (video and photo) and select the onglet identified by "this.indexOngletCategory".
	 * The launch the ajax request (CW_Action_Site.displaySingleCategory with displayTitleCallback callback function)
	 * in order to diplay the category title
	 * @see GLOBALS#createOngletCategory
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		//var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayTitleCallback";
		//CW_Action_Site.displaySingleCategory(callback,identifier);
		categoryName = CategoryListManager.getCategoryTitle(identifier);
		Element.getElementsByClassName(document.getElementById("category_ListMedia_Container"),"masterBloc1_Top")[0].innerHTML = "<h1>"  + CW_internationalization.getValue("general.category") + "&nbsp;"+ CategoryListManager.getCategoryTitle(identifier) + "</h1>";
		createOngletCategory().selectTab(this.indexOngletCategory ,false);
	},
	/**
	 * The following function is the displayMore callback. So the comwebBean is the result of the
	 * CW_Action_Site.displaySingleCategory function builded request, and in this case contain the category
	 * description after has retrieve the category,
	 * category title is display with the following javascript code:
	 * <br/> Element.getElementsByClassName(document.getElementById("category_ListMedia_Container"),"masterBloc1_Top")[0].innerHTML = "<h1>"  + CW_internationalization.getValue("general.category") + "&nbsp;"+ categoryName + "</h1>";
	 *
	 * @see GLOBALS#loadBrick_media_categoryMediaElement
	 * @param {ComwebBean} comwebBean xml bean
	 * @param {RequestResume} requestResume request resume
	 * @return {void}
	 */
	displayTitleCallback:function(comwebBean,requestResume){
		try{
			categoryName = comwebBean.getSpecificChildren('category')[0].getTitle();
			Element.getElementsByClassName(document.getElementById("category_ListMedia_Container"),"masterBloc1_Top")[0].innerHTML = "<h1>"  + CW_internationalization.getValue("general.category") + "&nbsp;"+ categoryName + "</h1>";
		}catch(e){}
	}
}
//set the extends class
CW_AjaxPage_video_listing_category.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_video_listing_category.prototype);
/**
 * @class the following class allow to set the behavior of category photo listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an music listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>video_listing_category</td>
 *			<td>video</td>
 *			<td>4_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>category uid</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Photo/Listing/Category:[category uid]/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_video_listing_category
 */
function CW_AjaxPage_photo_listing_category () {this.initialize();}
CW_AjaxPage_photo_listing_category.prototype = {
		/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: photo_listing_category</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 4_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/category/categoryListMedia.htmll"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which  set CW_AjaxPage_video_listing_category page behavior
	 * <ul>
	 * 		<li>indexOngletCategory (indicates which onglet must be selected with createOngletCategory function called in displayMore ): 1</li>
	 * </ul>
	 * and tmpVar, this is the attribute which allow to stores the user uid between  preDisplay and displayFunction
	 *@return {void}
	 */
	initialize: function(){
		this.name = "photo_listing_category";
		this.statId = "photo";
		this.menuId = "2_X";
		//specific itemListing
		this.loadedHTMLPage = "html/category/categoryListMedia.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_IMAGE;
		this.FilterParam = new HashTable();
		this.indexOngletCategory = 1;

		this.classStyle = "categories pictures";
	}
}

CW_AjaxPage_photo_listing_category.prototype = Object.extend(new CW_AjaxPage_video_listing_category(),CW_AjaxPage_photo_listing_category.prototype);


function CW_AjaxPage_music_listing_category () {this.initialize();}
CW_AjaxPage_music_listing_category.prototype = {
		/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: photo_listing_category</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 4_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/category/categoryListMedia.htmll"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which  set CW_AjaxPage_video_listing_category page behavior
	 * <ul>
	 * 		<li>indexOngletCategory (indicates which onglet must be selected with createOngletCategory function called in displayMore ): 1</li>
	 * </ul>
	 * and tmpVar, this is the attribute which allow to stores the user uid between  preDisplay and displayFunction
	 *@return {void}
	 */
	initialize: function(){
		this.name = "music_listing_category";
		this.statId = "photo";
		this.menuId = "3_X";
		//specific itemListing
		this.loadedHTMLPage = "html/category/categoryListMedia.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_MUSIC;
		this.FilterParam = new HashTable();
		this.indexOngletCategory = 2;

		this.classStyle = "categories audio";
	}
}

CW_AjaxPage_music_listing_category.prototype = Object.extend(new CW_AjaxPage_video_listing_category(),CW_AjaxPage_music_listing_category.prototype);



function CW_AjaxPage_media_tag_listing () {
	this.initialize();
}

CW_AjaxPage_media_tag_listing.prototype = {

	initialize: function(){

		this.name = "media_tag_listing";
		this.statId = "tag";
		this.menuId = "5_X";

		//specific itemListing
		this.loadedHTMLPage = "html/media/mediaListing.html";
		this.pagerName= "mediataglist";
		this.pagerId = "mediaListing_pager";
		this.filterType = CW_Filter.Filter_MEDIA;
		this.pageContainerId = "media_Listing";

		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;
		this.classStyle = "tags";
	},

	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "category_pager", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:media.tag</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:9, (nb video in this page)</li>
	 * 		<li>media.type:[this.CW_Action_Media_media_TYPE] </li>
	 * 		<li>tag.uid:[given identifier]</li>
	 * 		<li>identifier:[given identifier]</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "category_ListMedia_Container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_Media.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","media.tag");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_media);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE );
		hashtableRequestParameters.put("identifier",identifier);
		hashtableRequestParameters.put("tag.uid",identifier);
		return new ComwebPager("media_Listing","mediaListing_pager",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	}
}

//set the extends class
CW_AjaxPage_media_tag_listing.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_media_tag_listing.prototype);


//*****

function CW_AjaxPage_video_tag_listing () {
	this.initialize();
}

CW_AjaxPage_video_tag_listing.prototype = {
	initialize: function(){

		this.name = "video_tag_listing";
		this.statId = "tag";
		this.menuId = "5_X";

		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;

		this.classStyle = "tags videos";
	},

	displayMore:function(){
		createOngletTags().selectTab(0,false);
	}
}

//set the extends class
CW_AjaxPage_video_tag_listing.prototype = Object.extend(new CW_AjaxPage_media_tag_listing(),CW_AjaxPage_video_tag_listing.prototype);



//*****

function CW_AjaxPage_photo_tag_listing () {
	this.initialize();
}

CW_AjaxPage_photo_tag_listing.prototype = {
	initialize: function(){


		this.name = "photo_tag_listing";
		this.statId = "tag";
		this.menuId = "5_X";

		this.loadedHTMLPage = "html/media/photoListing.html";
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_IMAGE;

		this.classStyle = "tags pictures";
	},

	displayMore:function(){
		createOngletTags().selectTab(1,false);
	}
}

//set the extends class
CW_AjaxPage_photo_tag_listing.prototype = Object.extend(new CW_AjaxPage_media_tag_listing(),CW_AjaxPage_photo_tag_listing.prototype);





function CW_AjaxPage_music_tag_listing () {	this.initialize();}

CW_AjaxPage_music_tag_listing.prototype = {
	initialize: function(){


		this.name = "music_tag_listing";
		this.statId = "tag";
		this.menuId = "5_X";

		this.loadedHTMLPage = "html/media/musicListing.html";
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_MUSIC;

		this.classStyle = "tags audio";
	},

	displayMore:function(){
		createOngletTags().selectTab(1,false);
	}
}

//set the extends class
CW_AjaxPage_music_tag_listing.prototype = Object.extend(new CW_AjaxPage_media_tag_listing(),CW_AjaxPage_music_tag_listing.prototype);


//****************

function CW_AjaxPage_member_tag_listing () {
	this.initialize();
}

CW_AjaxPage_member_tag_listing.prototype = {

	initialize: function(){

		this.name = "member_tag_listing";
		this.statId = "tag";
		this.menuId = "5_X";

		//specific itemListing
		this.loadedHTMLPage = "html/member/memberListing.html";
		this.pagerName= "membertaglist";
		this.pagerId = "pager_id";
		this.filterType = CW_Filter.Filter_MEMBER;
		this.pageContainerId = "member_container";


		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;
		this.displayCiontentDivId = "media_Listing_content";
		this.classStyle = "tags members";
	},

	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","user.tag");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_membre);
		hashtableRequestParameters.put("identifier",identifier);
		hashtableRequestParameters.put("tag.uid",identifier);
		return new ComwebPager("member_container","pager_id",callback,CW_Action_User.SERVLET_URI,hashtableRequestParameters)
	},
	displayMore:function(){
		createOngletTags().selectTab(2,false);
	}
}
//set the extends class
CW_AjaxPage_member_tag_listing.prototype = Object.extend(new CW_AjaxPage_member_listing(),CW_AjaxPage_member_tag_listing.prototype);




function CW_AjaxPage_playlist_tag_listing () {
	this.initialize();
}

CW_AjaxPage_playlist_tag_listing.prototype = {

	initialize: function(){

		this.name = "playlist_tag_listing";
		this.statId = "tag";
		this.menuId = "5_X";

		//specific itemListing
		this.loadedHTMLPage = "html/playlists/playlistListing.html";
		this.pagerName= "membertaglist";
		this.pagerId = "pager_id";
		this.filterType = CW_Filter.Filter_PLAYLIST;
		this.pageContainerId = "member_container";


		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;
		this.displayContentDivId = "playlist_Listing_content";

		this.classStyle = "tags playlists";

	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "playlistListing_pager", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:"get.pl"</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:5, (nb playlist item in this page)</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "playlist_Listing"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_User.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */

	getPager:function(page,params,identifier){
		//MediaServlet?_=1&action=get.groups.tag&listing.nbre.elements=12&listing.order=0&listing.page=1&listing.since=0&lng=FR&media.type=1&site.uid=2&tag.uid=203
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","get.groups.tag");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("tag.uid",identifier);
		hashtableRequestParameters.put("identifier",identifier);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_playlist);
		return new ComwebPager("playlist_Listing","playlistListing_pager",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	},

	displayMore:function(){
		createOngletTags().selectTab(3,false);
	}
}
//set the extends class
CW_AjaxPage_playlist_tag_listing.prototype = Object.extend(new CW_AjaxPage_playlist_listing(),CW_AjaxPage_playlist_tag_listing.prototype);









/**
 * @class the following class allow to set the behavior of tag listing page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>tag_listing_item</td>
 *			<td>tag</td>
 *			<td>1_4</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Tag/listing/Item
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_tag_listing_item () {this.initialize();}
CW_AjaxPage_tag_listing_item.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: tag_listing_item</li>
	 * 		<li>statId: tag</li>
	 * 		<li>menuId: 1_4</li>
	 * </ul>
	 *other attributes which used by extended object:
	 * <ul>
	 * 		<li>CW_GlobalVar_iTEM_TYPE: 2° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 *	 	<li>mediaType: 3° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "tag_listing_item";
		this.statId = "tag";
		this.menuId = "5_X";

		this.CW_GlobalVar_iTEM_TYPE = 0;
		this.mediaType = 0;

		this.classStyle = "tags pictures";
	},
	/**
	 * The following function realise:
	 * <ul>
	 * 		<li> the html template ("html/tags/tagList.html") loading in the htmlDivElement identified by "masterPage"</li>
	 * 		<li> invoke displayMore function</li>
	 * </ul>
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @return {void}
	 */
	display:function(params,identifier){
		CW_comwebAjax.loadHtml("html/tags/tagList.html","masterPage");
		this.displayMore(params,identifier);
	},
	/**
	 * Function which is invoke when display function was been processed, this function must be overwrite in extended class
	 * in order to realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet</li>
	 * 		<li>launch the ajax request in order to realise the displayContent function </li>
	 * </ul>
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
	},
	/**
	 * Display the content page, using ajax request result, this result must be provide comwebBean_tag,
	 * if there are no tag the HtmlDivElement identified by "tag_List_Content" will be contain the i18n general.noContent text,
	 * otherwise for each tag an href link will be insert in this htmlDivElement with the following code:
	 * <br/>
	 * '&lt;a href="javascript:goToTagListingPage('+tag.getUid()+',\'\','+this.CW_GlobalVar_iTEM_TYPE+','+this.mediaType+')" class="'+getTagClass(CW_GlobalVar.ITEM_TYPE_MEDIA,tag.getCounter())+'"&gt;'+tag.getText()+'&lt;/a&gt;');
	 * @param {ComwebBean} comwebBean xml wrapper of the ajax request
	 * @param {RequestResume} requestResume request resume of the ajax request
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		var div = document.getElementById("tag_List_Content");
		var tagArray =  comwebBean.getSpecificChildren("tag");
		var tag = null;

		if (tagArray!=null && tagArray.length > 0){
			div.innerHTML = "";
			var contentTag = "<ul>";
			for (var i=0;i<tagArray.length;i++){
				tag = tagArray[i];
				contentTag +='<li><a href="javascript:goToTagListingPage('+tag.getUid()+',\'\','+this.CW_GlobalVar_iTEM_TYPE+','+this.mediaType+')" class="'+getTagClass(CW_GlobalVar.ITEM_TYPE_MEDIA,tag.getCounter())+'">'+tag.getText()+'</a></li>';
			}
			contentTag += "</ul>";
			div.innerHTML = contentTag;
		}else{
			div.innerHTML = CW_internationalization.getValue("general.noContent");
		}
		dhtmlHistory.add(this.getHistoryPageName());
	}
}
//set the extends class
CW_AjaxPage_tag_listing_item.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_tag_listing_item.prototype);
/**
 * @class the following class allow to set the member tag listing page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>tag_listing_member</td>
 *			<td>tag</td>
 *			<td>5_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Tag/listing/Member
 * @extends CW_AjaxPage_tag_listing_item
 */
function CW_AjaxPage_tag_listing_member () {this.initialize();}
CW_AjaxPage_tag_listing_member.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: tag_listing_member</li>
	 * 		<li>statId: tag</li>
	 * 		<li>menuId: 5_X</li>
	 * </ul>
	 *other attributes which overwrite CW_AjaxPage_tag_listing_item attributes
	 * <ul>
	 * 		<li>CW_GlobalVar_iTEM_TYPE: CW_GlobalVar.ITEM_TYPE_USER;, 2° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 *	 	<li>mediaType:0, 3° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "tag_listing_member";
		this.statId = "tag";
		this.menuId = "5_X";

		this.CW_GlobalVar_iTEM_TYPE = CW_GlobalVar.ITEM_TYPE_USER;
		this.mediaType = 0;

		this.classStyle = "tags members";
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(2,false);</li>
	 * 		<li>launch the ajax request in order to realise the displayContent function, CW_Action_Tag.displayMemberSinceAllTag </li>
	 * </ul>
	 * @see CW_Action_Tag#displayMemberSinceAllTag
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		createOngletTags().selectTab(1,false);
		CW_Action_Tag.displayMemberSinceAllTag(callback);
	}
}
//set the extends class
CW_AjaxPage_tag_listing_member.prototype = Object.extend(new CW_AjaxPage_tag_listing_item(),CW_AjaxPage_tag_listing_member.prototype);


function CW_AjaxPage_tag_listing_playlist () {this.initialize();}
CW_AjaxPage_tag_listing_playlist.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: tag_listing_member</li>
	 * 		<li>statId: tag</li>
	 * 		<li>menuId: 5_X</li>
	 * </ul>
	 *other attributes which overwrite CW_AjaxPage_tag_listing_item attributes
	 * <ul>
	 * 		<li>CW_GlobalVar_iTEM_TYPE: CW_GlobalVar.ITEM_TYPE_USER;, 2° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 *	 	<li>mediaType:0, 3° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "tag_listing_playlist";
		this.statId = "tag";
		this.menuId = "5_X";

		this.CW_GlobalVar_iTEM_TYPE = CW_GlobalVar.ITEM_TYPE_GROUP;
		this.mediaType = 0;

		this.classStyle = "tags playlist";
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(2,false);</li>
	 * 		<li>launch the ajax request in order to realise the displayContent function, CW_Action_Tag.displayMemberSinceAllTag </li>
	 * </ul>
	 * @see CW_Action_Tag#displayMemberSinceAllTag
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		createOngletTags().selectTab(4,false);
		var parameters = new Array();
		parameters.push('action=tags');
		parameters.push('item.type=' + CW_GlobalVar.ITEM_TYPE_GROUP);
		CW_comwebAjax.sendRequest(CW_Action_Tag.SERVLET_URI, callback, null, 'membertagday', parameters,null);
	}
}
//set the extends class
CW_AjaxPage_tag_listing_playlist.prototype = Object.extend(new CW_AjaxPage_tag_listing_item(),CW_AjaxPage_tag_listing_playlist.prototype);



/**
 * @class the following class allow to set the video tag listing page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>tag_listing_video</td>
 *			<td>tag</td>
 *			<td>5_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Tag/listing/Video
 * @extends CW_AjaxPage_tag_listing_item
 */
function CW_AjaxPage_tag_listing_video () {	this.initialize();}
CW_AjaxPage_tag_listing_video.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: tag_listing_video</li>
	 * 		<li>statId: tag</li>
	 * 		<li>menuId: 5_X</li>
	 * </ul>
	 *other attributes which overwrite CW_AjaxPage_tag_listing_item attributes
	 * <ul>
	 * 		<li>CW_GlobalVar_iTEM_TYPE: CW_GlobalVar.ITEM_TYPE_MEDIA;, 2° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 *	 	<li>mediaType:CW_Action_Media.Media_TYPE_VIDEO, 3° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "tag_listing_video";
		this.statId = "tag";
		this.menuId = "5_X";

		this.CW_GlobalVar_iTEM_TYPE = CW_GlobalVar.ITEM_TYPE_MEDIA;
		this.mediaType = CW_Action_Media.Media_TYPE_VIDEO;

		this.classStyle = "tags videos";
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(0,false);</li>
	 * 		<li>launch the ajax request in order to realise the displayContent function, CW_Action_Tag.displayMediaSinceAllTag </li>
	 * </ul>
	 * @see CW_Action_Tag#displayMediaSinceAllTag
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		createOngletTags().selectTab(0,false);
		CW_Action_Tag.displayMediaSinceAllTag(callback,this.mediaType);
	}
}
//set the extends class
CW_AjaxPage_tag_listing_video.prototype = Object.extend(new CW_AjaxPage_tag_listing_item(),CW_AjaxPage_tag_listing_video.prototype);
/**
 * @class the following class allow to set the photo tag listing page
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>tag_listing_video</td>
 *			<td>tag</td>
 *			<td>5_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Tag/listing/Photo
 * @extends CW_AjaxPage_tag_listing_item
 */
function CW_AjaxPage_tag_listing_photo () {this.initialize();}
CW_AjaxPage_tag_listing_photo.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: tag_listing_photo</li>
	 * 		<li>statId: tag</li>
	 * 		<li>menuId: 5_X</li>
	 * </ul>
	 *other attributes which overwrite CW_AjaxPage_tag_listing_item attributes
	 * <ul>
	 * 		<li>CW_GlobalVar_iTEM_TYPE: CW_GlobalVar.ITEM_TYPE_MEDIA;, 2° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 *	 	<li>mediaType:CW_Action_Media.Media_TYPE_IMAGE, 3° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "tag_listing_photo";
		this.statId = "tag";
		this.menuId = "5_X";

		this.CW_GlobalVar_iTEM_TYPE = CW_GlobalVar.ITEM_TYPE_MEDIA;
		this.mediaType = CW_Action_Media.Media_TYPE_IMAGE;

		this.classStyle = "tags pictures";
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(1,false);</li>
	 * 		<li>launch the ajax request in order to realise the displayContent function, CW_Action_Tag.displayMediaSinceAllTag </li>
	 * </ul>
	 * @see CW_Action_Tag#displayMediaSinceAllTag
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		createOngletTags().selectTab(1,false);
		CW_Action_Tag.displayMediaSinceAllTag(callback,this.mediaType);
	}
}
//set the extends class
CW_AjaxPage_tag_listing_photo.prototype = Object.extend(new CW_AjaxPage_tag_listing_item(),CW_AjaxPage_tag_listing_photo.prototype);



function CW_AjaxPage_tag_listing_music () {this.initialize();}
CW_AjaxPage_tag_listing_music.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: tag_listing_photo</li>
	 * 		<li>statId: tag</li>
	 * 		<li>menuId: 5_X</li>
	 * </ul>
	 *other attributes which overwrite CW_AjaxPage_tag_listing_item attributes
	 * <ul>
	 * 		<li>CW_GlobalVar_iTEM_TYPE: CW_GlobalVar.ITEM_TYPE_MEDIA;, 2° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 *	 	<li>mediaType:CW_Action_Media.Media_TYPE_IMAGE, 3° parameters values used in writted href (goToTagListingPage) in displayContent function</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "tag_listing_music";
		this.statId = "tag";
		this.menuId = "5_X";

		this.CW_GlobalVar_iTEM_TYPE = CW_GlobalVar.ITEM_TYPE_MEDIA;
		this.mediaType = CW_Action_Media.Media_TYPE_MUSIC;

		this.classStyle = "tags audio";
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(1,false);</li>
	 * 		<li>launch the ajax request in order to realise the displayContent function, CW_Action_Tag.displayMediaSinceAllTag </li>
	 * </ul>
	 * @see CW_Action_Tag#displayMediaSinceAllTag
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		createOngletTags().selectTab(2,false);
		CW_Action_Tag.displayMediaSinceAllTag(callback,this.mediaType);
	}
}
//set the extends class
CW_AjaxPage_tag_listing_music.prototype = Object.extend(new CW_AjaxPage_tag_listing_item(),CW_AjaxPage_tag_listing_music.prototype);



/**
 * @class the following class allow to set the behavior of searched media listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an media listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>search_media</td>
 *			<td>video</td>
 *			<td>1_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>searched words</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Media/Listing:[searched words]/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_media_listing
 */
function CW_AjaxPage_search_media () {this.initialize();}
CW_AjaxPage_search_media.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: search_media</li>
	 * 		<li>statId: video</li>
	 * 		<li>menuId: 1_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/media/searchMedia.html"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_VIDEO</li>
	 * 		<li>displayContentDivId: "search_media_listing"</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "search_media";
		this.statId = "video";
		this.menuId = "X_X";
		//specific itemListing
		this.loadedHTMLPage = "html/media/searchMedia.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;
		this.displayContentDivId  = "search_media_listing";

		this.classStyle = "default";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:""</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:9, (nb member in this page)</li>
	 *		<li>media.type:[this.CW_Action_Media_media_TYPE] </li>
	 *		<li>item.type:CW_GlobalVar.ITEM_TYPE_MEDIA </li>
	 *		<li>identifier:[given identifier] </li>
	 *		<li>words:[given identifier] </li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "search_media_container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is "/comweb/search"
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_media);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE);
		hashtableRequestParameters.put("item.type",CW_GlobalVar.ITEM_TYPE_MEDIA);
		hashtableRequestParameters.put("identifier",identifier);
		hashtableRequestParameters.put("words",identifier);
		return new ComwebPager("search_media_container","pager_id",callback,"/comweb/search",hashtableRequestParameters)
	}
}
//set the extends class
CW_AjaxPage_search_media.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_search_media.prototype);
/**
 * @class the following class allow to set the behavior of searched video listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an media listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>search_video</td>
 *			<td>video</td>
 *			<td>1_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>searched words</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Search/Video:[searched words]/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_search_media
 */
function CW_AjaxPage_search_video () {this.initialize();}
CW_AjaxPage_search_video.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: search_video</li>
	 * 		<li>statId: video</li>
	 * 		<li>menuId: 1_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/media/searchMedia.html"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_VIDEO</li>
	 * 		<li>displayContentDivId: "search_media_listing"</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "search_video";
		this.statId = "video";
		this.menuId = "X_X";
		//specific itemListing
		this.loadedHTMLPage = "html/media/searchMedia.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;
		this.displayContentDivId  = "search_media_listing";

		this.classStyle = "videos";
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(0,false)</li>
	 * </ul>
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		createOngletListing().selectTab(0,false);
		try{
			var form = document.forms["mainSearch"];
			CW_util.setSelectedIndex(CW_util.getFormElement(form,"search.category"),1);
		}catch(e){
		}
	}
}

//set the extends class
CW_AjaxPage_search_video.prototype = Object.extend(new CW_AjaxPage_search_media(),CW_AjaxPage_search_video.prototype);
/**
 * @class the following class allow to set the behavior of searched photo listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an media listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>search_photo</td>
 *			<td>photo</td>
 *			<td>2_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>searched words</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Search/Photo:[searched words]/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_search_media
 */
function CW_AjaxPage_search_photo () {this.initialize();}
CW_AjaxPage_search_photo.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: search_photo</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 2_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/media/searchMedia.html"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_IMAGE</li>
	 * 		<li>displayContentDivId: "search_media_listing"</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "search_photo";
		this.statId = "photo";
		this.menuId = "X_X";
		//specific itemListing
		this.loadedHTMLPage = "html/media/searchMedia.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_IMAGE;
		this.displayContentDivId  = "search_media_listing";

		this.classStyle = "pictures";
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(1,false)</li>
	 * 		<li>try to set the photo searched title page</li>
	 * </ul>
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		createOngletListing().selectTab(1,false);
		try{document.getElementById("search_media_title").innerHTML= CW_internationalization.getValue("search.titlePage.photo")}catch(e){}

		try{
			var form = document.forms["mainSearch"];
			CW_util.setSelectedIndex(CW_util.getFormElement(form,"search.category"),2);
		}catch(e){
		}
	}
}
//set the extends class
CW_AjaxPage_search_photo.prototype = Object.extend(new CW_AjaxPage_search_media(),CW_AjaxPage_search_photo.prototype);





function CW_AjaxPage_search_music () {this.initialize();}
CW_AjaxPage_search_music.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: search_photo</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 2_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/media/searchMedia.html"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_IMAGE</li>
	 * 		<li>displayContentDivId: "search_media_listing"</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "search_music";
		this.statId = "music";
		this.menuId = "X_X";
		//specific itemListing
		this.loadedHTMLPage = "html/media/searchMedia.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_MUSIC;
		this.displayContentDivId  = "search_media_listing";


		this.classStyle = "audio";
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(1,false)</li>
	 * 		<li>try to set the photo searched title page</li>
	 * </ul>
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		createOngletListing().selectTab(2,false);
		try{document.getElementById("search_media_title").innerHTML= CW_internationalization.getValue("search.titlePage.audio")}catch(e){}

		try{
			var form = document.forms["mainSearch"];
			CW_util.setSelectedIndex(CW_util.getFormElement(form,"search.category"),4);
		}catch(e){
		}
	}
}
//set the extends class
CW_AjaxPage_search_music.prototype = Object.extend(new CW_AjaxPage_search_media(),CW_AjaxPage_search_music.prototype);


/**
 * @class the following class allow to set the behavior of searched member listing page, this page contains a filter (CW_Filter),
 * a pager ,it displayed an media listing
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>search_member</td>
 *			<td>member</td>
 *			<td>3_X</td>
 *			<td>false</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>searched words</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Search/Member:[searched words]/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_member_listing
 */
function CW_AjaxPage_search_member (){this.initialize();}
CW_AjaxPage_search_member.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: search_member</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 3_X</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/member/memberListing.html"</li>
	 * 		<li>displayContentDivId: "search_member_listing"</li>
	 * </ul>
	 *@return {void}
	 */
	initialize: function(){
		this.name = "search_member";
		this.statId = "member";
		this.menuId = "X_X";
		//overwrite CW_AjaxPage_item_listing
		this.loadedHTMLPage = "html/member/searchMember.html";
		this.displayContentDivId  = "search_member_listing";

		this.classStyle = "members";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:""</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:16, (nb member in this page)</li>
	 *		<li>item.type:CW_GlobalVar.ITEM_TYPE_USER </li>
	 *		<li>identifier:[given identifier] </li>
	 *		<li>words:[given identifier] </li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "search_member_container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is "/comweb/search"
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_public_membre);
		hashtableRequestParameters.put("item.type",CW_GlobalVar.ITEM_TYPE_USER);
		hashtableRequestParameters.put("identifier",identifier);
		hashtableRequestParameters.put("words",identifier);
		return new ComwebPager("search_member_container","pager_id",callback,"/comweb/search",hashtableRequestParameters)
	},
	/**
	 * Function which is invoke when display function was been processed, and realise
	 * <ul>
	 * 		<li>display the listing onglet (createOngletListing) and select the correct page onglet, createOngletListing().selectTab(2,false)</li>
	 * </ul>
	 * @see GLOBALS#createOngletListing
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		createOngletListing().selectTab(1,false);

		try{
			var form = document.forms["mainSearch"];
			CW_util.setSelectedIndex(CW_util.getFormElement(form,"search.category"),3);
		}catch(e){
		}
	}
}
//set the extends class
CW_AjaxPage_search_member.prototype = Object.extend(new CW_AjaxPage_member_listing(),CW_AjaxPage_search_member.prototype);

/**
 * @class the following class allow to set the behavior of mail box page (inbox, outbox, savedbax),
 *those page must display the corresponding message box of the connected user
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_mailbox</td>
 *			<td>member</td>
 *			<td>1_4</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Mailbox
 * @extends CW_AjaxPage_MODEL
 */

function CW_AjaxPage_my_count_mailbox () {this.initialize();}
CW_AjaxPage_my_count_mailbox.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_mailbox</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 1_4</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which used by extended object:
	 * <ul>
	 * 		<li>loadedHTMLPage:"html/mailBox/mailBox.html", page which is load in the htmlDivElment identified by "masterPage"</li>
	 *	 	<li>this.mbFolder:CW_Action_Message.BOX_ID_[INBOX|OUTBOX|SAVED];</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "my_count_mailbox";
		this.statId = "member";
		this.menuId = "0_X";
		this.mustBeConnected = true;

		//specific CW_AjaxPage_my_count_mailbox
		this.loadedHTMLPage = "html/mailBox/mailBox.html";
		this.mbFolder = CW_Action_Message.BOX_ID_INBOX;
		this.classStyle = "myScroon mailBox";
	},
	/**
	 * The following function realise:
	 * <ul>
	 * 		<li> the html template (determined by loadedHTMLPage attribute) loading in the htmlDivElement identified by "masterPage"</li>
	 * 		<li> invoke displayMore function</li>
	 * 		<li> build the ajax request which deliver the message list content of this mail box ,CW_Action_Message.displayBoxMessages(callback,this.mbFolder),the ajax process will invoke this displayContent function as a callback with the message result</li>
	 * </ul>
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @see CW_Action_Message#displayBoxMessages
	 * @return {void}
	 */
	display:function(params,identifier){
		//Load html templates
		CW_comwebAjax.loadHtml(this.loadedHTMLPage,"masterPage");
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		this.displayMore(params,identifier);
		CW_Action_Message.displayBoxMessages(callback,this.mbFolder);
		currentMailBoxFolder = this.mbFolder;
	},
	/**
	 * the following function is invoked at the end of display function process and allow to
	 * display the mailbox onglet (inbox, outbox, saved box) and select the corresponding one
	 * @see GLOBALS#createOngletMail
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @return {void}
	 */
	displayMore:function(params,identifier){
		createOngletMail().selectTab(this.mbFolder - 1 ,false);
	},

	/**
	 * Display the message list with loadBrick_mailBox_mailElement function, in the htmlDivElement
	 * identified by "mailBoxListingContainer", at the begin this function try to clear arrayMultiMsg
	 * variable which is Comweb_ArrayMulti object and allow to order mail (by date,object,sender), we must
	 * clear this object because loadBrick_mailBox_mailElement will push the mail message and so we must
	 * delete the old one
	 * @see GLOBALS#loadBrick_mailBox_mailElement
	 * @param {ComwebBean} comwebBean xml wrapper of the ajax request
	 * @param {RequestResume} requestResume request resume of the ajax request
	 */
	displayContent:function(comwebBean,requestResume){
		try{arrayMultiMsg.clear();}catch(e){}
		var parentDiv = document.getElementById("mailBoxListingContainer");
		var divId = "mailBoxListingContainer";
		if (parentDiv){
			parentDiv.innerHTML = "";
			var comwebMessageFolderArray = comwebBean.getSpecificChildren("mailbox")[0].getSpecificChildren("folderMessage");
			if (comwebMessageFolderArray.length > 0){
				for (var i=0;i<comwebMessageFolderArray.length;i++){
					var comwebBeanFolderMessage = comwebMessageFolderArray[i];
					loadBrick_mailBox_mailElement(comwebBeanFolderMessage,this.mbFolder,divId,true);
				}
			}
			if (parentDiv.innerHTML == ""){
				parentDiv.innerHTML = CW_internationalization.getValue("general.noContent");
			}
		}
		try{ dhtmlHistory.add(this.getHistoryPageName());}catch(e){}
		var buildedNode = CW_comwebAjax.loadHtml("html/mailBox/mailBoxViewDefault.html","mailBoxView",null,false);
	}
}
//set the extends class
CW_AjaxPage_my_count_mailbox.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_my_count_mailbox.prototype);
/**
 * @class the following class allow to display mail inbox page
 *this page must display the corresponding message inbox of the connected user
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_mail_inbox</td>
 *			<td>member</td>
 *			<td>0_X</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Mail/Inbox
 * @extends CW_AjaxPage_my_count_mailbox
 */
function CW_AjaxPage_my_count_mail_inbox () {this.initialize();}
CW_AjaxPage_my_count_mail_inbox.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_mail_inbox</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 0_X</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite CW_AjaxPage_my_count_mailbox
	 * <ul>
	 *	 	<li>this.mbFolder:CW_Action_Message.BOX_ID_INBOX;</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "my_count_mail_inbox";
		this.statId = "member";
		this.menuId = "X_X";
		this.mustBeConnected = true;

		this.mbFolder = CW_Action_Message.BOX_ID_INBOX;

		this.classStyle = "myScroon mailBox";
	}
}
//set the extends class
CW_AjaxPage_my_count_mail_inbox.prototype = Object.extend(new CW_AjaxPage_my_count_mailbox(),CW_AjaxPage_my_count_mail_inbox.prototype);
/**
 * @class the following class allow to display mail outbox page
 *this page must display the corresponding message outbox of the connected user
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_mail_outbox</td>
 *			<td>member</td>
 *			<td>0_X</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Mail/Outbox
 * @extends CW_AjaxPage_my_count_mailbox
 */
function CW_AjaxPage_my_count_mail_outbox() {this.initialize();}
CW_AjaxPage_my_count_mail_outbox.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_mail_outbox</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 0_X</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite CW_AjaxPage_my_count_mailbox
	 * <ul>
	 *	 	<li>this.mbFolder:CW_Action_Message.BOX_ID_OUTBOX;</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "my_count_mail_outbox";
		this.statId = "member";
		this.menuId = "X_X";
		this.mustBeConnected = true;

		this.mbFolder = CW_Action_Message.BOX_ID_OUTBOX;
		this.classStyle = "myScroon mailBox";
	}
}
//set the extends class
CW_AjaxPage_my_count_mail_outbox.prototype = Object.extend(new CW_AjaxPage_my_count_mailbox(),CW_AjaxPage_my_count_mail_outbox.prototype);
/**
 * @class the following class allow to display saved box page
 *this page must display the corresponding message saved box of the connected user
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_mail_saved</td>
 *			<td>member</td>
 *			<td>0_X</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Mail/Saved
 * @extends CW_AjaxPage_my_count_mailbox
 */
function CW_AjaxPage_my_count_mail_saved() {this.initialize();}
CW_AjaxPage_my_count_mail_saved.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_mail_saved</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 0_X</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite CW_AjaxPage_my_count_mailbox
	 * <ul>
	 *	 	<li>mbFolder:CW_Action_Message.BOX_ID_SAVED;</li>
	 * 		<li>loadedHTMLPage:"html/mailBox/mailBoxNoStatus.html"</li>
	 * </ul>
	 * @return {void}
	 */
	initialize: function(){
		this.name = "my_count_mail_saved";
		this.statId = "member";
		this.menuId = "X_X";
		this.mustBeConnected = true;
		this.loadedHTMLPage = "html/mailBox/mailBoxNoStatus.html";

		this.mbFolder = CW_Action_Message.BOX_ID_SAVED;
		this.classStyle = "myScroon mailBox";
	}
}
//set the extends class
CW_AjaxPage_my_count_mail_saved.prototype = Object.extend(new CW_AjaxPage_my_count_mailbox(),CW_AjaxPage_my_count_mail_saved.prototype);
/**
 * @class the following class allow to display the connected user playlist listing page, this pages must contain a filter (CW_Filter),
 * must contain too a pager ,and must displayed an item list like member or video.
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_playlist</td>
 *			<td>member</td>
 *			<td>0_3</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Playlist/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * @extends CW_AjaxPage_item_listing
 */
function CW_AjaxPage_my_count_playlist(){this.initialize();}
CW_AjaxPage_my_count_playlist.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_playlist</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 0_3</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/myScroon/myPlaylist/myPlaylist.html""</li>
	 *	 	<li>filterType: CW_Filter.Filter_PLAYLIST</li>
	 * 		<li>displayContentDivId:"myScroon_Content_video"</li>
	 * </ul>
	 *@return {void}
	 */
	initialize:function(){
		this.name = "my_count_playlist";
		this.statId = "member";
		this.menuId = "0_2";
		this.mustBeConnected = true;

		//specific itemListing
		this.loadedHTMLPage = "html/myScroon/myPlaylist/myPlaylist.html";
		this.filterType = CW_Filter.Filter_PLAYLIST;
		this.displayContentDivId = "myScroon_Content_video";
		this.selectedMyScroonMenuIndex = 5;

		this.classStyle = "myScroon playlists";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:"get.user.pl"</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:5, (nb playlist item in this page)</li>
	 * 		<li>user.myspace:true</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "myScroon_Container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_User.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","get.user.pl");
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_myscroon_playlist);
		hashtableRequestParameters.put("user.myspace",true);
		return new ComwebPager("myScroon_Container","pager_id",callback,CW_Action_User.SERVLET_URI,hashtableRequestParameters)
	},
	/**
	 * The following function is the display callback. So the comwebBean is the result of the
	 * of the getPager function builded request, and in this case contain a list of 5 playlist. after
	 * has retrieve the playlist, playlist are displayed with loadBrick_myscroon_myPlaylistElement function in htmlDivelement
	 * identified by "myScroon_Content_video"
	 *
	 * @see GLOBALS#loadBrick_myscroon_myPlaylistElement
	 * @param {ComwebBean} comwebBean xml bean
	 * @param {RequestResume} requestResume request resume
	 * @return {void}
	 */
	displayContent:function(comwebBean,requestResume){
		var parentDiv = document.getElementById(this.displayContentDivId);
		CW_logger.log(CW_logger.LEVEL_INFORMATION, " comebPage playlist listing : " + this.pagerName + " .displayContent");
		if (parentDiv){
			if(comwebBean!=null){
				this.mananageHistoryAndPager(comwebBean,requestResume);
				parentDiv.innerHTML = "";
				var comwebBeanGroupArray = comwebBean.getSpecificChildren("list")[0].getSpecificChildren("group");
				if(comwebBeanGroupArray.length>0){
					for(var i=0;i<comwebBeanGroupArray.length;i++){
						var comwebBeanGroup = comwebBeanGroupArray[i];
						loadBrick_myscroon_myPlaylistElement(comwebBeanGroup,this.displayContentDivId);
					}
				}else{
					parentDiv.innerHTML = "<p id='myScroonNoContent'>" + CW_internationalization.getValue("general.noContent") + "</p>";
				}
			}
		}
	},
	displayMore:function(params,identifier){
		//CW_comwebAjax.loadHtml("html/myScroon/menuMyScroon.html","myScroon_ContainerMenu");
		//document.getElementById("menuMyScroon").getElementsByTagName("li").item(this.selectedMyScroonMenuIndex).className = "menuMyScroonSelected";
	}
}
//set extend class
CW_AjaxPage_my_count_playlist.prototype = Object.extend(new CW_AjaxPage_item_listing(),CW_AjaxPage_my_count_playlist.prototype);
/**
 * @class the following class allow to display the creating playlist (only for connected user) page,
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>my_count_playlist_create</td>
 *			<td>member</td>
 *			<td>0_X</td>
 *			<td>true</td>
 *			<td>false</td>
 *			<td>no parameters</td>
 *			<td>no identifier</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #My/Count/Playlist/Create
 * @extends CW_AjaxPage_MODEL
 */
function CW_AjaxPage_my_count_playlist_create(){this.initialize();}

CW_AjaxPage_my_count_playlist_create.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: my_count_playlist_create</li>
	 * 		<li>statId: member</li>
	 * 		<li>menuId: 0_X</li>
	 * 		<li>mustBeConnected: true</li>
	 * </ul>
	 *@return {void}
	 */
	initialize:function(){
		this.name = "my_count_playlist_create";
		this.statId = "member";
		this.menuId = "0_2";
		this.mustBeConnected = true;

		this.classStyle = "myScroon playlists";
	},
	/**
	 * The following function allow to tml/myScroon/myPlaylist/createPlaylist.html html template in the htmlDivElement identified by "masterPage" and:
	 * <ul>
	 * 		<li>load the "html/myScroon/myPlaylist/infoPlaylist.html"  in the htmlDivElement identified by "playlistCreateForms" </li>
	 * 		<li>load the select list video category content in in HtmlSelectElement identified by "pl.caty" </li>
	 * 		<li>set the "lang.uid" inputElement value </li>
	 * 	<ul>
	 * Then set the history page, with dhtmlHistory.add(this.getHistoryPageName());
	 * @param {String} params history parameters, not used
	 * @param {String} identifier page identifier, not used
	 * @see CW_comwebAjax#loadHtml
	 * @return {void}
 	 */
	display:function(params,identifier){
		//last.media.title.playlist
		var params = new HashTable();
		params.put("username",CW_config.getConnectedUser().getUsername());
		params.put("mediatype",CW_internationalization.getValue("last.media.title.playlist").toLowerCase());
		CW_comwebAjax.loadHtml("html/myScroon/myPlaylist/createPlaylist.html","masterPage");
		CW_comwebAjax.loadHtml("html/myScroon/myPlaylist/infoPlaylist.html","playlistCreateForms",params);
		//CountryLangManager._setLangListContent("playlistInfoForm","lang.uid");
		CW_util.setCategoryListContent("playlistInfoForm","pl.caty",CW_Action_Media.Media_TYPE_VIDEO);
		var form = document.forms["playlistInfoForm"];
		CW_util.getFormElement(form,"lang.uid").value = CW_internationalization.getUid();
		dhtmlHistory.add(this.getHistoryPageName());
	}
}

//set extend class
CW_AjaxPage_my_count_playlist_create.prototype = Object.extend(new CW_AjaxPage_MODEL(),CW_AjaxPage_my_count_playlist_create.prototype);
function CW_AjaxPage_my_count_playlist_edit_video(){this.initialize();}

CW_AjaxPage_my_count_playlist_edit_video.prototype = {
	initialize:function(){
		this.name = "my_count_playlist_edit_video";
		this.statId = "member";
		this.menuId = "0_2";
		this.mustBeConnected = true;
		this.requiredPreDisplay = true;
		//specific itemListing
		this.loadedHTMLPage = null;
		this.pagerName= "mycount_playlist_edit";
		this.pagerId = "pager_id";
		this.filterType = CW_Filter.Filter_MEDIA;
		this.pageContainerId = "myScroon_Container";
		this.CW_Action_Media_media_TYPE_VIDEO  = CW_Action_Media.Media_TYPE_VIDEO;
		this.FilterParam = new HashTable();
		this.displayContentDivId = "myScroon_Content_video";
		this.mediaElementHref = "goToMediaPlayListing";

		this.classStyle = "myScroon videos";
	},

	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "pager_id", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:"get.user.pl"</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:5, (nb playlist item in this page)</li>
	 * 		<li>user.myspace:true</li>
	 * 		<li>group.uid:[given identifier]</li>
	 * 		<li>group.type:0</li>
	 * 		<li>media.type:CW_Action_Media.Media_TYPE_VIDEO</li>
	 * 		<li>user.uid:CW_config.getConnectedUser().getUid()</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "myScroon_Container"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_User.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		//MediaServlet?action=media.group&group.type=0&group.uid=91&listing.nbre.elements=3&listing.order=0&listing.page=1&listing.since=0&lng=IT&media.type=1&page.type=1&pl.name=91&site.uid=3&user.myspace=true&user.uid=6255
		//MediaServlet?edia.type=1&page.type=1&pl.name=91&site.uid=3&user.myspace=true&user.uid=6255
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action","media.group");
		hashtableRequestParameters.put("group.type",0);
		hashtableRequestParameters.put("group.uid",identifier);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_myscroon_media);
		hashtableRequestParameters.put("listing.page",page);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE_VIDEO);
		//hashtableRequestParameters.put("page.type",this.CW_Action_Media_media_TYPE_VIDEO);
		//hashtableRequestParameters.put("pl.name",identifier);
		hashtableRequestParameters.put("user.uid",CW_config.getConnectedUser().getUid());
		hashtableRequestParameters.put("user.myspace","true");
		hashtableRequestParameters.put("identifier",identifier);
		return new ComwebPager("myScroon_Container","pager_id",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters);
	},

	preDisplay:function(params,identifier){
	
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').preDisplayCallback";
		var hashtableStore = new HashTable();
		hashtableStore.put("params",params);
		hashtableStore.put("identifier",identifier);
		CW_Action_User.displayPlaylist(callback,identifier,hashtableStore);
	},

	preDisplayCallback:function(comwebBean,requestResume){
		//Load html templates
		var params = new HashTable();

		CW_comwebAjax.loadHtml("html/myScroon/myPlaylist/editPlaylist/editPlaylist.html","masterPage",params);
		CW_comwebAjax.loadHtml("html/myScroon/myPlaylist/editPlaylist/myPlaylistMedia.html","playlistEditPager");
		var comwebBeanGroupArray = comwebBean.getSpecificChildren('list')[0].getSpecificChildren("group");
		var comwebBeanGroup=comwebBeanGroupArray[0];
		loadbrick_myscroon_myPlaylist_infoEdit(comwebBeanGroup,"playlistEditForms");
		CW_util.setCategoryListContent("playlistInfoForm","pl.caty",CW_Action_Media.Media_TYPE_VIDEO,comwebBeanGroup.getCategoryUid());
		//CountryLangManager._setLangListContent("playlistInfoForm","lang.uid",parseInt(comwebBeanGroup.getValues("pl.lang.uid"))); not use in playlistEdit for premiere
		if (comwebBeanGroupArray.length >0){
			this.display(requestResume.hashTableStore.get("params"),requestResume.hashTableStore.get("identifier"));
		}
	},

	display:function(params,identifier){
		var paramArray = (new String(params)).split("/");
		var CW_Filter_SINCE = CW_Filter.convertHistValueToSinceInt(new String(paramArray[0]));
		var CW_Filter_ORDER = CW_Filter.convertHistValueToOrderInt(new String(paramArray[1]));
		var page = parseInt((new String(paramArray[2])).replace("Page=",""));
		var form = document.forms["selectUserPlayList"];
		CW_util.getFormElement(form,"pl.name").value=identifier;
		CW_util.getFormElement(form,"page.type").value=this.CW_Action_Media_media_TYPE_VIDEO;
		//load the common filter in member page (div filter_common)
		//set the common filter values
		//loadBrick_filter_common(this.pagerName,"filter_common",this.filterType,CW_Filter_ORDER,CW_Filter_SINCE);

		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		CW_logger.log(CW_logger.LEVEL_INFORMATION,"ComwebPage request callback:" + callback);

		/*try{
			this.displayMore();
		}catch(e){
			CW_logger.log(CW_logger.LEVEL_ERROR,"CW_ajax_page_" + this.name + ".displayMore : " + e );
		}
		var pager = new ComwebPager();
		pager.setValues(this.pageContainerId,"delete",callback,this.pagerId,this.pagerName);
		pager.display(page,this.getFilterParams(params,identifier));*/


		var pager =  this.getPager(page,params,identifier);
		try{
			loadBrick_filter_common(pager.pagerName,"filter_common",this.filterType,CW_Filter_ORDER,CW_Filter_SINCE);
		}catch(e){}
		pager.display();
		try{ this.displayMore(params,identifier);}catch(e){}
	},

	displayContent:function(comwebBean,requestResume){
		var parentDiv = document.getElementById(this.displayContentDivId);
		var listingParam = requestResume.queryString;
		var href = "";
		if(comwebBean!=null){
			if(parentDiv){
				parentDiv.innerHTML = "";
				this.mananageHistoryAndPager(comwebBean,requestResume);
				var comwebBeanMediaArray=comwebBean.getSpecificChildren("list")[0].getSpecificChildren("media");
				var comwebBeanMedia = null;
				if(comwebBeanMediaArray.length>0){
					for(var i=0;i<comwebBeanMediaArray.length;i++){
						comwebBeanMedia = comwebBeanMediaArray[i];
						var uid = comwebBeanMedia.getUid();
						href = "goToMediaPlay('" + listingParam+"',"+uid+" );";
						loadbrick_myscroon_myPlaylist_myPlaylistMediaElement(comwebBeanMedia,this.displayContentDivId,href)
					}
				}
				else{
					document.getElementById(this.displayContentDivId).innerHTML = CW_internationalization.getValue("general.noContent");
				}
			}
		}
	},

	displayMore:function(params,identifier){
		var form = document.forms["selectUserPlayList"];
		CW_util.getFormElement(form,"pl.name").value=identifier;
		CW_util.getFormElement(form,"page.type").value=this.CW_Action_Media_media_TYPE_VIDEO;
		//createOngletEditPlaylist().selectTab(0,false);
	}
}

//set extend class

CW_AjaxPage_my_count_playlist_edit_video.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_my_count_playlist_edit_video.prototype);

function CW_AjaxPage_my_count_playlist_edit_photo(){
	this.initialize();
}

CW_AjaxPage_my_count_playlist_edit_photo.prototype = {
	initialize:function(){
		this.name = "my_count_playlist_edit_photo";
		this.statId = "member";
		this.menuId = "0_2";
		this.mustBeConnected = true;
		this.requiredPreDisplay = true;
		//specific itemListing
		this.loadedHTMLPage = "html/myScroon/myPlaylist/editPlaylist/editPlaylist.html";
		this.pagerName= "mycount_playlist_edit";
		this.pagerId = "pager_id";
		this.filterType = CW_Filter.Filter_MEDIA;
		this.pageContainerId = "myScroon_Container";
		this.CW_Action_Media_media_TYPE_VIDEO  = CW_Action_Media.Media_TYPE_IMAGE;
		this.FilterParam = new HashTable();
		this.displayContentDivId = "myScroon_Content_video";
		this.mediaElementHref = "goToMediaPlayListing";

		this.classStyle = "myScroon pictures";
	},

	displayMore:function(params,identifier){
		var form = document.forms["selectUserPlayList"];
		CW_util.getFormElement(form,"pl.name").value=identifier;
		CW_util.getFormElement(form,"page.type").value=this.CW_Action_Media_media_TYPE_VIDEO;
		createOngletEditPlaylist().selectTab(1,false);
	}
}
//extend class
CW_AjaxPage_my_count_playlist_edit_photo.prototype = Object.extend(new CW_AjaxPage_my_count_playlist_edit_video(),CW_AjaxPage_my_count_playlist_edit_photo.prototype);






function CW_AjaxPage_my_count_playlist_edit_music(){
	this.initialize();
}

CW_AjaxPage_my_count_playlist_edit_music.prototype = {
	initialize:function(){
		this.name = "my_count_playlist_edit_music";
		this.statId = "member";
		this.menuId = "0_2";
		this.mustBeConnected = true;
		this.requiredPreDisplay = true;
		//specific itemListing
		this.loadedHTMLPage = "html/myScroon/myPlaylist/editPlaylist/editPlaylist.html";
		this.pagerName= "mycount_playlist_edit";
		this.pagerId = "pager_id";
		this.filterType = CW_Filter.Filter_MEDIA;
		this.pageContainerId = "myScroon_Container";
		this.CW_Action_Media_media_TYPE_VIDEO  = CW_Action_Media.Media_TYPE_MUSIC;
		this.FilterParam = new HashTable();
		this.displayContentDivId = "myScroon_Content_video";
		this.mediaElementHref = "goToMediaPlayListing";

		this.classStyle = "myScroon audio";
	},

	displayMore:function(params,identifier){
		var form = document.forms["selectUserPlayList"];
		CW_util.getFormElement(form,"pl.name").value=identifier;
		CW_util.getFormElement(form,"page.type").value=this.CW_Action_Media_media_TYPE_VIDEO;
		createOngletEditPlaylist().selectTab(2,false);
	}
}
//extend class
CW_AjaxPage_my_count_playlist_edit_music.prototype = Object.extend(new CW_AjaxPage_my_count_playlist_edit_video(),CW_AjaxPage_my_count_playlist_edit_music.prototype);







function CW_AjaxPage_my_count_subscription(){
	this.initialize();
}

CW_AjaxPage_my_count_subscription.prototype = {
	initialize:function(){
		this.name = "my_count_subscription";
		this.statId = "member";
		this.menuId = "6_7";
		this.mustBeConnected = true;
		//this.requiredPreDisplay = true;
		//specific itemListing
		this.loadedHTMLPage = "html/myScroon/mySubscription/mySubscription.html";
		this.pagerName= "mycount_subscription";
		this.pagerId = "itemListing_pager";
		this.filterType = CW_Filter.Filter_MEDIA;
		this.pageContainerId = "myScroon_Container";
		this.CW_Action_Media_media_TYPE_VIDEO  = CW_Action_Media.Media_TYPE_VIDEO;
		this.FilterParam = new HashTable();
		this.displayContentDivId = "item_Listing_content";
		this.mediaElementHref = "goToMediaPlayListing";
		this.selectedMyScroonMenuIndex = null;
		this.mustRefreshElement = true;

		this.classStyle = "myScroon";
	},

	display:function(params,identifier){
		SubscriptionManager.reinitialize();
		var hashtableStore = new HashTable();
		hashtableStore.put("params",params);
		hashtableStore.put("identifier",identifier);
		CW_comwebAjax.loadHtml(this.loadedHTMLPage,"masterPage");
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		CW_Action_Site.displaySubscriptionList(callback,hashtableStore);
		this.displayMore(params,identifier);
	},

	displayContent:function(comwebBean,requestResume){
		dhtmlHistory.add("My/Count/Subscription");
		loadbrick_Filter_MySubscriptionFilter(comwebBean,requestResume);

		try{
			var identifier = requestResume.hashTableStore.get("identifier");
			var ulElementId = null;
			var ulElement  = null;
			if (identifier != null && identifier!="" ){
				identifier = parseInt(identifier);
				switch (identifier) {
					case CW_GlobalVar.ITEM_TYPE_USER: ulElement = document.getElementById("memberSubscription");break;
					case CW_GlobalVar.ITEM_TYPE_GROUP: ulElement = document.getElementById("playlistSubscription");break;
					case CW_GlobalVar.ITEM_TYPE_TAG: ulElement = document.getElementById("tagSubscription");break;
				}
			}else{
				var ulElementIdArray = new Array("memberSubscription","playlistSubscription","tagSubscription");
				var findedUlElement = false;
				for(var index=0; index<ulElementIdArray.length && findedUlElement==false; index++) {
					ulElement = document.getElementById(ulElementIdArray[index]);
					if (ulElement!=null){
						findedUlElement = ulElement.hasChildNodes();
					}
				}
			}
			if (ulElement!=null){
				var elementA = ulElement.getElementsByTagName("li").item(0).getElementsByTagName("a").item(0);
				elementA.onclick();
				return;
			}
		}catch(e){};
		CW_comwebAjax.loadHtml("html/myScroon/mySubscription/mySubscriptionListing.html","myScroon_Content_video");
		var parentDiv = document.getElementById("item_Listing_content");
		parentDiv.innerHTML = CW_internationalization.getValue("general.noContent");

	},
	displayMore:function(params,identifier){
		//CW_comwebAjax.loadHtml("html/myScroon/menuMyScroon.html","myScroon_ContainerMenu");
		//document.getElementById("menuMyScroon").getElementsByTagName("li").item(this.selectedMyScroonMenuIndex).className = "menuMyScroonSelected";
	}
}
//extend class
CW_AjaxPage_my_count_subscription.prototype = Object.extend(new CW_AjaxPage_item_listing(),CW_AjaxPage_my_count_subscription.prototype);



























function goToLastSearch(hash){

	var pageName = CW_AjaxPage_Manager.convertHistoryNameToPageName(hash);
	pageName = pageName.substring(0,pageName.indexOf(":"));

	var form = document.forms["mainSearch"];
	var identifier = hash;
	identifier = identifier.substring(identifier.indexOf(":") +1 );
	identifier = identifier.substring(0,identifier.indexOf("/"));
	CW_util.getFormElement(form,"search.keyword").value = identifier;

	CW_AjaxPage_Manager.handleHistoryChange(hash);
}

function changeCurrentTypePage(newType){
	newType = (new String (newType)).toLowerCase();
	newType = newType.substring(0,1).toUpperCase() + newType.substring(1);

	var page = CW_AjaxPage_Manager.handleNewLocation;

	var regexp = new RegExp("Video|Member|Photo|Music|Playlist");
	page = page.replace(regexp,newType);

	CW_AjaxPage_Manager.handleHistoryChange(page);
}

function changeCurrentMailPage(newType){
	newType = (new String (newType)).toLowerCase();
	newType = newType.substring(0,1).toUpperCase() + newType.substring(1);
	var page = CW_AjaxPage_Manager.handleNewLocation;
	var regexp = new RegExp("Inbox|Outbox|Saved");
	page = page.replace(regexp,newType);

	CW_AjaxPage_Manager.handleHistoryChange(page);
}



/**
 * @class the following class allow to display the showcase video, this page contains a filter (CW_Filter),
 * a pager
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>video_listing_member</td>
 *			<td>video</td>
 *			<td>0_1</td>
 *			<td>false</td>
 *			<td>true</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Media/Listing/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * <br/>
 * this page set required preDisplay because given identifier is the member username but
 * to retrieve the video result we must obtain the user uid
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_media_listing
 */
function CW_AjaxPage_video_showcase_listing() {this.initialize();}
CW_AjaxPage_video_showcase_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: video_showcase_listing</li>
	 * 		<li>statId: video</li>
	 * 		<li>menuId: 0_1</li>
	 * 		<li>requiredPreDisplay: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/media/mediaListing.html"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_VIDEO</li>
	 * </ul>
	 * and tmpVar, this is the attribute which allow to stores the user uid between  preDisplay and displayFunction
	 *@return {void}
	 */
	initialize: function(){
		this.name = "video_showcase_listing";
		this.statId = "video";
		this.menuId = "1_X";
		this.requiredPreDisplay = false;
		//specific itemListing
		this.loadedHTMLPage = "html/media/mediaListing.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_VIDEO;

		this.tmpVar = null;

		this.classStyle = "videos";
	},

	displayMore:function(params,identifier){

		try{
			document.getElementById("media_Listing").getElementsByTagName("div").item(0).getElementsByTagName("h1").item(0).innerHTML = CW_internationalization.getValue("showcase.listing.title");
		}catch(e){

		}

		var masterPageDiv = document.getElementById("masterPage");
		new Insertion.Top(masterPageDiv,'<div id="homeContainer"><div id="videooftheday"></div></div>');
		if (CacheManager.contentFirstShowcaseVideo != null){
			document.getElementById("videooftheday").innerHTML = CacheManager.contentFirstShowcaseVideo;
			document.forms["formVideoUneHome"].style.display = "none";
			document.getElementById("videoUneHomeContainerBottom").style.display = "none"; 
		}else{
			CW_comwebAjax.loadHtml("html/video/videoOfTheDay.html","videooftheday");
			var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "')._displayShowcaseVideoCallback";
			CW_Filter.setOrderFilterValue(CW_Filter.Filter_MEDIA,CW_util.getFormElement(document.forms["formVideoUneHome"],"listing.order"));
			document.forms["formVideoUneHome"].style.display = "none";
			document.getElementById("videoUneHomeContainerBottom").style.display = "none"; 
			CW_Action_Site.displayShowcaseMedia(callback,CW_Action_Media.Media_TYPE_VIDEO,1,3,null);
		}
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "mediaListing_pager", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:[CW_Action_Media.ACTION_MEDIA_GROUP]</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:9, (nb video in this page)</li>
	 * 		<li>media.type:[this.CW_Action_Media_media_TYPE] </li>
	 * 		<li>user.uid:[CW_Action_Site.SITE_USER_ID]</li>
	 * 		<li>group.uid:[CW_Action_Site.MEDIA_OF_THE_DAY_GROUP_ID]</li>
	 * 		<li>group.type:2</li>
	 * 		<li>votd:1</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "media_Listing"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_Media.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action",CW_Action_Media.ACTION_MEDIA_GROUP);
		hashtableRequestParameters.put("user.uid",CW_Action_Site.SITE_USER_ID);
		hashtableRequestParameters.put("group.uid",CW_Action_Site.MEDIA_OF_THE_DAY_GROUP_ID);
		hashtableRequestParameters.put("group.type",2);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE);
		hashtableRequestParameters.put("votd",1);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_myscroon_media);
		hashtableRequestParameters.put("listing.page",page);
		return new ComwebPager("media_Listing","mediaListing_pager",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	}

}
//set the extends class
CW_AjaxPage_video_showcase_listing.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_video_showcase_listing.prototype);







/**
 * @class the following class allow to display the showcase video, this page contains a filter (CW_Filter),
 * a pager
 * <br/>short description:
 * <table border="1" width="100%" align="center" cellpadding="0" cellspacing="0" style="font-size: 10pt;text-align: center;">
 * 		<tr><th> name </th><th> statId</th><th>menuId</th><th>must be connected</th><th>preDisplay</th><th>default params</th><th>identifier</th></tr>
 *		<tr>
 *			<td>photo_showcase_listing</td>
 *			<td>photo</td>
 *			<td>1_1</td>
 *			<td>false</td>
 *			<td>true</td>
 *			<td>[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]</td>
 *		</tr>
 *</table>
 * the relative location.hash history is: #Media/Listing/_/[CW_FilterSinceHist]/[CW_FilterOrderHist]/Page=[1 ...]/lng=[CW_config.langId]
 * <br/>
 * this page set required preDisplay because given identifier is the member username but
 * to retrieve the video result we must obtain the user uid
 * @see CW_Filter#convertHistValueToSinceInt
 * @see CW_Filter#convertHistValueToOrderInt
 * @extends CW_AjaxPage_media_listing
 */
function CW_AjaxPage_photo_showcase_listing() {this.initialize();}
CW_AjaxPage_photo_showcase_listing.prototype = {
	/**
	 * The following function is invoke when the object is created and set the differents attribute
	 * <ul>
	 * 		<li>name: photo_showcase_listing</li>
	 * 		<li>statId: photo</li>
	 * 		<li>menuId: 1_1</li>
	 * 		<li>requiredPreDisplay: true</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_item_listing attribute
	 * <ul>
	 * 		<li>loadedHTMLPage: "html/media/mediaListing.html"</li>
	 * 		<li>filterType: CW_Filter.Filter_MEDIA</li>
	 * </ul>
	 *other attributes which overwrite specifical CW_AjaxPage_media_listing attribute
	 * <ul>
	 * 		<li>CW_Action_Media_media_TYPE: CW_Action_Media.Media_TYPE_IMAGE</li>
	 * </ul>
	 * and tmpVar, this is the attribute which allow to stores the user uid between  preDisplay and displayFunction
	 *@return {void}
	 */
	initialize: function(){
		this.name = "photo_showcase_listing";
		this.statId = "photo";
		this.menuId = "2_1";
		this.requiredPreDisplay = false;
		//specific itemListing
		this.loadedHTMLPage = "html/media/mediaListing.html";
		this.filterType = CW_Filter.Filter_MEDIA;
		//specfic param of media listing
		this.CW_Action_Media_media_TYPE = CW_Action_Media.Media_TYPE_IMAGE;

		this.tmpVar = null;

		this.classStyle = "pictures";
	},
	/**
	 * build the page pager, wich will be writed in the htmlDivelement identified by "mediaListing_pager", this
	 * pager will build the ajax request with the following parameters :
	 * <ul>
	 * 		<li>action:[CW_Action_Media.ACTION_MEDIA_GROUP]</li>
	 * 		<li>listing.page:[given page]</li>
	 * 		<li>listing.nbre.elements:9, (nb video in this page)</li>
	 * 		<li>media.type:[this.CW_Action_Media_media_TYPE] </li>
	 * 		<li>user.uid:[CW_Action_Site.SITE_USER_ID]</li>
	 * 		<li>group.uid:[CW_Action_Site.MEDIA_OF_THE_DAY_GROUP_ID]</li>
	 * 		<li>group.type:2</li>
	 * 		<li>votd:1</li>
	 * </ul>
	 * other parameters which are stores in HtmlFormElement chil of HtmlDivelement identified by "media_Listing"
	 * will be added, in our case listing.since and listing.order filter
	 * And the requested servlet is CW_Action_Media.SERVLET_URI
	 * @param {int} page current idex page (begin at 1)
	 * @param {String} params history parameters
	 * @param {String} identifier page identifier
	 * @return {ComwebPager} builded page pager
	 */
	getPager:function(page,params,identifier){
		var callback = "CW_AjaxPage_Manager.getPage('" + this.getPageName() + "').displayContent";
		var hashtableRequestParameters = new HashTable();
		hashtableRequestParameters.put("action",CW_Action_Media.ACTION_MEDIA_GROUP);
		hashtableRequestParameters.put("user.uid",CW_Action_Site.SITE_USER_ID);
		hashtableRequestParameters.put("group.uid",CW_Action_Site.MEDIA_OF_THE_DAY_GROUP_ID);
		hashtableRequestParameters.put("group.type",2);
		hashtableRequestParameters.put("media.type",this.CW_Action_Media_media_TYPE);
		hashtableRequestParameters.put("votd",1);
		hashtableRequestParameters.put("listing.nbre.elements",CacheManager.listingNb_myscroon_media);
		hashtableRequestParameters.put("listing.page",page);
		return new ComwebPager("media_Listing","mediaListing_pager",callback,CW_Action_Media.SERVLET_URI,hashtableRequestParameters)
	}

}
//set the extends class
CW_AjaxPage_photo_showcase_listing.prototype = Object.extend(new CW_AjaxPage_media_listing(),CW_AjaxPage_photo_showcase_listing.prototype);