

//---------------------------------Script for check() function-------------------------------------------------
function check1()
{
 //To check whether Text_box are not empty  
  var username=document.sell.username.value;
 var password=document.sell.password.value;
 var confirmpass=document.sell.confirmpass.value;

 var name=document.sell.name.value;
 var status= document.sell.status.value;
 var other= document.sell.other.value;
 var country= document.sell.country.value; 
 var city= document.sell.city.value;
 var college= document.sell.college.value;
 var uni=document.sell.uni.value ;
 var cource=document.sell.cource.value; 
 var abstractinfo=document.sell.abstractinfo.value;
 var domain1=document.sell.domain1.value;
 var domainother=document.sell.domainother.value;
 var tech=document.sell.tech.value;
var othertechno=document.sell.othertechno.value;

 var software= document.sell.software.value;
 var hardware= document.sell.hardware.value;
 var amt= document.sell.amt.value;
 var mobile=document.sell.mobile.value;
 var email= document.sell.email.value;


 var blankField = "";
 
 if(username.length==0) 
 {
		alert("Please enter the UserName!");
		document.sell.username.focus();
		return false;
 }
 else 
{
   var myString=new String(username);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.username.value="";
        document.sell.username.focus();
        return false;
        }
        } 
            
}
  //==========================================================
  if(password.length==0) 
 {
		alert("Please enter password!");
		document.sell.password.focus();
		return false;
 }
 else 
   {
   var myString=new String(password);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.password.value="";
        document.sell.password.focus();
        return false;
        }
        } 
            
  }
  if(password.length <6)
        {
	        alert("Enter 6 digit values for password!");
			document.sell.password.focus();
			return false;
        }	 

  //==================================================
   if(confirmpass.length==0) 
 {
		alert("Please enter confirm password!");
		document.sell.confirmpass.focus();
		return false;
 }
 else 
   {
   var myString=new String(confirmpass);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.confirmpass.value="";
        document.sell.confirmpass.focus();
        return false;
        }
        }
}
  if(confirmpass!=password)
{
  alert("Confirm password and passowrd must be same");
        document.sell.confirmpass.value="";
        document.sell.confirmpass.focus();
        return false;
}

 
//======================================For name=================================
  if(name.length==0) 
 {
		alert("Please enter the Name!");
		document.sell.name.focus();
		return false;
 }
 

 else 
   {
   var myString=new String(name);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.name.value="";
        document.sell.name.focus();
        return false;
        }
        } 
        //-------check only text validation----------  
  		var surname = document.getElementById('name').value;
  		if (!surname.match(/^[a-zA-Z ]+$/)) 
    		{
   			 alert("you entered some weird characters in your Name...");
    		document.sell.name.focus();
    		return false;
    		}     
  }
  //===========================For status
if(document.sell.status.value =="Select")
{
alert("Select status!");
document.sell.status.focus();
return false;
}
if(document.sell.status.value =="other")
{

 if(other.length==0) 
{
		alert("Please enter information if your status is 'Other' !");
		document.sell.other.focus();
		return false;
}
}

 //==========================For country==========================
if(document.sell.country.value =="Select")
{
alert("Select country!");
document.sell.country.focus();
return false;
}

//================================For City
 if(city.length==0)
 {
	alert("Please enter City information ! "+blankField);
	document.sell.city.focus();
	return false;
 }
 else 
   {
        var myString=new String(city);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.city.value="";
        document.sell.city.focus();
        return false;
        }
        }
	//-------check only text validation----------
        var cityname = document.getElementById('city').value;
  	 	if (!cityname.match(/^[a-zA-Z ]+$/)) 
    		{
   		alert("you entered some weird characters in your City Name...");
    		document.sell.city.focus();
    		return false;
    		}  
    }
    


 

//===================================For college
  if(document.sell.status.value =="student")
{
 if(college.length==0) 
 {
	alert("Please enter the college information!");
	document.sell.college.focus();
	return false;
 }
 else 
   {
        var myString=new String(college);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.college.value="";
        document.sell.college.focus();
        return false;
        }
        }
    }

 }

//============================For university=================================
 if(document.sell.status.value =="student")
{

 if(uni.length==0)
 {
	alert("Please enter university information ! "+blankField);
	document.sell.uni.focus();
	return false;
 }
 else 
   {
        var myString=new String(uni);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.uni.value="";
        document.sell.uni.focus();
        return false;
        }
        } 
}
}
 
 //-----------------------For cource---------------------
  if(document.sell.status.value =="student")
{

 if(cource.length==0) 
 {
	alert("Please enter cource Name!");
	document.sell.cource.focus();
	return false;
 }
 else 
   {
        var myString=new String(cource);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.cource.value="";
        document.sell.cource.focus();
        return false;
        }
        }
    }
    }
    //======================================abstract=================================
  if(abstractinfo.length==0) 
 {
		alert("Please enter abstractinfo!");
		document.sell.abstractinfo.focus();
		return false;
 }
 

 else 
   {
   var myString=new String(abstractinfo);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Spaces Not allowed");
        document.sell.abstractinfo.value="";
        document.sell.abstractinfo.focus();
        return false;
        }
        } 
           
  }
    if(abstractinfo.length<20)
{
		alert("Please give abstract about 500 words!");
		document.sell.abstractinfo.focus();
		return false;
}
//======================================================domain1
if(document.sell.domain1.value =="Select")
{
alert("Select domain!");
document.sell.domain1.focus();
return false;
}
//------------------------------------
if(document.sell.domain1.value =="Other")
{
document.sell.domainother.disabled=false;
document.sell.domainother.style.backgroundColor="#FFFFFF";

 if(domainother.length==0) 
{
		alert("Please enter information about other domain!");
		document.sell.domainother.focus();
		return false;
}
}

  
//======================================================technology
if(document.sell.tech.value =="Select")
{
alert("Select technology!");
document.sell.tech.focus();
return false;
}
//------------------------------------
if(document.sell.tech.value =="Other")
{
document.sell.othertechno.disabled=false;
document.sell.othertechno.style.backgroundColor="#FFFFFF";
		
if(othertechno.length==0) 
{
		alert("Please enter information about other technology !");
		document.sell.othertechno.focus();
		return false;
}
}

//===============================software requirements
 if(software.length==0) 
 {
		alert("Please enter the software requirements!");
		document.sell.software.focus();
		return false;
 }
 

 else 
   {
   var myString=new String(software);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.software.value="";
        document.sell.software.focus();
        return false;
        }
        } 
        
  }
  //===============================hardware requirements
 if(hardware.length==0) 
 {
		alert("Please enter the hardware requirements!");
		document.sell.hardware.focus();
		return false;
 }
 

 else 
   {
   var myString=new String(hardware);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.hardware.value="";
        document.sell.hardware.focus();
        return false;
        }
        } 
        
  }
//===============================Expected amount
 if(amt.length==0) 
 {
		alert("Please enter the Expected amount!");
		document.sell.amt.focus();
		return false;
 }
 

 else 
   {
   var myString=new String(amt);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.sell.amt.value="";
        document.sell.amt.focus();
        return false;
        }
        } 
        
  }

if(isNaN(amt))
	 {
		 alert("Enter Numaric values of expected amount!");
		 document.sell.amt.focus();
		 return false;
	 }	
//===================================================mobile
if(mobile.length==0) 
 {
		alert("Please enter Mobile number !");
		document.sell.mobile.focus();
		return false;
 }
 		var mobile= document.getElementById('mobile').value;
  	 	if (!mobile.match(/^[0-9,\-,\+,\,]+$/)) 
    		{
   			alert("you entered some weird characters in your mobile number...");
    		document.sell.mobile.focus();
    		return false;
    		} 

	if(mobile.length<10)
	 {
		 alert("Enter 10 digit values of mobile!");
		 document.sell.mobile.focus();
		 return false;
	 }
//=====================================================================For Email========
 if(email.length==0) 
 {
		alert("Please enter email information !");
		document.sell.email.focus();
		return false;
 }

if(document.sell.email.value != "")
 {
  var email = document.sell.email.value 
  var regexp=/[0-9,a-z,A-Z]+[0-9,a-z,A-Z,\.,\-,_]*@[0-9,a-z,A-Z]+[0-9,a-z,A-Z,\.,\-,_]*\.[0-9,a-z,A-Z]+[0-9,a-z,A-Z,\.,\-,_]*/g;
	var answerarray=email.match(regexp);
	if(answerarray==null)
	{
	alert("Please check your email address.");
	window.document.sell.email.focus();
	return false;	
	}
 }  
}//End check() function........


//===================================Function for Status======================================
function status2()
{
if (document.sell.status.value=="student")
	{	
		document.sell.status.disabled=false;
		document.sell.country.disabled=false; 
		document.sell.city.disabled=false;
		document.sell.college.disabled=false;
		document.sell.college.style.backgroundColor="#FFFFFF"
		document.sell.uni.disabled=false;
		document.sell.uni.style.backgroundColor="#FFFFFF"
		document.sell.cource.disabled=false;
		document.sell.cource.style.backgroundColor="#FFFFFF"
		document.sell.software.disabled=false;
		document.sell.hardware.disabled=false;
		document.sell.amt.disabled=false;
		document.sell.other.disabled=true;
		document.sell.other.style.backgroundColor="#D3D3D3"
		return false;	
	} 
else
{
		document.sell.college.disabled=true;
		document.sell.college.style.backgroundColor="#D3D3D3"
		document.sell.uni.disabled=true;
		document.sell.uni.style.backgroundColor="#D3D3D3"
		document.sell.cource.disabled=true;
		document.sell.cource.style.backgroundColor="#D3D3D3"
		document.sell.other.disabled=false;	
		document.sell.other.style.backgroundColor="#FFFFFF"

}
}
//---------------------------------------------
function domainfun()
{
if(document.sell.domain1.value!="Other")
{
document.sell.domainother.disabled=true;
document.sell.domainother.style.backgroundColor="#D3D3D3";
}
else
{
document.sell.domainother.value="";
document.sell.domainother.disabled=false;
document.sell.domainother.style.backgroundColor="#FFFFFF";
}
}
//--------------------------------------------
function techno()
{
if(document.sell.tech.value!="Other")
{
document.sell.othertechno.disabled=true;
document.sell.othertechno.style.backgroundColor="#D3D3D3";
}
else
{
document.sell.othertechno.value="";
document.sell.othertechno.disabled=false;
document.sell.othertechno.style.backgroundColor="#FFFFFF";
}

}
//==================================================page load============
function loadfirst()
{
//-------------------------------------------
if(document.sell.domain1.value!="Other")
{
document.sell.domainother.disabled=true;
document.sell.domainother.style.backgroundColor="#D3D3D3";
}
document.sell.othertechno.disabled=true;
document.sell.othertechno.style.backgroundColor="#D3D3D3";


if (document.sell.status.value=="student")
{
		document.sell.college.disabled=false;
		document.sell.college.style.backgroundColor="#FFFFFF";
		document.sell.uni.disabled=false;
		document.sell.uni.style.backgroundColor="#FFFFFF";
		document.sell.cource.disabled=false;
		document.sell.cource.style.backgroundColor="#FFFFFF";

}
else
{
		document.sell.college.disabled=true;
		document.sell.college.style.backgroundColor="#D3D3D3";
		document.sell.uni.disabled=true;
		document.sell.uni.style.backgroundColor="#D3D3D3";
		document.sell.cource.disabled=true;
		document.sell.cource.style.backgroundColor="#D3D3D3";

}
}

