// pop up manager
function popup1(){
	alert("This is a test version of the web site.\nIf you have any sugestions, ideas, or any problem about web site please inform one of us amal@uocmas.info or asiri@uocmas.info \n");
}
//----------------------------------------------------------------------------
function showMsg(str){
	document.getElementById("bgset").style.visibility = "visible";
	document.getElementById("msgbx").style.visibility = "visible";
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
	  alert ("Browser does not support HTTP Request");
	  return;
	} 
	/*var url="../msgs/getMsg.php";
	url=url+"?mid="+ str;
	url=url+"&uid=<?php echo($_SESSION['mID']); ?>";
	url=url+"&ulv=<?php echo($_SESSION['ulevel']); ?>";
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);*/
} 

//-----------------------------------------------------------------------------
var xmlHttp;

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


// JavaScript Document
//---------------------------------------------------------------------------



//----------------------------------------------------------------------------
function stateChanged() { 
	if (xmlHttp.readyState>=0 && xmlHttp.readyState<4){
		document.getElementById("msgbx").innerHTML = "<h2 style='color:#ff0000;'>&nbsp; &nbsp; Loading.................. &nbsp; &nbsp; </h2>";
 	} 
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		document.getElementById("msgbx").innerHTML = xmlHttp.responseText;
 	} 
}

//-----------------------------------------------------------------------------
function delMsg(id){
	test = confirm("Are you sure you want to delete this message.");
	if(test){ window.open('../msgs/deleteMsg.php?mid='+id,'_self'); }
}

//-----------------------------------------------------------------------------
function retshow(){
	document.getElementById("bgset").style.visibility = "hidden";
	document.getElementById("msgbx").style.visibility = "hidden";
}

function getPageSize(){
		var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		
		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}

		return [pageWidth,pageHeight];
}

