/**
 * ___freeforms___
 *  
 * @author ciskavriezenga
 */



if(IT == undefined){
	var IT = new function(){};	
}







/*
 * THis CODE IS NOT CLEAN YET - FROM THE MVC PATTERN VIEW
 */

/*================================================================================ */
/*________________________________ IT CLASS _______________________________ */
/*================================================================================ */

/*
 * @constructor Intouch constructor of Intouch
 */
IT.IntouchPage = function(){
	IT.Log.stream("IntouchPage: inside IntouchPage constructor");
	//get intouch page links
	this.links =  IT.intouchPageLinks;
	this.contents = IT.intouchPageContents;
	IT.Log.stream("IntouchPage: creating pageFramework");
	//create page-framework for intouch page
	this.pageFramework = 	new EJS(
								{url: '/dl/template_res/pages/intouch/_intouch_frame.ejs'}
							).render({
								intouchLinks: this.links, 
								//intouchContents: this.contents,
							});
	//get container from out freeform widget to place framework in
	this.container = $(".intouchContainer");
	//remove probably Clearvale bug!!-content from intouchContainer 
	this.container.empty();
	//append page framework to intouch page container 
	this.container.append(this.pageFramework);
	IT.Log.debug("got container, emptied and appended framework to it");
	//still hard coded -> named in templated instead of in here CHANGE!! 
	IT.connectLinksToContent(".intouchPLeft", this.contents);
	IT.connectSubLinks($(".intouchPLeft"));
	//show first link
	var topLink = $(".mainLink.link0");
	IT.changeContent(topLink, this.contents);
	IT.addIntouchButton(".intouchPLeft");
}
	
	





/*================================================================================ */
/*________________________________ SOLUTIONS CLASS _______________________________ */
/*================================================================================ */

/*
 * @constructor Solutions constructor of Solutions
 */
IT.SolutionsPage = function(){
	IT.Log.stream("SolutionsPage: inside SolutionsPage constructor");
	//get solutions page links
	this.links =  IT.solutionsPageLinks;
	IT.Log.debug("solution links: " + this.links);
	this.contents = IT.solutionsPageContents;
	
	IT.Log.stream("SolutionsPage: creating pageFramework");
	//create page-framework for intouch page
	this.pageFramework = 	new EJS(
								{url: '/dl/template_res/pages/solutions/_solutions_frame.ejs'}
							).render({
								solutionsLinks: this.links, 
								//solutionContents: this.contents,
							});
	IT.Log.debug("loaded page framework: " + this.pageFramework);
	
	//get container from out freeform widget to place framework in
	this.container = $(".solutionsContainer");
	//remove probably Clearvale bug!!-content from solutionContainer 
	this.container.empty();
	//append page framework to intouch page container 
	this.container.append(this.pageFramework);
	IT.Log.debug("SolutionsPage: got container, emptied and appended framework to it");
	//still hard coded -> named in templated instead of in here CHANGE!! 
	IT.connectLinksToContent(".solutionsPLeft", this.contents);
	IT.connectSubLinks($(".solutionsPLeft"));
	//show first link
	var topLink = $(".mainLink.link0");
	IT.changeContent(topLink, this.contents);
	IT.addIntouchButton(".solutionsPLeft");
	
}





