var contentObj;   // refer  the  content of  <div>

function goToNewsInfo() {
	visitedId1=document.getElementById("visitedId").value;
	window.location="newsinformation.asp?id="+visitedId1;
}
function getAjaxFile(urlPage) {
	xmlHttp=CreateHttpObject()
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",urlPage,true)
	xmlHttp.send(null)
}
function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
	    contentObj.innerHTML=xmlHttp.responseText 
	 } 
} 
function CreateHttpObject() { 
	var objXMLHttp=null
	try {
		objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } 
	catch (e) {
			try {
				objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (err) {
				objXMLHttp = null;
			}
    }
	if(!objXMLHttp && typeof XMLHttpRequest != "undefined")
		objXMLHttp = new XMLHttpRequest();
return objXMLHttp
}
var browser=navigator.appName;
var version=navigator.appVersion;
var index=version.lastIndexOf("Safari");
 
function testService() {
	  //alert(browser);
      if (browser=="Netscape") {
		 // alert("aaaa");
	    if (index != - 1) {
			 //alert("fgh");
			 document.getElementById('boxrightId').className="serviceBox3";
		}
	  }
}

function show(id) {
	document.getElementById(id).style.display='block';	 
}
function hide(id) {
	document.getElementById(id).style.display='none';	 
}
function simplePreload()

{ 


  var args = simplePreload.arguments;

  document.imageArray = new Array(args.length);

  for(var i=0; i<args.length; i++)

  {
    
    document.imageArray[i] = new Image;

    document.imageArray[i].src = args[i];

  }

}
function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}
function menuTop(id) {
	 menutopHidden1=document.getElementById("myMenuOwn").value;
	 for  (i=1;i<=6;i++) {
		if (parseInt(menutopHidden1) !=  parseInt(i) )
			switchImage("topimg"+i,"images/menu"+i+".png");	
	 }
     switchImage("topimg"+id,"images/menub"+id+".png");	
}
function menuTopout(id) {
     switchImage("topimg"+id,"images/menu"+id+".png");	
}
simplePreload('images/menu1.png','images/menu2.png','images/menu3.png','images/menu4.png','images/menu5.png','images/menu6.png','images/menub1.png','images/menub2.png','images/menub3.png','images/menub4.png','images/menub5.png','images/menub6.png','images/bgtopRight.gif','images/contactusTop.gif','images/ajax-loader3.gif','images/ajax-loader.gif','images/photoGalleryTitle.gif','images/comestic.gif','images/newsTitle.gif','images/ourSergeons.gif','images/ourServicestitle.gif','images/aboutHIMC.gif','images/next1.gif','images/previous1.gif');
function nextNews() {
	currentNews1=document.getElementById("currentNews").value;
	sommeNews1=document.getElementById("sommeNews").value;
	currentNews1=parseInt(currentNews1)+1;
	if (parseInt(currentNews1) > parseInt(sommeNews1)   ) {
			currentNews1=sommeNews1;
	}
	document.getElementById("currentNews").value=currentNews1;
	document.getElementById('NewsIdUpcoming').innerHTML="<div style='position:relative;width:290px;text-align:center;margin-top:0px;'><img src='images/ajax-loader.gif' width='35' height='35' align='middle' /></div>";	
    contentObj=document.getElementById('NewsIdUpcoming');
	getAjaxFile("rightNews.asp?id="+currentNews1);	
}
function previousNews() {
	currentNews1=document.getElementById("currentNews").value;
	sommeNews1=document.getElementById("sommeNews").value;
	currentNews1=parseInt(currentNews1)-1;

 	if (parseInt(currentNews1) < 0  ) {
			currentNews1=0;
	}
    document.getElementById("currentNews").value=currentNews1;

 	document.getElementById('NewsIdUpcoming').innerHTML="<div style='position:relative;width:290px;text-align:center;margin-top:0px;'><img src='images/ajax-loader.gif' width='35' height='35' align='middle' /></div>";	
    contentObj=document.getElementById('NewsIdUpcoming');
	getAjaxFile("rightNews.asp?id="+currentNews1);	
}
function openFace(firstId,catId,Id) {
	document.getElementById('containerAjaxService').innerHTML="<div style='position:relative;width:651px;text-align:center;margin-top:25px;'><img src='images/ajax-loader3.gif' width='100' height='100' align='middle' /></div>";	
    contentObj=document.getElementById('containerAjaxService');
	getAjaxFile("ajaxFace.asp?catId="+catId+"&firstId="+firstId+"&Id="+Id+"&rnd="+Math.random());	
}

function openPart2(firstId,catId,Id) {
	document.getElementById('containerAjaxService').innerHTML="<div style='position:relative;width:651px;text-align:center;margin-top:25px;'><img src='images/ajax-loader3.gif' width='100' height='100' align='middle' /></div>";	
    contentObj=document.getElementById('containerAjaxService');
	getAjaxFile("ajaxPart2.asp?catId="+catId+"&firstId="+firstId+"&Id="+Id+"&rnd="+Math.random());	
}

function openService(id) {
	document.getElementById('containerAjaxService').innerHTML="<div style='position:relative;width:651px;text-align:center;margin-top:25px;'><img src='images/ajax-loader3.gif' width='100' height='100' align='middle' /></div>";	
    contentObj=document.getElementById('containerAjaxService');
	getAjaxFile("ajaxServices.asp?id="+id);	
}
function currentService() {
	document.getElementById('containerAjaxService').innerHTML="<div style='position:relative;width:651px;text-align:center;margin-top:25px;'><img src='images/ajax-loader3.gif' width='100' height='100' align='middle' /></div>";	
    contentObj=document.getElementById('containerAjaxService');
	getAjaxFile("ajaxMain.asp");		
}
var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)

{

  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}


