var DyBoxObject = Class.create();
DyBoxObject.prototype = {
	initialize: function(options){
		this.options = Object.extend({
			compulsory : {
				linkType: "",  //Options - text or image
				name: "",
				originalLinkID : "",
				mediaType : "",  //Options - text or video
				itemClass : ""
			},
			containerStyle : {
				backgroundColour : "#000000"
			},
			videoDetails : {
				videoLocation : "",
				videoType : ""
			},
			videoPlayerConfig : {
				bufferTime : 5,
				uiEnabled : true,
				allowscriptaccess : "always",
				allowFullScreen : true,
				uiBarColour : "#666666",
				uiBarBufferColor : "#333333",
				skipTime : 2
			},
			image : {
				imageArray_SRCS : "",
				imageArray_ALTS : "",
				maxImageSize_Height : "",
				maxImageSize_Width : ""
			},
			textDetails : {
				copyTextCategory : ""
			},
			imageLink : {
				imageSRC : "",
				imageALT : "",
				linkText : "",
				rolloverAvailable : "", //Options - true or false
				textPos :"top" //Options - top or bottom
			},
			textLink : {
				linkText : "",
				linkTitle : ""
			},
			buttonLink : {
				imageSRC : "",
				imageALT : ""
			},
			formButton : {
				buttonType : ""	,
				buttonClass : "",
				buttonName : "",
				buttonValue : ""
			},
			linkObject : {
				linkObject : ""	
			},
			product : {
				productID : "",
				productType : ""
			},
			containerDimensions : {
				height : 0,  //Value in pixels
				width : 0    //Value in pixels
			}
		}, options || {});
	},
	createLink: function(){		
		selectLinkType(this);
	}
};

function selectContentViewingType(linkObject){
	switch(linkObject.contentType.toLowerCase()){
		case "text":
			loadTextContent(linkObject);
			break;
		case "video":
			loadFlashPlayerVideo(linkObject);
			break;
	}
}

function getRelevantContent(dyBoxObject, contentContainer){
	if(dyBoxObject.dyboxObject.options.compulsory.mediaType.toLowerCase() == "video"){																	
		if(dyBoxObject.dyboxObject.options.videoDetails.videoLocation != "" && contentContainer != 'undefined'){
			noFlashMessage();
			if(dyBoxObject.dyboxObject.options.videoDetails.videoType.toLowerCase() == "youtube"){
				unloadContent("lightbox_Container");
				$("lightbox_Container").appendChild(contentContainer);
			}else{
				$("lightbox_Container").style.display = "none";
				contentContainer.write("lightbox_Container");
			}
			//contentContainer.write("lightbox_Container");
		} 
	}
	if(dyBoxObject.dyboxObject.options.compulsory.mediaType.toLowerCase() == "text"){
		createTextBox(dyBoxObject);
	}
}

function setContainerPropertiesDependingOnContentType(dyBoxObject, contentContainer){
	if(dyBoxObject.dyboxObject.options.compulsory.mediaType.toLowerCase() == "text"){
		contentContainer.style.width = dyBoxObject.dyboxObject.options.containerDimensions.width + "px";
		contentContainer.style.height = dyBoxObject.dyboxObject.options.containerDimensions.height + "px";
		contentContainer.style.overflow = "auto";
		contentContainer.style.overflowX = "hidden";
	}else if(dyBoxObject.dyboxObject.options.compulsory.mediaType.toLowerCase() == "image"){
		contentContainer.style.width = dyBoxObject.dyboxObject.options.image.maxImageSize_Width + "px";
		contentContainer.style.height = dyBoxObject.dyboxObject.options.image.maxImageSize_Height + "px";
		contentContainer.style.overflowY = "auto";
	}else if(dyBoxObject.dyboxObject.options.compulsory.mediaType.toLowerCase() == "video"){
		contentContainer.style.width = dyBoxObject.dyboxObject.options.containerDimensions.width + "px";
		if(dyBoxObject.dyboxObject.options.videoPlayerConfig.uiEnabled == true){
			contentContainer.style.height = dyBoxObject.dyboxObject.options.containerDimensions.height + 26 + "px";
		}else{
			contentContainer.style.height = dyBoxObject.dyboxObject.options.containerDimensions.height + "px";
		}
	}
}