var PHCMS_ShadowBox = {

	//manual option
	option 	: {
		option : { modal:true, animate:false, displayNav: true} , 
		settings : { player:'img', title:'Not Found', content: '', height:screen.availHeight, width:screen.availWidth} 
	},
	
	SetOptions : function(arg) {
	
		if(arg.length == 0) {
			return false;
		} else {
			for(var x in arg) {
				if(typeof(this.option['settings'][x]) != 'undefined') {
					this.option['settings'][x] = arg[x];
				}
			}
		}
	},
	
	Init: function(arg) {
	
		this.SetOptions(arg);
		this.Open();	
	
	},

	Open : function() {
		
		Shadowbox.open(this.option['settings'], this.option['option']);
		
	},
	
	Close: function() {
		
		Shadowbox.close();
		
	}
	
}

function SBOpen(stitle, url, h, w) {

	if(h == '') h = (screen.availHeight-100);
	if(w == '') w = (screen.availWidth-100);

	//alert(PHCMS_ShadowBox.option['option'].animate);
	PHCMS_ShadowBox.Init({
		player:'iframe', 
		title:stitle,
		content:url,
		height:h +"px",
		width:w +"px"
	});

}

function SBClose(){
	PHCMS_ShadowBox.Close();	
}

