var _JS = {

	getHeight: function(elmID) {
		var H = null;
		if(document.getElementById(elmID)){
			if(document.getElementById(elmID).clientHeight) {
				H = document.getElementById(elmID).clientHeight;
			}else if(document.getElementById(elmID).offsetHeight){
				H = document.getElementById(elmID).offsetHeight;
			}
		}
		return H;
	},
	
	getWidth: function(id) {
		var W = null;
		if(document.getElementById(id)){
			if(document.getElementById(id).clientWidth) {
				W = document.getElementById(id).clientWidth;
			}else if(document.getElementById(id).offsetWidth){
				W = document.getElementById(id).offsetWidth;
			}
		}
		return W;
	},
	
	browserIsIE: function(){
		var agt=navigator.userAgent.toLowerCase();
		if (agt.indexOf("msie") != -1){return true;}
		return false;
	},
	
	// marginTop
	// marginLeft
	set_Style: function(obj, s, sie, value){
		if(document.getElementById(obj)){
			if(document.getElementById(obj).setAttribute){
				var att = document.getElementById(obj).style;
				if(typeof(att) == 'object'){
					document.getElementById(obj).style[sie] = value;
				}else{
					var REG = new RegExp(s+':\s?(.*)(;|")');
					att = att.replace(REG,"");
					alert(att);
					document.getElementById(obj).setAttribute("style",s+":"+value+";"+att);
				}
			}
		}
	},
	
	set_Fruits: function(){
		var id = 'fruits';
		var H = this.getHeight(id) - 55;
		var MT = this.getHeight('content-holder-table') - H;
		var W = this.getWidth(id) - 68;
		var ML = 898 - W;
		this.set_Style(id,'margin-top','marginTop',MT+"px");
		this.set_Style(id,'margin-left','marginLeft',ML+"px");
		this.set_Style(id,'display','display',"inline-block");
	},
	
	set_Traiteur: function(){
		var id = 'traiteur';
		var H = this.getHeight(id) - 55;
		var MT = this.getHeight('content-holder-table') - H;
		var W = this.getWidth(id) - 68;
		var ML = 898 - W;
		this.set_Style(id,'margin-top','marginTop',MT+"px");
		this.set_Style(id,'margin-left','marginLeft',ML+"px");
		this.set_Style(id,'display','display',"inline-block");
	}

}

function popup(){
	var c = '<div class="popup" onclick="Shadowbox.close();"></div>';
	Shadowbox.open({
				content: 	c,
				player:		'html',
				width:		395,
				height:		290,
				displayNav: false
	});
}

window.onload = onloadEvent;
function onloadEvent(){
	_JS.set_Fruits();
	_JS.set_Traiteur();
}