// All browser elements
// 15/1-2006 
// Copyright - D/SITE ApS

var browser = new dudiBrowser();

function OpenVideos() {
 window.open('http://www.copenhagenfashionweek.tv/videos.cfm','VidWin','width=580,height=550,scrollbars=no,resizable=no,location=no,menubar=no,status=no,toolbar=no');
}


function dudiBrowser() {
	var agt=navigator.userAgent.toLowerCase();

	// is DOM
	this.DOM = document.getElementById?1:0;

	// is IE
	this.IE = document.all?1:0;

	// is IE
	this.IE5 = this.IE?(document.hasFocus?0:1):0;

	// is NS
	this.NS = (!this.DOM && !this.IE)?1:0

	// is on mac
	this.MAC = (agt.indexOf("mac")!=-1);
	
	// is on mac safari
	this.SAFARI = (agt.indexOf("safari")!=-1);
	
	// is on win 98
    this.WIN9X = (agt.indexOf("windows 9")!=-1);

}

function element(id) {
	this.id = id;
	this.obj = browser.NS?document.layers[id]:browser.DOM?document.getElementById(id):document.all[id];
	if(this.obj) {
		this.elm = browser.NS?eval("document."+id):document;
		this.css = browser.NS?eval("document."+id):(browser.DOM || browser.IE)?this.obj.style:"NaN";
		this.w = browser.NS?this.css.clip.width:browser.DOM?this.obj.offsetWidth:browser.IE?this.css.pixelWidth:"NaN";
		this.h = browser.NS?this.css.clip.height:browser.DOM?this.obj.offsetHeight:browser.IE?this.css.pixelHeight:"NaN";
		this.setH = function (height) {this.css.height = height}
		this.setW = function (width) {this.css.width = width}
		this.getH = function () {return browser.NS?this.css.clip.height:browser.DOM?this.obj.offsetHeight:browser.IE?this.css.pixelHeight:"NaN";}
		this.getW = function () {return browser.NS?this.css.clip.width:browser.DOM?this.obj.offsetWidth:browser.IE?this.css.pixelWidth:"NaN";}
		this.show = function () {this.css.display = "block";}
		this.hide = function () {this.css.display = "none";}
		this.setPT = function (height) {this.css.paddingTop = height;}
		this.setMT = function (height) {this.css.marginTop = height;}
		this.setPB = function (height) {this.css.paddingBottom = height;}
		this.setMB = function (height) {this.css.marginBottom = height;}
		this.getMT = function () { 
			tempMT = parseInt(this.css.marginTop);
			return (isNaN(tempMT))?0:tempMT;
		}
		this.getPT = function () { 
			tempPT = parseInt(this.css.paddingTop);
			return (isNaN(tempPT))?0:tempPT;
		}
		this.getMB = function () { 
			tempMB = parseInt(this.css.marginBottom);
			return (isNaN(tempMB))?0:tempMB;
		}
		this.getPB = function () { 
			tempPB = parseInt(this.css.paddingBottom);
			return (isNaN(tempPB))?0:tempPB;
		}
		
		if(this.obj.tagName == "IFRAME") {
			this.setOnload = function (func) {
				if(this.obj.addEventListener) {
				
					this.obj.addEventListener("load", func, false);
				} else if(this.obj.attachEvent) {
				
					this.obj.detachEvent("onload", func); // Bug fix line
					this.obj.attachEvent("onload", func);
				}
			}	
		}
	}
	
	return this;
}

// functions for showing or hiding caseInfo
function showCaseInfo() {
	
	var objCaseInfo = new element('caseInfo');
	
	objCaseInfo.show();
}

function hideCaseInfo() {
	
	var objCaseInfo = new element('caseInfo');
	
	objCaseInfo.hide();
}


