
IFrameElem = function() {
	
	this.parent;
	this.container;
	this.iframe;
	this.iframeSrc;
	this.iframeId;
	this.top;
	this.showActivity=true;
	this.resizeParent=true;
} // end object
	
	IFrameElem.prototype.makeIFrame = function() {
			
		var iframe = document.createElement("iframe");
		iframe.id=(this.iframeId)? this.iframeId : "ifmDynamic";
		iframe.scrolling = "no";
		iframe.border="0";
		iframe.frameBorder="0";
		iframe.style.width="100%";
		iframe.style.position="relative";
		iframe.allowTransparency=true;
		iframe.style.backgroundColor="transparent";
		if (this.top) { iframe.style.top = this.top+"px";} // end if
		me = this;
		try {			
			if (window.addEventListener) {		
				iframe.onload = function() { me.onFrameLoad(); }	
			} else {
				iframe.attachEvent('onload', function() { me.onFrameLoad();} );
			} // end if
			this.iframe = iframe;
		}
		catch (e) {
			alert(e.description);
		}
	
	} // end method 
	
	IFrameElem.prototype.onFrameLoad = function() {		
		if (this.showActivity) { window.parent.CDA.removeActivity(); } // end if		
		if (this.resizeParent){			
			if (typeof window.CDA.Page == "object" && typeof window.CDA.Page.resizeBody!='undefined'){ 			
				CDA.Page.resizeBody(); 
			} // end if
		} // end if
	} // end method 
	
	IFrameElem.prototype.show = function() {			
		if (this.showActivity==true) {	
			var loadDiv = CDA.createActivity();				
			this.parent.appendChild(loadDiv);
		} // end if
		
		this.makeIFrame();					
		this.parent.appendChild(this.iframe);				
		this.iframe.src = this.iframeSrc;		
		
	} // end method 

CaseStudy.prototype=new IFrameElem();
CaseStudy.prototype.constructor=CaseStudy;
function CaseStudy(projcode, cssClass, showIntro, country, searchQs) {

	this.projcode = (projcode) ? projcode : "";
	this.cssClass = (cssClass) ? cssClass : "";
	this.showIntro = (typeof showIntro=="boolean") ? showIntro : true;
	this.country = (country) ? country : "";
	this.searchQs = (searchQs) ? "&" + searchQs : "";
	var doSearch = (this.searchQs != "") ? "search" : "";
	//alert(searchQs);
	// build iframe src
	var intro = (this.showIntro==true)?1:"";
	this.iframeSrc = "nested_publication.php?type=casestudy&pid="+this.projcode+"&css="+this.cssClass+"&intro="+intro+"&countrygroup="+this.country+"&do="+doSearch+this.searchQs;

} // end object
	
Issue.prototype=new CaseStudy();
Issue.prototype.constructor=Issue;
function Issue(projcode, cssClass, showIntro) {

	this.superC = CaseStudy;
	this.superC(projcode, cssClass, showIntro);
	
	// build iframe src
	var intro = (this.showIntro==true)?1:"";
	this.iframeSrc = "nested_publication.php?type=issue&pid="+this.projcode+"&css="+this.cssClass+"&intro="+intro;
		
} // end object
	
Manual.prototype=new CaseStudy();
Manual.prototype.constructor=Manual;
function Manual(projcode, cssClass, showIntro) {

	this.superC = CaseStudy;
	this.superC(projcode, cssClass, showIntro);
	
	// build iframe src
	var intro = (this.showIntro==true)?1:"";
	this.iframeSrc = "nested_publication.php?type=manual&pid="+this.projcode+"&css="+this.cssClass+"&intro="+intro;
		
} // end object
	
Other.prototype=new CaseStudy();
Other.prototype.constructor=Other;
function Other(projcode, cssClass, showIntro, importantOnly) {

	this.superC = CaseStudy;
	this.superC(projcode, cssClass, showIntro);
	
	// build iframe src
	var intro = (this.showIntro==true)?1:"";
	this.iframeSrc = "nested_publication.php?pid="+this.projcode+"&css="+this.cssClass+"&intro="+intro;
	if (importantOnly == true) {
		this.iframeSrc += "&type=important";
	} else {
		this.iframeSrc += "&type=other";
	} // end if
} // end object

Book.prototype=new CaseStudy();
Book.prototype.constructor=Book;
function Book(projcode, cssClass, showIntro, bookKey) {

	this.superC = CaseStudy;
	this.superC(projcode, cssClass, showIntro);
	
	// build iframe src
	var intro = (this.showIntro==true)?1:"";
	var keyQs = (bookKey) ?  bookKey : "" ;
	this.iframeSrc = "nested_book.php?type=book&pid="+this.projcode+"&css="+this.cssClass+"&intro="+intro+"&key="+keyQs;
		
} // end object

Article.prototype=new CaseStudy();
Article.prototype.constructor=Article;
function Article(projcode, cssClass, showIntro) {

	this.superC = CaseStudy;
	this.superC(projcode, cssClass, showIntro);
	
	// build iframe src
	var intro = (this.showIntro==true)?1:"";
	this.iframeSrc = "nested_publication.php?type=article&pid="+this.projcode+"&css="+this.cssClass+"&intro="+intro;
		
} // end object

Map.prototype=new CaseStudy();
Map.prototype.constructor=Map;
function Map(projcode, showAll) {

	this.superC = CaseStudy;
	this.superC(projcode, null, null);
	
	var typeToDisplay = (showAll==true) ? "all" : "workshop";
	// build iframe src
	this.iframeSrc = "nested_map.php?type="+typeToDisplay+"&pid="+this.projcode;
		
} // end object

Event.prototype=new CaseStudy();
Event.prototype.constructor=Event;
function Event(projcode, showType, showIntro, expiredOnly, country, isHomePage) {

	this.superC = CaseStudy;
	this.superC(projcode, null, showIntro, country);
	this.isHomePage = isHomePage;
	this.expired = (expiredOnly==true) ? "1" : "";
	//var typeToDisplay = (showAll==true) ? "all" : "workshop";
	// build iframe src
	this.iframeSrc = "nested_event.php?type="+showType+"&pid="+this.projcode+"&expired="+this.expired+"&country="+this.country+"&ishome="+this.isHomePage;
	//alert(this.iframeSrc)
} // end object

TrainerList.prototype=new IFrameElem();
TrainerList.prototype.constructor=TrainerList;
function TrainerList(qs) {	
	this.iframeSrc = "nested_trainer.php?"+qs;	
} // end object

Affiliate.prototype=new CaseStudy();
Affiliate.prototype.constructor=Affiliate;
function Affiliate(projcode, cssClass, showBoard, showStaff) {

	this.superC = CaseStudy;
	this.superC(projcode, cssClass, null);
	this.showBoard = (showBoard==true) ? "1" : "";
	this.showStaff = (showStaff==true) ? "1" : "";
	
	// build iframe src
	this.iframeSrc = "nested_affiliate.php?pid="+this.projcode+"&css="+this.cssClass+"&board="+this.showBoard+"&staff="+this.showStaff;
		
} // end object
	