/*
$Id: common.js,v 1.42.2.3 2009/08/28 07:18:58 aim Exp $
vim: set ts=2 sw=2 sts=2 et:
*/
/*
	Enviroment identificator
*/
var localIsDOM = document.getElementById?true:false;
var localIsJava = navigator.javaEnabled();
var localIsStrict = document.compatMode=='CSS1Compat';
var localPlatform = navigator.platform;
var localVersion = "0";
var localBrowser = "";
var localBFamily = "";
var isHttps = false;
if (window.opera && localIsDOM) {
	localBFamily = localBrowser = "Opera";
	if (navigator.userAgent.search(/^.*Opera.([\d.]+).*$/) != -1)
		localVersion = navigator.userAgent.replace(/^.*Opera.([\d.]+).*$/, "$1");
	else if (window.print)
		localVersion = "6";
	else
		localVersion = "5";
} else if (document.all && document.all.item)
	localBFamily = localBrowser = 'MSIE';
if (navigator.appName=="Netscape") {
	localBFamily = "NC";
  if (!localIsDOM) {
 		localBrowser = 'Netscape';
  	localVersion = navigator.userAgent.replace(/^.*Mozilla.([\d.]+).*$/, "$1");
 		if (localVersion != '')
 			localVersion = "4";
  }
  else if (navigator.userAgent.indexOf("Chrome") >= 0)
    localBrowser = 'Chrome';
  else if (navigator.userAgent.indexOf("Safari") >= 0)
  	localBrowser = 'Safari';
 	else if (navigator.userAgent.indexOf("Netscape") >= 0)
  	localBrowser = 'Netscape';
 	else if (navigator.userAgent.indexOf("Firefox") >= 0)
  	localBrowser = 'Firefox';
 	else 
  	localBrowser = 'Mozilla';
	
}
if (navigator.userAgent.indexOf("MSMSGS") >= 0)
	localBrowser = "WMessenger";
else if (navigator.userAgent.indexOf("e2dk") >= 0)
  localBrowser = "Edonkey";
else if (navigator.userAgent.indexOf("Gnutella") + navigator.userAgent.indexOf("Gnucleus") >= 0)
  localBrowser = "Gnutella";
else if (navigator.userAgent.indexOf("KazaaClient") >= 0)
  localBrowser = "Kazaa";
if (localVersion == '0' && localBrowser != '') {
  var rg = new RegExp("^.*" + localBrowser + ".([\\d.]+).*$");
  localVersion = navigator.userAgent.replace(rg, "$1");
}
var localIsCookie = ((localBrowser == 'Netscape' && localVersion == '4')?(document.cookie != ''):navigator.cookieEnabled);
var isHttps = document.location.protocol == "https:";
function change_antibot_image(id) {
	var image = document.getElementById(id);
	if (image) {
		var src = xcart_web_dir + "/antibot_image.php?tmp=" + Math.random() + "&section=" + id + "&regenerate=Y";
		setTimeout(
      function() {
        image.src = src;
      },
			200
		);
	}
}
/*
 get real inner width (jsel- JQuery selector)
*/
function getRealWidth(jsel) {
  var sw = $(jsel).attr('scrollWidth');
  var pl = parseInt($(jsel).css('padding-left'));
  if (!isNaN(pl))
    sw -= pl;
  var pr = parseInt($(jsel).css('padding-right'));
  if (!isNaN(pr))
    sw -= pr;
  return sw;
}
/*
  Show note next to element
*/
function showNote(id, next_to) {
  var div = $('#'+id).get();
  $('#'+id).remove();
  $('body').append(div);
  $('#'+id).show();
  var sw = getRealWidth('#'+id);
  $('#'+id).css('left', $(next_to).offset().left + $(next_to).width() + 'px');
  $('#'+id).css('top', $(next_to).offset().top + 'px');
  $('#'+id).css('width', sw + 'px');
  $('#'+id).show();
}
/*
	Find element by classname
*/
function getElementsByClassName(clsName) {
  var elem, cls;
	var arr = []; 
	var elems = document.getElementsByTagName("*");
	
	for (var i = 0; (elem = elems[i]); i++) {
		if (elem.className == clsName)
			arr[arr.length] = elem;
	}
	return arr;
}
/*
  Opener/Closer HTML block
*/
function visibleBox(id,skipOpenClose) {
	elm1 = document.getElementById("open" + id);
	elm2 = document.getElementById("close" + id);
	elm3 = document.getElementById("box" + id);
	if(!elm3)
		return false;
	if (skipOpenClose) {
		elm3.style.display = (elm3.style.display == "") ? "none" : "";
	} else if(elm1) {
		if (elm1.style.display == "") {
			elm1.style.display = "none";
			if (elm2)
				elm2.style.display = "";
			elm3.style.display = "none";
			var class_objs = getElementsByClassName('DialogBox');
			for (var i = 0; i < class_objs.length; i++) {
				class_objs[i].style.height = "1%";
			}
		} else {
			elm1.style.display = "";
			if (elm2)
				elm2.style.display = "none";
			elm3.style.display = "";
		}
	}
  return true;
}
function switchVisibleBox(id) {
	var box = document.getElementById(id);
	var plus = document.getElementById(id + '_plus');
	var minus = document.getElementById(id + '_minus');
	if (!box || !plus || !minus)
		return false;
	if (box.style.display == 'none') {
		box.style.display = '';
		plus.style.display = 'none';
		minus.style.display = '';
	} else {
        box.style.display = 'none';
        minus.style.display = 'none';
		plus.style.display = '';
	}
	return true;
}
/*
	URL encode
*/
function urlEncode(url) {
	return url.replace(/\s/g, "+").replace(/&/, "&amp;").replace(/"/, "&quot;")
}
/*
	Math.round() wrapper
*/
function round(n, p) {
	if (isNaN(n))
		n = parseFloat(n);
	if (!p || isNaN(p))
		return Math.round(n);
	p = Math.pow(10, p);
	return Math.round(n*p)/p;
}
/*
	Price format
*/
function price_format(price, thousand_delim, decimal_delim, precision, currency) {
	thousand_delim = (arguments.length > 1 && thousand_delim !== false) ? thousand_delim : number_format_th;
	decimal_delim = (arguments.length > 2 && decimal_delim !== false) ? decimal_delim : number_format_dec;
	precision = (arguments.length > 3 && precision !== false) ? precision : number_format_point;
  currency = (arguments.length > 4 && currency !== false) ? currency_format : "x";
	if (precision > 0) {
		precision = Math.pow(10, precision);
		price = Math.round(price*precision)/precision;
		var top = Math.floor(price);
		var bottom = Math.round((price-top)*precision)+precision;
	} else {
		var top = Math.round(price);
		var bottom = 0;
	}
	top = top+"";
	bottom = bottom+"";
	var cnt = 0;
	for (var x = top.length; x >= 0; x--) {
		if (cnt % 3 == 0 && cnt > 0 && x > 0)
			top = top.substr(0, x)+thousand_delim+top.substr(x, top.length);
		cnt++;
	}
  sum = (bottom > 0) ? (top+decimal_delim+bottom.substr(1, bottom.length)) : top;
	return currency.replace("x", sum);
}
/*
	Substitute
*/
function substitute(lbl) {
	var rg;
	for (var x = 1; x < arguments.length; x+=2) {
		if (arguments[x] && arguments[x+1]) {
			lbl = lbl
				.replace(new RegExp("\\{\\{" + arguments[x] + "\\}\\}", "gi"),  arguments[x+1])
				.replace(new RegExp('~~' + arguments[x] + '~~', "gi"),  arguments[x+1]);
		}
	}
	return lbl;
}
function getWindowOutWidth(w) {
	if (!w)
		w = window;
	return localBFamily == "MSIE" ? w.document.body.clientWidth : w.outerWidth;
}
function getWindowOutHeight(w) {
	if (!w)
		w = window;
	return localBFamily == "MSIE" ? w.document.body.clientHeight : w.outerHeight;
}
function getWindowWidth(w) {
	if (!w)
		w = window;
  return localBFamily == "MSIE" ? w.document.body.clientWidth : w.innerWidth;
}
function getWindowHeight(w) {
	if (!w)
		w = window;
  return localBFamily == "MSIE" ? w.document.body.clientHeight : w.innerHeight;
}
function getDocumentHeight(w){
	if (!w)
		 w = window;
  return Math.max(w.document.documentElement.scrollHeight, w.document.body.scrollHeight);
}
function getDocumentWidth(w) {
	if (!w)
		w = window;
  return Math.max(w.document.documentElement.scrollWidth, w.document.body.scrollWidth);
}
function expandWindowX(w, step, limit) {
	if (!w)
		w = window;
	if (!step)
		step = 10;
	var go = true;
	var i = 200;
	while (go && i--) {
		if (limit && getWindowOutWidth() + step > limit)
			break;
		try {
			w.scrollTo(step, 0);
			go = (w.document.documentElement && w.document.documentElement.scrollLeft > 0) || (w.document.body && w.document.body.scrollLeft > 0);
			if (go)
				w.resizeBy(step, 0);
		} catch (e) {
			return false;
		}
	}
	return true;
}
function expandWindowY(w, step, limit) {
	if (!w)
		w = window;
	if (!step)
		step = 10;
	var go = true;
	var i = 200;
	while (go && i--) {
		if (limit && getWindowOutHeight() + step > limit)
			 break;
		try {
			w.scrollTo(0, step);
			go = (w.document.documentElement && w.document.documentElement.scrollTop > 0) || (w.document.body && w.document.body.scrollTop > 0);
			if (go)
				w.resizeBy(0, step);
		} catch(e) {
			return false;
		}
	}
	return true;
}
/*
	Check list of checkboxes
*/
function checkMarks(form, reg, lbl) {
	var is_exist = false;
	if (!form || form.elements.length == 0)
		return true;
	for (var x = 0; x < form.elements.length; x++) {
		if (form.elements[x].name.search(reg) == 0 && form.elements[x].type == 'checkbox' && !form.elements[x].disabled) {
			is_exist = true;
			if (form.elements[x].checked)
				return true;
		}
	}
	if (!is_exist)
		return true;
	if (lbl) {
		alert(lbl);
	} else if (lbl_no_items_have_been_selected) {
		alert(lbl_no_items_have_been_selected);
	}
	return false;
}
/*
	Submit form with specified value of 'mode' parmaeters
*/
function submitForm(formObj, formMode, e) {
  if (!e && typeof(window.event) != 'undefined')
    e = event;
  if (e) {
    if (e.stopPropagation)
      e.stopPropagation();
    else
      e.cancelBubble = true;
  }
	if (!formObj)
		return false;
	if (formObj.tagName != "FORM") {
		if (!formObj.form)
			return false;
		formObj = formObj.form;
	}
  if (typeof(window.$) != 'undefined') {
    var r = $(formObj).triggerHandler('submit');
    if (r === false)
      return false;
  }
	if (formObj.mode)
		formObj.mode.value = formMode;
	return formObj.submit();
}
/*
	Convert number from current format
	(according to 'Input and display format for floating comma numbers' option)
	to float number
*/
function convert_number(num) {
	var regDec = new RegExp(reg_quote(number_format_dec), "gi");
	var regTh = new RegExp(reg_quote(number_format_th), "gi");
	var pow = Math.pow(10, parseInt(number_format_point));
	num = parseFloat(num.replace(" ", "").replace(regTh, "").replace(regDec, "."));
	return Math.round(num * pow) / pow;
}
/*
	Check string as number
	(according to 'Input and display format for floating comma numbers' option)
*/
function check_is_number(num) {
	var regDec = new RegExp(reg_quote(number_format_dec), "gi");
	var regTh = new RegExp(reg_quote(number_format_th), "gi");
	num = num.replace(" ", "").replace(regTh, "").replace(regDec, ".");
	return (num.search(/^[+-]?[0-9]+(\.[0-9]+)?$/) != -1);
}
/*
	Qutation for RegExp class
*/
function reg_quote(s) {
	return s.replace(/\./g, "\\.").replace(/\//g, "\\/").replace(/\*/g, "\\*").replace(/\+/g, "\\+").replace(/\[/g, "\\[").replace(/\]/g, "\\]");
}
function setCookie(name, value, path, expires) {
	if (typeof(expires) == 'object') {
		try {
			var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
			var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
			if (days[expires.getDay()] && months[expires.getMonth()])
				expires = days[expires.getDay()]+" "+expires.getDate()+"-"+months[expires.getMonth()]+"-"+expires.getFullYear()+" "+expires.getHours()+":"+expires.getMinutes()+":"+expires.getSeconds()+" GMT";
		} catch(e) { }
	}
	if (typeof(expires) != 'string')
		expires = false;
	document.cookie = name+"="+escape(value)+(expires ? "; expires=" + expires : "")+(path ? "; path="+path : "");
}
function getCookie(name) {
  if (document.cookie.length > 0) {
    start = document.cookie.indexOf(name + "=");
    if (start != -1) {
      start = start + name.length + 1;
      end = document.cookie.indexOf(";", start);
      if (end == -1) 
        end = document.cookie.length;
      
      return unescape(document.cookie.substring(start,end));
    }
  }
  return false;
}
function deleteCookie(name) {
	document.cookie = name+"=0; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}
/*
	Clone object
*/
function cloneObject(orig) {
	var r = {};
	for (var i in orig) {
		r[i] = orig[i];
	}
	return r;
}
/*
	Get first checkbox and redirect to URL
*/
function getFirstCB(form, reg) {
	while (form.tagName && form.tagName.toUpperCase() != 'FORM')
		form = form.parentNode;
	if (!form.tagName || form.tagName.toUpperCase() != 'FORM' || form.elements.length == 0)
    return false;
	var selectedChk = false;
    for (var x = 0; x < form.elements.length && !selectedChk; x++) {
      if (form.elements[x].name.search(reg) == 0 && form.elements[x].type == 'checkbox' && !form.elements[x].disabled && form.elements[x].checked)
        selectedChk = form.elements[x];
    }
    
    if (!selectedChk) {
      if (lbl_no_items_have_been_selected)
			  alert(lbl_no_items_have_been_selected);
      return false;
	}
  return selectedChk;
}
/*
	getElementById() wrapper
*/
function _getById(id) {
	if (typeof(id) != 'string' || !id)
		return false;
	var obj = document.getElementById(id);
	if (obj && obj.id != id) {
		obj = false;
		for (var i = 0; i < document.all.length && obj === false; i++) {
			if (document.all[i].id == id)
				obj = document.all[i];
		}
	}
	return obj;
}
// undefined or not
function isset(obj) {
	return typeof(obj) != 'undefined' && obj !== null;
}
// Check - variable is function or not
function isFunction(f) {
	return (typeof(f) == 'function' || (typeof(f) == 'object' && (f+"").search(/\s*function /) === 0));
}
// Get text length without \r
function getPureLength(text) {
    return (text && text.replace) ? text.replace(new RegExp("\r", "g"), '').length : -1;
}
// Ge text area selection limits
function getTASelection(t) {
	if (document.selection) {
		t.focus();
		var sel1 = document.selection.createRange();
		var sel2 = sel1.duplicate();
		sel2.moveToElementText(t);
		var selText = sel1.text;
		var c = String.fromCharCode(1);
		sel1.text = c;
		var index = sel2.text.indexOf(c);
		t.selectionStart = getPureLength((index == -1) ? sel2.text : sel2.text.substring(0, index));
		t.selectionEnd = getPureLength(selText) + t.selectionStart;
		sel1.moveStart('character', -1);
		sel1.text = selText;
    }
	return [t.selectionStart, t.selectionEnd];
}
// Insert string to text area to current position
function insert2TA(t, str) {
	var pos = getTASelection(t);
	var p;
    if (!isNaN(pos[0])) {
        t.value = t.value.substr(0, pos[0]) + str + t.value.substr(pos[0]);
		p = pos[0];
    } else {
		p = getPureLength(t.value);
		t.value += str;
	}
	setTACursorPos(t, p);
	return p;
}
// Set cursor pointer to specified postion for text area 
function setTACursorPos(t, begin, end) {
	if (!t || !t.tagName || t.tagName.toUpperCase() != 'TEXTAREA')
		return false;
	if (isNaN(begin)) {
		begin = 0;
	} else if (getPureLength(t.value) < begin) {
		begin = getPureLength(t.value);
		end = begin;
	}
	if (isNaN(end))
		end = begin;
	if (document.selection) {
		var sel = t.createTextRange();
		sel.collapse(true);
		sel.moveStart('character', begin);
		sel.moveEnd('character', end - begin);
		sel.select();
	} else if (!isNaN(t.selectionStart)) {
		t.selectionStart = begin;
		t.selectionEnd = end;
	}
	if (t.focus)
	    t.focus();
	return true;
}
// View help layer
function viewHelp(id, a, ttl, boxWidth) {
	var box = document.getElementById(id);
	if (!box || !a)
		return false;
	if (!a.helpBox) {
		// initialization
		a.helpBox = box;
		box.helpLink = a;
		box.onmouseout = viewHelpOut;
    a.onmouseout = viewHelpOut;
		box.onmouseover = viewHelpOver;
		box.helpBoxVisible = false;
		box.helpBoxHideTO = false;
		box.helpBoxHideTTL = ttl ? ttl : 1000;
    if (boxWidth)
      box.style.width = boxWidth + 'px';
  }
  box.style.top = (posGetTop(a) + posGetHeight(a) + 2) + 'px';
  var w = $(box).width();
  var l = posGetLeft(a);
  if (l + w > $(window).width())
    l = l - w + $(a).width();
  box.style.left = l + 'px';
	viewHelpOver.call(box);
	viewHelpVisible(box, true);
  var sw = getRealWidth(box);
  if (sw > $(box).width()) {
    var sw = Math.min(sw, $(window).width() - 40);
    $(box).width(sw);
    var al = $(a).offset().left;
    var aw = $(a).width();
    var bl = $(box).offset().left;
    if (bl + sw > $(window).width()) {
      box.style.left = (l - sw + aw) + 'px';
      bl = $(box).offset().left;
    }
    if (bl < 0) {
      box.style.left = (10) + 'px'
      bl = $(box).offset().left;
    }
  }
	if (a.blur)
		a.blur();
	return true;
}
function viewHelpGetObjects(obj) {
	if (!obj.tagName || (obj.tagName.toUpperCase() !== 'DIV' && obj.tagName.toUpperCase() !== 'A'))
		return false;
	if (obj.helpBox) {
		var a = obj;
		var box = obj.helpBox;
	} else {
		var a = obj.helpLink;
		var box = obj;
	}
	if (!a || !box || !a.helpBox || !box.helpLink)
		return false;
	return {a: a, box: box};
}
function viewHelpVisible(box, visible) {
	box.style.display = visible ? 'block' : 'none';
	box.helpBoxVisible = visible;
	return true;
}
function viewHelpStartHide(box) {
	box.helpBoxHideTO = setTimeout(
		new Function('', 'var box = document.getElementById("' + box.id.replace('/"/', '\\"') + '"); if (box) viewHelpVisible(box, false);'),
		box.helpBoxHideTTL
	);
	return true;
}
function viewHelpOut() {
	var obj = viewHelpGetObjects(this);
    if (!obj)
        return false;
	return obj.box.helpBoxVisible && viewHelpStartHide(obj.box);
}
function viewHelpOver() {
	var obj = viewHelpGetObjects(this);
    if (!obj)
        return false;
	if (obj.box.helpBoxVisible && obj.box.helpBoxHideTO)
		clearTimeout(obj.box.helpBoxHideTO);
	return true;
}
/*
	Position functions
*/
function posGetPageOffset(o){
	var l = 0;
	var t = 0;
	do {
		l += o.offsetLeft;
		t += o.offsetTop;
	} while ((o = o.offsetParent));
	return {left: l, top: t};
}
function posGetLeft(o) {
	return posGetPageOffset(o).left;
}
function posGetTop(o) {
	return posGetPageOffset(o).top;
}
function posGetWidth (o) {
	return o.offsetWidth;
}
function posGetHeight (o) {
    return o.offsetHeight;
}
/*
	Button function
*/
function buttonOver(obj) {
	var spans = obj.getElementsByTagName('SPAN');
	if (spans.length > 0)
		spans[0].className = 'underline';
}
function buttonOut(obj) {
	var spans = obj.getElementsByTagName('SPAN');
	if (spans.length > 0)
		spans[0].className = 'normal';
}
function getMethod(method, obj) {
  var args = [];
  for (var i = 2; i < arguments.length; i++)
    args[args.length] = arguments[i];
  if (!obj)
    obj = window;
  return function() {
    if (!isFunction(method))
      method = obj[method];
    return method.apply ? method.apply(obj, args) : method();
  }
}
function lockForm(form) {
	if (form.locked)
		return false;
	form.locked = true;
	setTimeout(
    function() {
      form.locked = false;
    },
    1000
  );
	return true;
}
function getPopupControl(elm) {
	var e = elm;
	while (e && e.tagName && !e._popupControl)
		e = e.parentNode;
	return (e && e._popupControl) ? e._popupControl : false;
}
function parse_url(url) {
  if (!url || url.constructor != String)
    return false;
  var m = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/);
  if (!m)
    return false;
  var res = {
    scheme: m[2],
    host: m[4],
    path: m[5],
    query: m[7],
    fragment: m[9]
  };
  if (res.host) {
    m = res.host.match(/^(?:([^:]+):)?([^@]+)@(.+)$/);
    if (m) {
      res.host = m[3];
      res.user = m[1] ? m[1] : m[2];
      res.password = m[1] ? m[2] : false;
    }
  }
  return res;
}
function pngFix(elm) {
  if (!elm || !elm.tagName || !$.browser.msie || elm.tagName.toUpperCase() != 'IMG')
    return false;
  var src = elm.src.replace(/\(/g, '%28').replace(/\)/g, '%29');
  elm.src = images_dir + '/spacer.gif';
  elm.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src.replace(/"/, '\"') + '",sizingMethod="scale")';
  return true;
}
function getImgSrc(elm) {
  if (!elm || !elm.tagName || elm.tagName.toUpperCase() != 'IMG' || !elm.src)
    return false;
  if ($.browser.msie && elm.src.search(/\/spacer\.gif$/) != -1 && elm.filters['DXImageTransform.Microsoft.AlphaImageLoader'])
    return elm.filters['DXImageTransform.Microsoft.AlphaImageLoader'].src;
  return elm.src;
}
function isPngFix(elm) {
  return $.browser.msie && elm && elm.tagName && elm.tagName.toUpperCase() == 'IMG' && elm.src && elm.src.search(/\/spacer\.gif$/) != -1 && elm.filters['DXImageTransform.Microsoft.AlphaImageLoader'];
}
/*
  Debug window (require jQuery)
  Usage:
    debug().html('example');
    debug().html('example', 10);
    debug().add('second string')
    debug().clean();
    debug().hide();
    debug().show();
    debug().row(0).html('example');
    debug().row(0).add('second part');
    debug().row(0).remove();
    debug().opacity(0.1);
*/
var debug = function() {
	var debug_panel = false;
	return function () {
		if (typeof(window.$) == 'undefined')
			return false;
		if (!debug_panel) {
			debug_panel = $(document.createElement('DIV')).
				css({
          position: 'absolute',
					border: '1px solid black',
					backgroundColor: 'white',
          display: 'none',
          top: '0px',
          left: '0px',
          width: '200px',
          height: '200px',
          overflow: 'auto',
          padding: '5px',
          margin: '0px'
        })
        .get(0);
			document.body.appendChild(debug_panel);
      debug_panel.defaultOpacity = 0.9;
      debug_panel.ttl = 0;
      debug_panel._extend_create = false;
      debug_panel._ttlTO = false;
      debug_panel._rowsLength = 0;
      /* Replace window content */
      debug_panel.html = function(str, ttl) {
        this._getBox().innerHTML = str;
        this.show();
        this.startTTL(arguments.length > 1 ? ttl : this.ttl);
      }
      /* Add new string */
      debug_panel.add = function(str, ttl) {
        this._getBox().innerHTML += str + "<br />\n";
        this.show();
        this.startTTL(arguments.length > 1 ? ttl : this.ttl);
      }
      /* Get row (old or new) */
      debug_panel.row = function(i) {
        var row = $('div:eq(' + i + ')', this._getBox()).get(0);
        if (!row) {
          for (var x = this._rowsLength; x < i + 1; x++) {
            row = this._getBox().appendChild(document.createElement('DIV'));
            row.remove = this._removeRow;
            row.html = this._htmlRow;
            row.add = this._addRow;
            row.box = this;
          }
          this._rowsLength = i + 1;
        }
        return row;
      }
      /* Remove row */
      debug_panel._removeRow = function() {
        if (this.parentNode) {
          this.box._rowsLength--;
          this.parentNode.removeChild(this);
        }
      }
      /* Replace row content */
      debug_panel._htmlRow = function(str, ttl) {
        this.innerHTML = str;
        this.box.show();
        this.box.startTTL(arguments.length > 1 ? ttl : this.parentNode.ttl);
      }
      /* Add content ot row */
      debug_panel._addRow = function(str, ttl) {
        this.innerHTML += str;
        this.box.show();
        this.box.startTTL(arguments.length > 1 ? ttl : this.parentNode.ttl);
      }
      /* Clean window content */
      debug_panel.clean = function() {
        this._rowsLength = 0;
        this._getBox().innerHTML = '';
      }
      /* Hide window */
      debug_panel.hide = function() {
        this.style.display = 'none';
      }
      /* Show window */
      debug_panel.show = function() {
        this.style.display = '';
      }
      /* Set window opacity */
      debug_panel.opacity = function(level) {
        level = parseFloat(level);
        if (isNaN(level) || level < 0 || level > 1)
          return false;
        level = Math.round(level * 100) / 100;
        if ($.browser.msie) {
          this.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity = ' + (level * 100) + ')';
        } else {
          this.style.opacity = level;
        }
        return true;
      }
      /* Start window auto-hide timer */
      debug_panel.startTTL = function(ttl) {
        if (this._ttlTO)
          clearTimeout(this._ttlTO);
        if (ttl <= 0) 
          return false;
        var o = this;
        this._ttlTO = setTimeout(function() { o.hide(); }, ttl * 1000);
        return true;
      }
      /* Extend debug panel */
      debug_panel.extend = function() {
        if (this._extend_create)
          return true;
        var scripts = document.getElementsByTagName('SCRIPT');
        var m;
        var path = false;
        for (var i = 0; i < scripts.length && !path; i++) {
          if (scripts[i].src && (m = scripts[i].src.match(/^(.+\/)common.js/)))
            path = m[1];
        }
        if (!path)
          return false;
        var s = document.createElement('SCRIPT');
        s.src = path + 'debug.js';
        document.body.appendChild(s);
        this._extend_create = true;
        return true;
      }
      /* Check - debug extended or not */
      debug_panel.is_extended = function() {
        return this._extend_create && typeof(window._debug_is_extended) != 'undefined' && _debug_is_extended;
      }
      debug_panel._getBox = function() {
        return this;
      }
      if (debug_panel.defaultOpacity > 0 && debug_panel.defaultOpacity <= 1) {
        debug_panel.opacity(debug_panel.defaultOpacity);
      }
		}
    /* Extend debug panel methods */
    if (typeof(window.debug_panel_ext_methods) != 'undefined' && debug_panel_ext_methods) {
      for (var i = 0; i < debug_panel_ext_methods.length; i++) {
        debug_panel[debug_panel_ext_methods[i]] = debug_panel_ext[debug_panel_ext_methods[i]];
      }
      if (typeof(debug_panel_ext.init) != 'undefined')
        debug_panel_ext.init.call(debug_panel);
      debug_panel_ext_methods = false;
      debug_panel_ext = false;
    }
 
    return debug_panel;
	}
}();
// -------------------------------------------------------------------
// DHTML Window Widget- By Dynamic Drive, available at: http://www.dynamicdrive.com
// v1.0: Script created Feb 15th, 07'
// v1.01: Feb 21th, 07' (see changelog.txt)
// v1.02: March 26th, 07' (see changelog.txt)
// v1.03: May 5th, 07' (see changelog.txt)
// v1.1:  Oct 29th, 07' (see changelog.txt)
// -------------------------------------------------------------------
var dhtmlwindow={
imagefiles:['windowfiles/min.gif', 'windowfiles/close.gif', 'windowfiles/restore.gif', 'windowfiles/resize.gif'], //Path to 4 images used by script, in that order
ajaxbustcache: true, //Bust caching when fetching a file via Ajax?
ajaxloadinghtml: '<b>Loading Page. Please wait...</b>', //HTML to show while window fetches Ajax Content?
minimizeorder: 0,
zIndexvalue:100,
tobjects: [], //object to contain references to dhtml window divs, for cleanup purposes
lastactivet: {}, //reference to last active DHTML window
init:function(t){
	var domwindow=document.createElement("div") //create dhtml window div
	domwindow.id=t
	domwindow.className="dhtmlwindow"
	var domwindowdata=''
	domwindowdata='<div class="drag-handle">'
	domwindowdata+='DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" title="Minimize" /><img src="'+this.imagefiles[1]+'" title="Close" /></div>'
	domwindowdata+='</div>'
	domwindowdata+='<div class="drag-contentarea"></div>'
	domwindowdata+='<div class="drag-statusarea"><div class="drag-resizearea" style="background: transparent url('+this.imagefiles[3]+') top right no-repeat;">&nbsp;</div></div>'
	domwindowdata+='</div>'
	domwindow.innerHTML=domwindowdata
	document.getElementById("dhtmlwindowholder").appendChild(domwindow)
	//this.zIndexvalue=(this.zIndexvalue)? this.zIndexvalue+1 : 100 //z-index value for DHTML window: starts at 0, increments whenever a window has focus
	var t=document.getElementById(t)
	var divs=t.getElementsByTagName("div")
	for (var i=0; i<divs.length; i++){ //go through divs inside dhtml window and extract all those with class="drag-" prefix
		if (/drag-/.test(divs[i].className))
			t[divs[i].className.replace(/drag-/, "")]=divs[i] //take out the "drag-" prefix for shorter access by name
	}
	//t.style.zIndex=this.zIndexvalue //set z-index of this dhtml window
	t.handle._parent=t //store back reference to dhtml window
	t.resizearea._parent=t //same
	t.controls._parent=t //same
	t.onclose=function(){return true} //custom event handler "onclose"
	t.onmousedown=function(){dhtmlwindow.setfocus(this)} //Increase z-index of window when focus is on it
	t.handle.onmousedown=dhtmlwindow.setupdrag //set up drag behavior when mouse down on handle div
	t.resizearea.onmousedown=dhtmlwindow.setupdrag //set up drag behavior when mouse down on resize div
	t.controls.onclick=dhtmlwindow.enablecontrols
	t.show=function(){dhtmlwindow.show(this)} //public function for showing dhtml window
	t.hide=function(){dhtmlwindow.hide(this)} //public function for hiding dhtml window
	t.close=function(){dhtmlwindow.close(this)} //public function for closing dhtml window (also empties DHTML window content)
	t.setSize=function(w, h){dhtmlwindow.setSize(this, w, h)} //public function for setting window dimensions
	t.moveTo=function(x, y){dhtmlwindow.moveTo(this, x, y)} //public function for moving dhtml window (relative to viewpoint)
	t.isResize=function(bol){dhtmlwindow.isResize(this, bol)} //public function for specifying if window is resizable
	t.isScrolling=function(bol){dhtmlwindow.isScrolling(this, bol)} //public function for specifying if window content contains scrollbars
	t.load=function(contenttype, contentsource, title){dhtmlwindow.load(this, contenttype, contentsource, title)} //public function for loading content into window
	this.tobjects[this.tobjects.length]=t
	return t //return reference to dhtml window div
},
open:function(t, contenttype, contentsource, title, attr, recalonload){
	var d=dhtmlwindow //reference dhtml window object
	function getValue(Name){
		var config=new RegExp(Name+"=([^,]+)", "i") //get name/value config pair (ie: width=400px,)
		return (config.test(attr))? parseInt(RegExp.$1) : 0 //return value portion (int), or 0 (false) if none found
	}
	if (document.getElementById(t)==null) //if window doesn't exist yet, create it
		t=this.init(t) //return reference to dhtml window div
	else
		t=document.getElementById(t)
	this.setfocus(t)
	t.setSize(getValue(("width")), (getValue("height"))) //Set dimensions of window
	var xpos=getValue("center")? "middle" : getValue("left") //Get x coord of window
	var ypos=getValue("center")? "middle" : getValue("top") //Get y coord of window
	//t.moveTo(xpos, ypos) //Position window
	if (typeof recalonload!="undefined" && recalonload=="recal" && this.scroll_top==0){ //reposition window when page fully loads with updated window viewpoints?
		if (window.attachEvent && !window.opera) //In IE, add another 400 milisecs on page load (viewpoint properties may return 0 b4 then)
			this.addEvent(window, function(){setTimeout(function(){t.moveTo(xpos, ypos)}, 400)}, "load")
		else
			this.addEvent(window, function(){t.moveTo(xpos, ypos)}, "load")
	}
	t.isResize(getValue("resize")) //Set whether window is resizable
	t.isScrolling(getValue("scrolling")) //Set whether window should contain scrollbars
	t.style.visibility="visible"
	t.style.display="block"
	t.contentarea.style.display="block"
	t.moveTo(xpos, ypos) //Position window
	t.load(contenttype, contentsource, title)
	if (t.state=="minimized" && t.controls.firstChild.title=="Restore"){ //If window exists and is currently minimized?
		t.controls.firstChild.setAttribute("src", dhtmlwindow.imagefiles[0]) //Change "restore" icon within window interface to "minimize" icon
		t.controls.firstChild.setAttribute("title", "Minimize")
		t.state="fullview" //indicate the state of the window as being "fullview"
	}
	return t
},
setSize:function(t, w, h){ //set window size (min is 150px wide by 100px tall)
	t.style.width=Math.max(parseInt(w), 150)+"px"
	t.contentarea.style.height=Math.max(parseInt(h), 100)+"px"
},
moveTo:function(t, x, y){ //move window. Position includes current viewpoint of document
	this.getviewpoint() //Get current viewpoint numbers
	t.style.left=(x=="middle")? this.scroll_left+(this.docwidth-t.offsetWidth)/2+"px" : this.scroll_left+parseInt(x)+"px"
	t.style.top=(y=="middle")? this.scroll_top+(this.docheight-t.offsetHeight)/2+"px" : this.scroll_top+parseInt(y)+"px"
},
isResize:function(t, bol){ //show or hide resize inteface (part of the status bar)
	t.statusarea.style.display=(bol)? "block" : "none"
	t.resizeBool=(bol)? 1 : 0
},
isScrolling:function(t, bol){ //set whether loaded content contains scrollbars
	t.contentarea.style.overflow=(bol)? "auto" : "hidden"
},
load:function(t, contenttype, contentsource, title){ //loads content into window plus set its title (3 content types: "inline", "iframe", or "ajax")
	if (t.isClosed){
		alert("DHTML Window has been closed, so no window to load contents into. Open/Create the window again.")
		return
	}
	var contenttype=contenttype.toLowerCase() //convert string to lower case
	if (typeof title!="undefined")
		t.handle.firstChild.nodeValue=title
	if (contenttype=="inline")
		t.contentarea.innerHTML=contentsource
	else if (contenttype=="div"){
		var inlinedivref=document.getElementById(contentsource)
		t.contentarea.innerHTML=(inlinedivref.defaultHTML || inlinedivref.innerHTML) //Populate window with contents of inline div on page
		if (!inlinedivref.defaultHTML)
			inlinedivref.defaultHTML=inlinedivref.innerHTML //save HTML within inline DIV
		inlinedivref.innerHTML="" //then, remove HTML within inline DIV (to prevent duplicate IDs, NAME attributes etc in contents of DHTML window
		inlinedivref.style.display="none" //hide that div
	}
	else if (contenttype=="iframe"){
		t.contentarea.style.overflow="hidden" //disable window scrollbars, as iframe already contains scrollbars
		if (!t.contentarea.firstChild || t.contentarea.firstChild.tagName!="IFRAME") //If iframe tag doesn't exist already, create it first
			t.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100%; height: 100%" name="_iframe-'+t.id+'"></iframe>'
		window.frames["_iframe-"+t.id].location.replace(contentsource) //set location of iframe window to specified URL
		}
	else if (contenttype=="ajax"){
		this.ajax_connect(contentsource, t) //populate window with external contents fetched via Ajax
	}
	t.contentarea.datatype=contenttype //store contenttype of current window for future reference
},
setupdrag:function(e){
	var d=dhtmlwindow //reference dhtml window object
	var t=this._parent //reference dhtml window div
	d.etarget=this //remember div mouse is currently held down on ("handle" or "resize" div)
	var e=window.event || e
	d.initmousex=e.clientX //store x position of mouse onmousedown
	d.initmousey=e.clientY
	d.initx=parseInt(t.offsetLeft) //store offset x of window div onmousedown
	d.inity=parseInt(t.offsetTop)
	d.width=parseInt(t.offsetWidth) //store width of window div
	d.contentheight=parseInt(t.contentarea.offsetHeight) //store height of window div's content div
	if (t.contentarea.datatype=="iframe"){ //if content of this window div is "iframe"
		t.style.backgroundColor="#F8F8F8" //colorize and hide content div (while window is being dragged)
		t.contentarea.style.visibility="hidden"
	}
	document.onmousemove=d.getdistance //get distance travelled by mouse as it moves
	document.onmouseup=function(){
		if (t.contentarea.datatype=="iframe"){ //restore color and visibility of content div onmouseup
			t.contentarea.style.backgroundColor="white"
			t.contentarea.style.visibility="visible"
		}
		d.stop()
	}
	return false
},
getdistance:function(e){
	var d=dhtmlwindow
	var etarget=d.etarget
	var e=window.event || e
	d.distancex=e.clientX-d.initmousex //horizontal distance travelled relative to starting point
	d.distancey=e.clientY-d.initmousey
	if (etarget.className=="drag-handle") //if target element is "handle" div
		d.move(etarget._parent, e)
	else if (etarget.className=="drag-resizearea") //if target element is "resize" div
		d.resize(etarget._parent, e)
	return false //cancel default dragging behavior
},
getviewpoint:function(){ //get window viewpoint numbers
	var ie=document.all && !window.opera
	var domclientWidth=document.documentElement && parseInt(document.documentElement.clientWidth) || 100000 //Preliminary doc width in non IE browsers
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	this.scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
	this.scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
	this.docwidth=(ie)? this.standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16)
	this.docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
},
rememberattrs:function(t){ //remember certain attributes of the window when it's minimized or closed, such as dimensions, position on page
	this.getviewpoint() //Get current window viewpoint numbers
	t.lastx=parseInt((t.style.left || t.offsetLeft))-dhtmlwindow.scroll_left //store last known x coord of window just before minimizing
	t.lasty=parseInt((t.style.top || t.offsetTop))-dhtmlwindow.scroll_top
	t.lastwidth=parseInt(t.style.width) //store last known width of window just before minimizing/ closing
},
move:function(t, e){
	t.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px"
	t.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px"
},
resize:function(t, e){
	t.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex, 150)+"px"
	t.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey, 100)+"px"
},
enablecontrols:function(e){
	var d=dhtmlwindow
	var sourceobj=window.event? window.event.srcElement : e.target //Get element within "handle" div mouse is currently on (the controls)
	if (/Minimize/i.test(sourceobj.getAttribute("title"))) //if this is the "minimize" control
		d.minimize(sourceobj, this._parent)
	else if (/Restore/i.test(sourceobj.getAttribute("title"))) //if this is the "restore" control
		d.restore(sourceobj, this._parent)
	else if (/Close/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control
		d.close(this._parent)
	return false
},
minimize:function(button, t){
	dhtmlwindow.rememberattrs(t)
	button.setAttribute("src", dhtmlwindow.imagefiles[2])
	button.setAttribute("title", "Restore")
	t.state="minimized" //indicate the state of the window as being "minimized"
	t.contentarea.style.display="none"
	t.statusarea.style.display="none"
	if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows
		dhtmlwindow.minimizeorder++ //increment order
		t.minimizeorder=dhtmlwindow.minimizeorder
	}
	t.style.left="10px" //left coord of minmized window
	t.style.width="200px"
	var windowspacing=t.minimizeorder*10 //spacing (gap) between each minmized window(s)
	t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px"
},
restore:function(button, t){
	dhtmlwindow.getviewpoint()
	button.setAttribute("src", dhtmlwindow.imagefiles[0])
	button.setAttribute("title", "Minimize")
	t.state="fullview" //indicate the state of the window as being "fullview"
	t.style.display="block"
	t.contentarea.style.display="block"
	if (t.resizeBool) //if this window is resizable, enable the resize icon
		t.statusarea.style.display="block"
	t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px" //position window to last known x coord just before minimizing
	t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px"
	t.style.width=parseInt(t.lastwidth)+"px"
},
close:function(t){
	try{
		var closewinbol=t.onclose()
	}
	catch(err){ //In non IE browsers, all errors are caught, so just run the below
		var closewinbol=true
 }
	finally{ //In IE, not all errors are caught, so check if variable isn't defined in IE in those cases
		if (typeof closewinbol=="undefined"){
			alert("An error has occured somwhere inside your \"onclose\" event handler")
			var closewinbol=true
		}
	}
	if (closewinbol){ //if custom event handler function returns true
		if (t.state!="minimized") //if this window isn't currently minimized
			dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing
		if (window.frames["_iframe-"+t.id]) //if this is an IFRAME DHTML window
			window.frames["_iframe-"+t.id].location.replace("about:blank")
		else
			t.contentarea.innerHTML=""
		t.style.display="none"
		t.isClosed=true //tell script this window is closed (for detection in t.show())
	}
	return closewinbol
},
setopacity:function(targetobject, value){ //Sets the opacity of targetobject based on the passed in value setting (0 to 1 and in between)
	if (!targetobject)
		return
	if (targetobject.filters && targetobject.filters[0]){ //IE syntax
		if (typeof targetobject.filters[0].opacity=="number") //IE6
			targetobject.filters[0].opacity=value*100
		else //IE 5.5
			targetobject.style.filter="alpha(opacity="+value*100+")"
		}
	else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax
		targetobject.style.MozOpacity=value
	else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax
		targetobject.style.opacity=value
},
setfocus:function(t){ //Sets focus to the currently active window
	this.zIndexvalue++
	t.style.zIndex=this.zIndexvalue
	t.isClosed=false //tell script this window isn't closed (for detection in t.show())
	this.setopacity(this.lastactivet.handle, 0.5) //unfocus last active window
	this.setopacity(t.handle, 1) //focus currently active window
	this.lastactivet=t //remember last active window
},
show:function(t){
	if (t.isClosed){
		alert("DHTML Window has been closed, so nothing to show. Open/Create the window again.")
		return
	}
	if (t.lastx) //If there exists previously stored information such as last x position on window attributes (meaning it's been minimized or closed)
		dhtmlwindow.restore(t.controls.firstChild, t) //restore the window using that info
	else
		t.style.display="block"
	this.setfocus(t)
	t.state="fullview" //indicate the state of the window as being "fullview"
},
hide:function(t){
	t.style.display="none"
},
ajax_connect:function(url, t){
	var page_request = false
	var bustcacheparameter=""
	if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
		page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){ // if IE6 or below
		try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else
		return false
	t.contentarea.innerHTML=this.ajaxloadinghtml
	page_request.onreadystatechange=function(){dhtmlwindow.ajax_loadpage(page_request, t)}
	if (this.ajaxbustcache) //if bust caching of external page
		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', url+bustcacheparameter, true)
	page_request.send(null)
},
ajax_loadpage:function(page_request, t){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
	t.contentarea.innerHTML=page_request.responseText
	}
},
stop:function(){
	dhtmlwindow.etarget=null //clean up
	document.onmousemove=null
	document.onmouseup=null
},
addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false)
	else if (target.attachEvent)
		target.attachEvent(tasktype, functionref)
},
cleanup:function(){
	for (var i=0; i<dhtmlwindow.tobjects.length; i++){
		dhtmlwindow.tobjects[i].handle._parent=dhtmlwindow.tobjects[i].resizearea._parent=dhtmlwindow.tobjects[i].controls._parent=null
	}
	window.onload=null
}
} //End dhtmlwindow object
// Windows popup functions
function showrewardcashwin(){
rewardscashwin=dhtmlwindow.open('customerrewardcash', 'ajax', '/customer-reward-cash.html', 'Customer Reward Cash', 'width=750px,height=450px, center=1,resize=1,scrolling=1');
}
function showcolorswatcheswin(){
colorswatcheswin=dhtmlwindow.open('colorswatches', 'ajax', '/color-swatches.html', 'Color Swatches', 'width=750px,height=450px,center=1,resize=1,scrolling=1');
}
function showhowtomeasurewin(){
howtomeasurewin=dhtmlwindow.open('howtomeasurewin', 'ajax', '/sizing-how-to-measure.html', 'Sizing - How To Measure', 'width=750px,height=450px, center=1,resize=1,scrolling=1');
}
function showPYpartysizingwin(){
PYpartysizingwin=dhtmlwindow.open('PYpartysizingwin', 'ajax', '/sizing-PY-party.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}
function showPYmothersizingwin(){
PYmothersizingwin=dhtmlwindow.open('PYmothersizingwin', 'ajax', '/sizing-PY-mother.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}
function showASpartysizingwin(){
ASpartysizingwin=dhtmlwindow.open('ASpartysizingwin', 'ajax', '/sizing-AS-party.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}
function showASmothersizingwin(){
ASmothersizingwin=dhtmlwindow.open('ASmothersizingwin', 'ajax', '/sizing-AS-mother.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}

function showPLmothersizingwin(){
PLmothersizingwin=dhtmlwindow.open('PLmothersizingwin', 'ajax', '/sizing-PL-mother.html', 'Sizing Information for this Dress', 'width=600px,height=300px, center=1,resize=1,');
}

function showAS2010partysizingwin(){
AS2010partysizingwin=dhtmlwindow.open('ASpartysizingwin', 'ajax', '/sizing-AS2010-party.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}
function showAS2010mothersizingwin(){
AS2010mothersizingwin=dhtmlwindow.open('AS2010mothersizingwin', 'ajax', '/sizing-AS2010-mother.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}
function showMQpartysizingwin(){
MQpartysizingwin=dhtmlwindow.open('MQpartysizingwin', 'ajax', '/sizing-MQ-party.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}
function showMQmothersizingwin(){
MQmothersizingwin=dhtmlwindow.open('MQmothersizingwin', 'ajax', '/sizing-MQ-mother.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}
function showJYflowergirlsizingwin(){
JYflowergirlsizingwin=dhtmlwindow.open('JYflowergirlsizingwin', 'ajax', '/sizing-JY-flowergirl.html', 'Sizing Information for this Dress', 'width=400px,height=560px, center=1,resize=1,');
}
function showLApartysizingwin(){
LApartysizingwin=dhtmlwindow.open('LApartysizingwin', 'ajax', '/sizing-LA-party.html', 'Sizing Information for this Dress', 'width=925px,height=325px, center=1,resize=1,');
}
function showPLpartysizingwin(){
PLpartysizingwin=dhtmlwindow.open('PLpartysizingwin', 'ajax', '/sizing-PL-party.html', 'Sizing Information for this Dress', 'width=750px,height=150px, center=1,resize=1,');
}
document.write('<div id="dhtmlwindowholder"><span style="display:none">.</span></div>') 
//container that holds all dhtml window divs on page
window.onunload=dhtmlwindow.cleanup
/*
var SNOW_Picture = "http://www.jessicasfashion.com/skin1/images/snow.gif"
var SNOW_no = 28;
var SNOW_browser_IE_NS = (document.body.clientHeight) ? 1 : 0;
var SNOW_browser_MOZ = (self.innerWidth) ? 1 : 0;
var SNOW_browser2_IE_NS = (document.documentElement && document.documentElement.clientWidth ) ? 1 : 0;
var SNOW_Time;
var SNOW_dx, SNOW_xp, SNOW_yp;
var SNOW_am, SNOW_stx, SNOW_sty; 
var i, SNOW_Browser_Width, SNOW_Browser_Height;
if (SNOW_browser_IE_NS)
{
	SNOW_Browser_Width = document.body.clientWidth - 25;
	SNOW_Browser_Height = document.body.clientHeight + 170;
}
else if (SNOW_browser_MOZ)
{
	SNOW_Browser_Width = self.innerWidth - 25;
	SNOW_Browser_Height = self.innerHeight +170;
} 
else if (SNOW_browser2_IE_NS) 
{
	SNOW_Browser_Width = document.documentElement.clientWidth -25;
	SNOW_Browser_Height = document.documentElement.clientHeight +170;
}
SNOW_dx = new Array();
SNOW_xp = new Array();
SNOW_yp = new Array();
SNOW_am = new Array();
SNOW_stx = new Array();
SNOW_sty = new Array();
for (i = 0; i < SNOW_no; ++ i) 
{ 
	var z = i+100;
	SNOW_dx[i] = 0; 
	SNOW_xp[i] = Math.random()*(SNOW_Browser_Width-50);
	SNOW_yp[i] = Math.random()*SNOW_Browser_Height;
	SNOW_am[i] = Math.random()*20; 
	SNOW_stx[i] = 0.02 + Math.random()/10;
	SNOW_sty[i] = 0.7 + Math.random();
	document.write("<\div id=\"SNOW_flake"+ i +"\" style=\"position: absolute; z-index: "+ z +"; visibility: visible; top: 15px; left: 15px;\"><\img src=\""+SNOW_Picture+"\" border=\"0\"><\/div>");
}
function SNOW_Weather() 
{ 
for (i = 0; i < SNOW_no; ++ i) 
{ 
	SNOW_yp[i] += SNOW_sty[i];
	if (SNOW_yp[i] > SNOW_Browser_Height-50) 
	{
		SNOW_xp[i] = Math.random()*(SNOW_Browser_Width-SNOW_am[i]-30);
		SNOW_yp[i] = 0;
		SNOW_stx[i] = 0.02 + Math.random()/10;
		SNOW_sty[i] = 0.7 + Math.random();
	}
	SNOW_dx[i] += SNOW_stx[i];
	document.getElementById("SNOW_flake"+i).style.top=SNOW_yp[i]+"px";
	document.getElementById("SNOW_flake"+i).style.left=SNOW_xp[i] + SNOW_am[i]*Math.sin(SNOW_dx[i])+"px";
}
SNOW_Time = setTimeout("SNOW_Weather()", 15);
}
*/
//SNOW_Weather(); 
