
var proc_links = ["measurements", "fabrics", "styling", "accessories"];

var _htmlChunk = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="{width}" height="25" id="title" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="FlashVars" value="title={title}"><param name="movie" value="title.swf" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="l" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="title.swf" quality="high" scale="noscale" FlashVars="title={title}" wmode="transparent" bgcolor="#ffffff" width="{width}" height="25" name="title" align="middle" salign="l" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

function initTitles() {

	var arr = document.getElementsByTagName("h2");
	for (var i = 0; i < arr.length; i++) {
		if (arr[i].className == "flashtitle") {
			var name = arr[i].innerHTML;
			var width = getWidth(arr[i]);
			arr[i].innerHTML = _htmlChunk.replace(/{title}/g, name).replace(/{width}/g, width);
		}
	}

}

function positionJunkie() {
	var junkie = D("junkie");
	var bottom = D("bottom");
	if (!junkie || !bottom) return;

	var obj = getXY(bottom);

	junkie.style.top = (obj.y - 357) + "px";
	junkie.style.left = (obj.x + 898 - 280) + "px"; 

	junkie.style.display = "block";
	

}

function getWidth(obj) {
	var def = 300;
	var attr = obj.attributes;
	if (!attr) return def;
	for (var i = 0 ; i < attr.length; i++) {
		if (attr[i].name == "fwidth") return attr[i].value;
	}
	return def;
}

function D(n) { return document.getElementById(n); }

function swap(m, src) {
	if (!D(m)) return;
	D(m).src = src;
}

function getXY(obj) {
	var tmp = obj;
	var X = 0;
	var Y = 0;
	do {
		X += tmp.offsetLeft;
		Y += tmp.offsetTop;
		tmp = tmp.offsetParent;
	} while(tmp);

	return {x:X, y:Y};	
}


/* other scripts here */

function showlogindiv() {
	var obj = D("logindiv");
	var img = D("loginimg");
	var xy = getXY(img);
	var X = xy.x - 264 + img.offsetWidth - 10;
	var Y = xy.y + img.offsetHeight - 8;
	obj.style.left = X + "px";
	obj.style.top = Y + "px";
	if (obj.style.display == "block") {
		obj.style.display = "none"; 
	} else {
		obj.style.display = "block";
	}

}


function showPopup(html) {

}



function quicklook() { 
	var d = D("quicklookopen");
	var t = d.style.display;
	d.style.display = t == "block" ? "none" : "block";  

}
function quickclose() { D("quicklookopen").style.display = "none"; }


