function hideSystemMessage(){
	hideEl('system-message');
}// function hideSystemMessage

function showSystemMessage(){
	showEl('system-message');
}// function hideSystemMessage

function showEl(sEl){
	if(document.all){
		if(document.all[sEl]){
			document.all[sEl].style.display = 'block';
		}// if element exists
	} else if (document.getElementById){
		if(document.getElementById(sEl)){
			document.getElementById(sEl).style.display = 'block';
		}// if element exists
	}// check for DOM browsers
}

function hideEl(sEl){
	if(document.all){
		if(document.all[sEl]){
			document.all[sEl].style.display = 'none';
		}// if element exists
	} else if (document.getElementById){
		if(document.getElementById(sEl)){
			document.getElementById(sEl).style.display = 'none';
		}// if element exists
	}// check for DOM browsers
}

function positionResize(sEl,top,left,width,height){
	el = getElement(sEl);

	if(!isObject(el)) return false;

	if(!isNaN(top) && !isNull(top) && el.style){
		alert(top + "px");
		el.style.top = top + "px";
	}
	if(!isNaN(left) && !isNull(left) && el.style){
		el.style.left = left + "px";
	}
	if(!isNaN(width) && !isNull(width) && el.style){
		el.style.width = width + "px";
	}
	if(!isNaN(height) && !isNull(height) && el.style){
		el.style.height = height + "px";
	}
}

function getElement(sEl){
	 if (document.getElementById){
		if(document.getElementById(sEl)){
			return document.getElementById(sEl);
		}// if element exists
	} else if(document.all){
		if(document.all[sEl]){
			return document.all[sEl];
		}// if element exists
	}// check for DOM browsers
}

function isNull(a) {
    return typeof a == 'object' && !a;
}

function isObject(a)
{
	return (typeof a == 'object' && !!a) || isFunction(a);
}

function isFunction(a)
{
	return typeof a == 'function';
}


// popUpWindow displays the ring tone preview pop up.

var popUpWin=0;
	function popUpWindow(URLStr, left, top, width, height)
	{
	  var iLeft = isNaN(left)?280:left;
	  var iTop = isNaN(top)?400:top;
	  var iWidth = isNaN(width)?220:width;
	  var iHeight = isNaN(height)?125:height;
	  if(popUpWin)
	  {
		if(!popUpWin.closed) popUpWin.close();
	  }
	  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+iWidth+',height='+iHeight+',left='+iLeft+', top='+iTop+',screenX='+iLeft+',screenY='+iTop+'');
	}

// End popUpWin

// buynow() redirects the user to the get it page (parent) and closes the pop up (child).


// End buynow()

function appendContent(containerId,content,flagReplace){
	//if IE 4+
	if (document.all && !document.createRange){
		if (flagReplace){
			document.all[containerId].innerHTML = content;
		}// check replace content
		else{
			document.all[containerId].innerHTML = document.all[containerId].innerHTML + content;
		}
	}
	//else if DOM browsers
	else if (document.getElementById && document.createContextualFragment){
		rng = document.createRange();
		el = document.getElementById(containerId);
		rng.setStartBefore(el);
		htmlFrag = rng.createContextualFragment(content);
		if (flagReplace){
			while (el.hasChildNodes()){
				el.removeChild(el.lastChild);
			}
		}//check replace content
		el.appendChild(htmlFrag);
	}
	else if (document.getElementById ){
		el = document.getElementById(containerId);
		if (flagReplace){
			el.innerHTML = content;
		}// check replace content
		else{
			el.innerHTML = el.innerHTML + content;
		}
	}
 }


 // display the phplive chat redirect page
 // redirect_url is the chat_passthru page
  function launch_support_chat(redirect_url) {

  	var chat_width = 450 ;
	var chat_height = 360 ;
	var date = new Date();

	leWindow = window.open( redirect_url, date.getTime(), 'scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width='+chat_width+',height='+chat_height+'' ) ;
	leWindow.focus() ;
}


