<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function formHandler(form){
	var URL = document.form.site.options[document.form.site.selectedIndex].value;
	window.location.href = URL;
}

function openWindow(url,w,h,l,r,s,t,m){
	window.top.name = 'MainWindow';
	popupWin = window.open(url, 'remote', 'width='+w+',height='+h+',location='+l+',resizable='+r+',scrollbars='+s+',status='+t+',menubar='+m)
}

function openPlayer(url){
	window.top.name = "MainWindow";
	popupWin = window.open(url, 'remote', 'width=385,height=440,location=false,resizable=false,scrollbars=false,status=false,menubar=false')
}

//functions for the order look up page

function isIE(){
	return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}

function getWindowHeight(id, t, s) {
	var el = document.getElementById(id);
	var ht = 0;
	var doc = null;
	if(el.contentDocument) {
		doc = el.contentDocument;	
	} else {
		doc = document.frames[id].document;
	}
	if(doc.body.offsetHeight) {
		ht = doc.body.offsetHeight;
	} else if (doc.body.scrollHeight) {
		ht = doc.body.scrollHeight;
	} else {
		ht=200;
	}
	if(s != undefined) {
		if (t == 'start') {
			if(el.height > ht) {
				ht = s;
			} else { 
				ht = el.height;
			}	
		}
	} 
	if(isIE()) {
		ht += 50;
	}
	return ht;
}

function openOrder(orderId) {
	var curUrl = document.getElementById(orderId+'StatusFrame').src;
	if(curUrl.indexOf('/members/loading.asp') > -1) {
		var url = window.location.href;
		url = url.substring(0, (url.indexOf('orderlookup.asp')));
		url = url + 'trackOrder.asp?order=' + orderId + '&decor=0';
		document.getElementById(orderId+'ifRow').className = 'showTR';
		//openWindow(0, 100, orderId+'StatusFrame', true, 101);
		var h = 5;
		while(h < 100) {
			document.getElementById(orderId+'StatusFrame').height = h;
			h++;
		}
		var event= function() { clearTimeout(); openAniWindow(getWindowHeight(orderId+'StatusFrame', 'start', 100), getWindowHeight(orderId+'StatusFrame', 'end'), orderId+'StatusFrame', 5) };
		if(document.getElementById(orderId+'StatusFrame').addEventListener) { 
			document.getElementById(orderId+'StatusFrame').addEventListener('load', event, false); 
		} else if(document.getElementById(orderId+'StatusFrame').attachEvent) { 
			document.getElementById(orderId+'StatusFrame').attachEvent('onload', event); 
		} else {
			document.getElementById(orderId+'StatusFrame').attachEvent.onload = event; 
		}
		document.getElementById(orderId+'ControlCell').getElementsByTagName('a')[0].innerHTML = '-';
		document.getElementById(orderId+'StatusFrame').src = url;
	} else {
		if(document.getElementById(orderId+'ifRow').styleName == 'hiddenTR') {
			document.getElementById(orderId+'ifRow').styleName = 'showTR';
			document.getElementById(orderId+'ControlCell').getElementsByTagName('a')[0].innerHTML = '-';
			openAniWindow(0, getWindowHeight(orderId+'StatusFrame'), orderId+'StatusFrame', 5);
		} else {
			openAniWindow(document.getElementById(orderId+'StatusFrame').height, 0, orderId+'StatusFrame', 5);
			document.getElementById(orderId+'ControlCell').getElementsByTagName('a')[0].innerHTML = '+';
			document.getElementById(orderId+'ifRow').styleName = 'hiddenTR';
		}
	}
}

function openAniWindow(start, end, id, inc) {
	try{
		var direction = true
		if(start > end) {
			direction = false;
		}
		start = parseInt(start);
		end = parseInt(end);
		if(start != end && (!direction || start < end) && (direction || start > end)) {
			if(!direction) {
				inc = parseInt(0-inc);
			}
			if((start+inc) > -1) {
				if(direction && (start+inc) > end) {
					inc = ((start+inc) - end);
				} else if(!direction && (start+inc) < 0) {
					inc = start;
				}
				document.getElementById(id).height = (start+inc);
				setTimeout(function() {openAniWindow((start+inc), end, id, Math.abs(inc))}, 1);
			}
		}	
		if(start == end && end == 0) {
			document.getElementById(id).style.display = 'none';
		} else if (start == 0) {
			document.getElementById(id).style.display = '';
		}
	} catch(e) {
		alert(e.toString());
	}
}

//-->
