//JavaScript Document

<!--- shopping cart administration functions --->
	//general administration variable declarations
	
	//function obtains HTML to show the contents of the current shopping cart
	function displayAccountInfo(urlVars) {
		if(arguments.length==0){
			urlVars = '';
		}
		if(typeof(window.frames["adminBox"].displayContent)!='undefined') {
			window.frames["adminBox"].displayContent = "";
		}
		if(typeof(window.frames["adminBox"].toolbarContent)!='undefined') {
			window.frames["adminBox"].toolbarContent = "";
		}
		/*if(window.frames["adminBox"].contentDocument==null) {
			window.frames["adminBox"].window.displayContent = "";
		}
		if(window.frames["adminBox"].contentDocument==null) {
			window.frames["adminBox"].window.toolbarContent = "";
		}*/
		window.frames["adminBox"].location.href = jsRootPath+"e-Store/Cart/accountAdmin.cfm"+urlVars;
		//document.getElementById('adminBox').src = jsRootPath+"e-Store/Cart/accountAdmin.cfm"+urlVars;
		/*tempWin = window.open(jsRootPath+"e-Store/Cart/accountAdmin.cfm"+urlVars,"tempWindow","width=1,height=1");
		//tempWin.blur();*/
		//
		obj = window.frames['adminBox'];
		getAccountContents(obj);
	}
	
	//function to delay and check each second whether the display content has loaded
	function getAccountContents(newWindow) {
		if((typeof(newWindow.displayContent)=='undefined')||(typeof(newWindow.toolbarContent)=='undefined')) {
			t = setTimeout(function getTheContents() {getAccountContents(newWindow)},1000);
		} else if((newWindow.displayContent=="")||(newWindow.toolbarContent=="")) {
			t = setTimeout(function getTheContents() {getAccountContents(newWindow)},1000);
		} else {
			clearTimeout(t);
			document.getElementById("accountDisplay").innerHTML = newWindow.displayContent;
			document.getElementById("myAccountStatus").innerHTML = newWindow.toolbarContent;			
			if(getBrowserType()=="IE"){
				controlToolbarDetails('close');
				if(newWindow.toolbarDetailsOpen) {
					controlToolbarDetails('account');
				}
			}
			//newWindow.close();
			return;
		}						
	}