// JavaScript Document
function popUpWindow(href,height,width)
{
window.open(href,"my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width="+width+", height="+height)
}
 function showSpecialPage(pageid,showform) 
	 {
	    var url="classes/ajax.php?pageid="+pageid+"&form="+showform;
  
    xmlHttp=GetXmlHttpObject(mainPageLoding)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	 }
	 
     function send() 
	 {
	   		//var ip = new java.net.InetAddress.getLocalHost();
			//var ipStr = new java.lang.String(ip);

			var firstname = document.getElementById("firstname").value;
			var company= document.getElementById("company").value;
			var email= document.getElementById("email").value;
			var contactno= document.getElementById("contactno").value;
			var msg= document.getElementById("msg").value;
			
	 var url="classes/contactus.php?send=1&firstname="+firstname+"&company="+company+"&email="+email+"&contactno="+contactno+"&msg="+msg;
  
    xmlHttp=GetXmlHttpObject(sendContactus)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	 }
	 
	      function sendCV() 
	 {
	   		
			var realname = document.getElementById("realname").value;
			var phone= document.getElementById("phone").value;
			var email= document.getElementById("email").value;
			var fileUpload= document.getElementById("fileUpload").value;
	 var url="classes/submitcv.php?send=1&realname="+realname+"&phone="+phone+"&email="+email+"&fileUpload="+fileUpload;
  
    xmlHttp=GetXmlHttpObject(sendContactus)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	 }
	 
	  function uService(val) 
	 {
		 var url="classes/ajax.php?uService="+val;
	 
		xmlHttp=GetXmlHttpObject(underService)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	 }
	 
	 function ajaxService(val)
	 {
		var url="classes/ajax.php?service="+val;
  
    xmlHttp=GetXmlHttpObject(mainPageLoding)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	 }
  
   function ajaxPage(val)
	 {
		var url="classes/ajax.php?pageid="+val;
  
    xmlHttp=GetXmlHttpObject(mainPageLoding)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	 }
  
  
	function forgotPasswordField()
	{
		document.getElementById("login_email").innerHTML= '<table width="100%" border="0" cellspacing="0" cellpadding="0" id="forgotPassword" class="left_txt" ><tr><td valign="middle" class="left_txt">Please enter your email address </td></tr><tr><td valign="middle" class="left_txt"><input name="email" type="text" class="login_field"  size="30" /><img src="images/home/arrow.png" width="8" height="16" align="absmiddle" style="cursor:pointer" onclick="javascript:forgotPass()" /><br /><- <a href="#" onclick="javascript:loginField()">go back</a></td></tr> </table>';
		
	}
	
   function loginField()
	{
	 	document.getElementById("login_email").innerHTML= '<form id="form1" name="form1" method="post" action="index.php?page=2"><input name="userid" type="text" id="userid" class="login_field" value="" size="30" /><br /><input name="password" id="password" type="password" class="login_field" value="" size="30" /><img src="images/home/arrow.png" width="8" height="16" align="absmiddle" style="cursor:pointer" onclick=\"javascript: document.form1.submit();\" /><br /><a href="javascript:void(0)" onclick="javascript:forgotPasswordField()">Forgot password </a>| <a href="javascript:void(0)" onmouseout="Hide(\'Help\')" onmouseup="Show(\'Help\',20,150)">Help</a> </form>';
	}
		
	function forgotPass()
	{
		
		var email = document.getElementById("email").value;
	 	if(email=="")
		{
		   Show("emailError",15,15);
	    }
		else
		{
			var url="classes/password.php?email="+email;
		
			xmlHttp=GetXmlHttpObject(action)
			xmlHttp.open("GET", url , true)
			xmlHttp.send(null)
	   }
	}
	/* this function shows the pop-up when
     user moves the mouse over the link */
	function showProjectDetail(val)
	 {
		var url="http/home/project.php?projectid="+val;
	
		xmlHttp=GetXmlHttpObject(ProjectDetail)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	 }
	 
	
    function Show(divName, leftVal, topVal)
	    {
	    var Popup = document.getElementById(""+divName);
        alert(window.event.clientX)
	    x = window.event.clientX + document.body.scrollLeft + leftVal;
        y = event.clientY + document.body.scrollTop - topVal;
        
		Popup.style.display="block";
       	Popup.style.left = x;
        Popup.style.top = y;
		
		if(divName == "emailError")
		 {
		   setTimeout("Hide('emailError')",5000);
		 }
    }
    /* this function hides the pop-up when
     user moves the mouse out of the link */
    function Hide(divName)
    {
        /* hide the pop-up */
		var Popup = document.getElementById(""+divName);
        Popup.style.display="none";
    }
	
	function searchCall()
	{
	  /* This function is called after the search button is clicked */
	  var txtSearch = document.getElementById("searchElement").value;
	  var url="classes/search.php?text="+txtSearch;
	
		xmlHttp=GetXmlHttpObject(searchFunction)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	  
	}
	
	function loginSubmit()
	{
	  document.form1.submit();
	}
	
	function callSearch()
	{
		var string = "<input type=\"text\" id=\"searchElement\" name=\"searchElement\" class=\"login_field\" >&nbsp;&nbsp;<input type=\"button\" id=\"cmdSearch\" name=\"cmdSearch\" value=\"Search\"  class=\"login_field\" onclick=\"javascript:searchCall()\"> "; 
	  document.getElementById("search").innerHTML = string;
	  
	}
	
	function editProfile(clientid)
	{
		var url="http/home/profile.php?clientid="+clientid;
	
		xmlHttp=GetXmlHttpObject(profileSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	}
	
	function changeProfile()
	{
		
	var  clientid = document.getElementById("clientid").value;
	var  oldpassword = document.getElementById("oldpassword").value;
	var  newpassword = document.getElementById("newpassword").value;
	var  repassword = document.getElementById("repassword").value;
	var  companyname = document.getElementById("companyname").value;
	var  email = document.getElementById("email").value;	
	if(document.getElementById("fromUpload").value)
		{var logoimage = document.getElementById("fromUpload").value;}
		else
		{var logoimage = document.getElementById("oldimg").value;}	
	var  personname = document.getElementById("personname").value;
	var  add1 = document.getElementById("add1").value;
	var  add2 = document.getElementById("add2").value;
	var  city = document.getElementById("city").value;
	var  state = document.getElementById("state").value;
	var  country = document.getElementById("country").value;
	var  pin = document.getElementById("pin").value;
	var  phone1 = document.getElementById("phone1").value;
	var  phone2 = document.getElementById("phone2").value;
	var  natureofbusiness = document.getElementById("natureofbusiness").value;
	var  modifieddate = document.getElementById("modifieddate").value;
	var  status = document.getElementById("status").value;
	var  yyyy = document.getElementById("yyyy").value;
	var  mm = document.getElementById("mm").value;
	var  dd = document.getElementById("dd").value;
	
		var url="http/home/profile.php?saveProfile=1&clientid="+clientid+"&oldpassword="+oldpassword+"&newpassword="+newpassword+"&repassword="+repassword+"&companyname="+companyname+"&email="+email+"&logoimage="+logoimage+"&personname="+personname+"&add1="+add1+"&add2="+add2+"&city="+city+"&state="+state+"&country="+country+"&pin="+pin+"&phone1="+phone1+"&phone2="+phone2+"&natureofbusiness="+natureofbusiness+"&modifieddate="+modifieddate+"&status="+status+"&yyyy="+yyyy+"&mm="+mm+"&dd="+dd;
		
		xmlHttp=GetXmlHttpObject(profileSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	}
	
	function contactEvTeam(clientId)
	{
		var url = "http/home/discussion.php?showAll=1&clientId="+clientId;
		
		xmlHttp=GetXmlHttpObject(profileChangeSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
		
	}
	
	function newDiscussion(clientId)
	{
		var url = "http/home/discussion.php?new=1&clientId="+clientId
		xmlHttp=GetXmlHttpObject(profileChangeSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	}
	
	function disSave()
	{
		var clientid = document.getElementById("clientid").value ;
		var projectid = document.getElementById("projectid").value ;
		var name = document.getElementById("txtname").value ;
		var message = document.getElementById("message").value ;
		var title = document.getElementById("title").value ;
		
	    var url = "http/home/discussion.php?addNew=1&clientId="+clientid+"&projectid="+projectid+"&name="+name+"&message="+message+"&title="+title;
    	
		xmlHttp=GetXmlHttpObject(profileChangeSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
		
	}
		function showDiscussion(discussionId,clientId)
	{
		var url = "http/home/discussion.php?showDiscussion=1&discussionId="+discussionId+"&clientId="+clientId
		
		xmlHttp=GetXmlHttpObject(profileChangeSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	}
	
		function showContd(discussionId,title)
	{
		var projectid = document.getElementById("projectid").value ;
		var clientid = document.getElementById("clientid").value ;
		
		var url = "http/home/discussion.php?reply=1&discussionId="+discussionId+"&title="+title+"&projectid="+projectid+"&clientid="+clientid
		xmlHttp=GetXmlHttpObject(profileChangeSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	}

		function replySubmit()
	{
		var clientid = document.getElementById("clientid").value;
		var title = document.getElementById("txttitle").value;
	    var logid = document.getElementById("logid").value
	    var replyMessage = document.getElementById("replyMessage").value;	
		var projectid = document.getElementById("projectid").value ;
		var name = document.getElementById("rplyname").value;
		
		var url = "http/home/discussion.php?saveRply=1&clientid="+clientid+"&title="+title+"&logid="+logid+"&projectid="+projectid+"&replyMessage="+replyMessage+"&name="+name;
		
		xmlHttp=GetXmlHttpObject(profileChangeSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	}
	
	function paymentServices(clientid)
	{
		var url = "http/home/clientPayment.php?clientId="+clientid
	
		xmlHttp=GetXmlHttpObject(profileChangeSubmit)
		xmlHttp.open("GET", url , true)
		xmlHttp.send(null)
	}	