function getXMLHTTP() 
{ //fuction to return the xml http object
	var xmlhttp=false;	
	try
	{
		xmlhttp=new XMLHttpRequest();
	}
	catch(e)	
	{		
		try
		{			
			xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			try
			{
                		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e1)
			{
				xmlhttp=false;
			}
		}
                }
	return xmlhttp;
	}
        function getcommon(strURL,divname) 
	{
            
       var req = getXMLHTTP();
    
		if (req) 
		{
			req.onreadystatechange = function()
			 {
				if (req.readyState == 4)
				 {
                                  // only if "OK"
                                  if (req.status == 200)
					{	
document.getElementById(divname).innerHTML=req.responseText;
 
 } 
					else
					{
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}			
}

function validatesub() 
{
       regexy = /^[\w\.]+@[a-zA-Z_]+?\.[a-zA-Z\.]{2,6}$/;
       var a= document.getElementById("title");
       var b= document.getElementById("email");
       var j=regexy.test(b.value);
       var c= document.getElementById("errormsg");
  if(a.value=="")
  {
    c.innerHTML="Please fill name";
    return false;
  }
  else if(b.value=="")
  {
      c.innerHTML="Please fill email";
   	  return false;
  }  else if(j==false)
  {
     c.innerHTML="Please correct email";
     return false;
  }
            return true;
        }

function contentpagesnation(id,image) 
{
     getcommon('image.php?type=show','simplegaller');
     getcommon('content.php?id='+id,'leftpanel');
}
//----common function start---//
function contentpages(id,image) 
{
	getcommon('image.php?type=hide&image=phpThumb/'+image,'simplegaller');
    getcommon('content.php?id='+id,'leftpanel');
}
//----common function end---//
//----index function start---//
function indexpages(image) 
{
    getcommon('image.php?type=hide&image=phpThumb/'+image,'simplegaller');
}
//----index function end---//
//----gallary function start---//
function gallary() 
{
	getcommon('image.php?image=phpThumb/3header.jpg&type=hide','simplegaller');
	getcommon('gallery.php','leftpanel');
}
//----gallary function end---//
//----events function start---//
function events() 
{
    getcommon('image.php?image=phpThumb/7header.jpg&type=hide','simplegaller');
    getcommon('events.php','leftpanel');
}
//----events function end---//
//----booking function start---//
function booking() 
{
	getcommon('image.php?image=phpThumb/3header.jpg&type=hide','simplegaller');
	getcommon('booking.php','leftpanel');
}
//----booking function end---//
function imagechange(image) 
{
    document.getElementById("imgbanner").src=image;         
}
//////////////////////----------------------------------/////////////////
function booking_gallary() 
{
	getcommon('image.php?image=phpThumb/3header.jpg&type=hide','gallary');
	getcommon('booking.php','leftpanel');
}
