// insertAdjacentHTML(), insertAdjacentText() and insertAdjacentElement()
// for Netscape 6/Mozilla by Thor Larholm thor@jscript.dk
// Usage: include this code segment at the beginning of your document
// before any other Javascript contents.

if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement){
	HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode){
		switch (where){
		case 'beforeBegin':
			this.parentNode.insertBefore(parsedNode,this)
			break;
		case 'afterBegin':
			this.insertBefore(parsedNode,this.firstChild);
			break;
		case 'beforeEnd':
			this.appendChild(parsedNode);
			break;
		case 'afterEnd':
			if (this.nextSibling) this.parentNode.insertBefore(parsedNode,this.nextSibling);
			else this.parentNode.appendChild(parsedNode);
			break;
		}
	}

	HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){
		var r = this.ownerDocument.createRange();
		r.setStartBefore(this);
		var parsedHTML = r.createContextualFragment(htmlStr);
		this.insertAdjacentElement(where,parsedHTML)
	}


	HTMLElement.prototype.insertAdjacentText = function(where,txtStr){
		var parsedText = document.createTextNode(txtStr)
		this.insertAdjacentElement(where,parsedText)
	}
}

function toggleDetails(id) {
	objsummary = document.getElementById('summary_' + id);
	objextended = document.getElementById('extended_' + id);
	if (objsummary && objextended) {
		if (objsummary.className.indexOf('summary_open') >= 0) {
			objextended.className = objextended.className.replace('extended_open','');
			objsummary.className = objsummary.className.replace('summary_open','summary');
		} else {
			objextended.className = objextended.className.replace('extended','extended extended_open');
			objsummary.className = objsummary.className.replace('summary','summary_open');
		}
	}
}

function onOver(obj) {
	obj.className+= ' mouseover';
}

function onOut(obj) {
	obj.className = obj.className.replace(' mouseover','');
}

function openDetails(id) {
	$.fn.nyroModal.settings.css.content.overflow='hidden';
	$.nyroModalManual({forceType: 'iframe', url: '/storing/detailstoring.php?iid='+id,width:800,height:800,minwidth:800,modal:true});
	setTimeout('$("#nyroModalIframe").height("100%");',500);
}

function closeDetails() {
	$.nyroModalRemove();
}

function doPost() {
	document.forms[0].submit();
}
