// JavaScript Document

xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
  	{
  		alert ("Your browser does not support AJAX!");
  		//return;
	}
	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;
	}

function scrollUpdate()
	{
		var speed = document.getElementById('speed').value;
		var delay = document.getElementById('delay').value;	
		xmlHttp=GetXmlHttpObject();
	    xmlHttp.onreadystatechange = function()
		 {
			if(xmlHttp.readyState==4)
				{
					document.getElementById('msg').innerHTML=xmlHttp.responseText;
					
				}
				else
				{
				document.getElementById('msg').value='Processing.....';
				}
		 }		
	
			var url="text_update_speed.php";
			url=url+"?speed="+speed;	
			url=url+"&delay="+delay;
			url=url+"&sid="+Math.random();
			xmlHttp.open("GET",url,true);	
			xmlHttp.send(null);
}
///function for getting more info about portfolio
function portfolioMore(id)
	{
		xmlHttp=GetXmlHttpObject();
	    xmlHttp.onreadystatechange = function()
		 {
			if(xmlHttp.readyState==4)
				{
					var str=xmlHttp.responseText;
					var strArray = str.split("*");
					document.getElementById('title').innerHTML=strArray[0];
					document.getElementById('full_desc').innerHTML=strArray[1];
					document.getElementById('url').innerHTML=strArray[2];					
					document.getElementById('img').innerHTML=strArray[3];		
					document.getElementById('s_desc').innerHTML=strArray[4];		
					document.getElementById('url_').innerHTML=strArray[5];
				}
				else
				{
				document.getElementById('img').innerHTML='<font color=#0F5E9E face=arial>Processing...</font>';
				}
		 }		
	
			var url="includes/more_portfolio.php";
			url=url+"?id="+id;	
			url=url+"&sid="+Math.random();
			xmlHttp.open("GET",url,true);	
			xmlHttp.send(null);
}
///function for getting more info about portfolio
function getQuote()
	{
		var name = document.getElementById('name').value;
		var comp = document.getElementById('company').value;
		var email = document.getElementById('email').value;
		var budget = document.getElementById('budget').value;
		var desc = document.getElementById('desc').value;
		xmlHttp=GetXmlHttpObject();
	    xmlHttp.onreadystatechange = function()
		 {
			if(xmlHttp.readyState==4)
				{
					document.getElementById('quote').innerHTML=xmlHttp.responseText;
				}
				else
				{
				document.getElementById('quote').value='Processing.....';
				}
		 }		
	
			var url="includes/quote_insert.php";
			url=url+"?name="+name;
			url=url+"&comp="+comp;
			url=url+"&email="+email;
			url=url+"&budget="+budget;
			url=url+"&desc="+desc;
			url=url+"&sid="+Math.random();
			xmlHttp.open("GET",url,true);	
			xmlHttp.send(null);
}
function contact()
	{
		var name = document.getElementById('name').value;
		var comp = document.getElementById('company').value;
		var email = document.getElementById('email').value;
		var enq = document.getElementById('enq').value;
		xmlHttp=GetXmlHttpObject();
	    xmlHttp.onreadystatechange = function()
		 {
			if(xmlHttp.readyState==4)
				{
					document.getElementById('contact').innerHTML=xmlHttp.responseText;
				}
				else
				{
				document.getElementById('contact').value='Processing.....';
				}
		 }		
	
			var url="includes/contact_insert.php";
			url=url+"?name="+name;
			url=url+"&comp="+comp;
			url=url+"&email="+email;
			url=url+"&enq="+enq;
			url=url+"&sid="+Math.random();
			xmlHttp.open("GET",url,true);	
			xmlHttp.send(null);
}
function portfolioDel(id,adv_id)
	{
		xmlHttp=GetXmlHttpObject();
	    xmlHttp.onreadystatechange = function()
		 {
			if(xmlHttp.readyState==4)
				{
					document.getElementById('port_list').innerHTML=xmlHttp.responseText;
					closeEdit();
				}
				else
				{
				document.getElementById('port_list').innerHTML='<font size=3>Processing.....</font>';
				}
		 }		
	
			var url="includes/biz_portfolio_del.php";
			url=url+"?id="+id;
			url=url+"&adv_id="+adv_id;
			url=url+"&sid="+Math.random();
			xmlHttp.open("GET",url,true);	
			xmlHttp.send(null);
} 
function portfolioEditForm(id,adv_id)
	{
		xmlHttp=GetXmlHttpObject();
	    xmlHttp.onreadystatechange = function()
		 {
			if(xmlHttp.readyState==4)
				{
					document.getElementById('port_edit').innerHTML=xmlHttp.responseText;
				}
				else
				{
				document.getElementById('port_edit').innerHTML='<font size=3>Processing.....</font>';
				}
		 }		
	
			var url="includes/biz_portfolio_edit_form.php";
			url=url+"?id="+id;
			url=url+"&adv_id="+adv_id;
			url=url+"&sid="+Math.random();
			xmlHttp.open("GET",url,true);	
			xmlHttp.send(null);
}
function portfolioEditUpdate(id,adv_id)
	{
		var port_title = document.getElementById('port_title_').value;
		var port_url = document.getElementById('port_url_').value;
		var port_desc = document.getElementById('port_desc_').value;
		xmlHttp=GetXmlHttpObject();
	    xmlHttp.onreadystatechange = function()
		 {
			if(xmlHttp.readyState==4)
				{
				//document.getElementById('port_edit').innerHTML=xmlHttp.responseText;
				var str=xmlHttp.responseText;
				var strArray = str.split("-");
				var id = strArray[0];
				var adv_id = strArray[1];
				portfolioEditForm(id,adv_id);
				document.getElementById('port_list').innerHTML=strArray[2];
				}
				else
				{
				document.getElementById('port_edit').innerHTML='<font size=3>Processing.....</font>';				
				}
		 }		
	
			var url="includes/biz_portfolio_update.php";
			url=url+"?id="+id;
			url=url+"&port_title="+port_title;
			url=url+"&port_url="+port_url;
			url=url+"&port_desc="+port_desc;
			url=url+"&adv_id="+adv_id;
			url=url+"&sid="+Math.random();
			xmlHttp.open("GET",url,true);	
			xmlHttp.send(null);
} 
