


function mainflash()
{
var s1 = new SWFObject("swf/main_flash.swf","rotator","551","260","7");
		s1.addParam("allowfullscreen","true");
		s1.addVariable("file","xml/main_flash.xml&transition=blocks");
		s1.addVariable("width","551");
		s1.addVariable("height","260");
		s1.addVariable("shownavigation","false");
		s1.addVariable("WMode","Transparent");

		s1.write("midrighttab");

}

///////////////////////////////////////////////////////////////////


/********enquiry form********/


function checkenquiry_form()
{	
	docf=document.getElementById("form");
	if(docf.name.value=="")
	{
		alert("Enter your Name");
		docf.name.focus();
		return false;
	}

	if(docf.company.value=="")
	{
		alert("Enter your Company");
		docf.company.focus();
		return false;
	}
	
	if(docf.address.value=="")
	{
		alert("Enter your Address");
		docf.address.focus();
		return false;
	}

	if(docf.city.value=="")
	{
		alert("Enter your City");
		docf.city.focus();
		return false;
	}
	
if(docf.phone.value=="")
	{
		alert("Enter your Phone");
		docf.phone.focus();
		return false;
	}

	
	if(docf.email.value=="")
	{
		alert("Enter your Email Id");
		docf.email.focus();
		return false;
	}	




	if(docf.code_field.value=="")
	{
		alert("Enter the code");
		docf.code_field.focus();
		return false;	
	}
	return validate_form(docf);
	
}


function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}


function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}

////////////////////////////////////////////////////////////////////////////////////////

/********career form********/


function checkcareer_form()
{	
	docf=document.getElementById("form");
	if(docf.name.value=="")
	{
		alert("Enter your  Name");
		docf.name.focus();
		return false;
	}

	if(docf.fname.value=="")
	{
		alert("Enter your Father's Name");
		docf.fname.focus();
		return false;
	}

	if(docf.sex.value=='NA')
	{
		alert("Please enter your sex");
		docf.sex.focus();
		return false;
	}

if(docf.qualification.value=='')
	{
		alert("Please enter your qualification");
		docf.qualification.focus();
		return false;
	}

	
	if(docf.address.value=="")
	{
		alert("Enter your Address");
		docf.address.focus();
		return false;
	}
	
if(docf.phone.value=="")
	{
		alert("Enter your phone");
		docf.phone.focus();
		return false;
	}

	if(docf.resume.value=='')
	{
		alert("Please upload your Resume");
		docf.resume.focus();
		return false;
	}

	
	if(docf.email.value=="")
	{
		alert("Enter your Email Id");
		docf.email.focus();
		return false;
	}	




	if(docf.code_field.value=="")
	{
		alert("Enter the code");
		docf.code_field.focus();
		return false;	
	}
	return validate_form(docf);
	
}


function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}


function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}


/////////////////////////////////////////////////
function openDocument(tab_name,dir,control,auto_id){
var logowin=window.open("","logoWindow","Width=400, height=150");
logowin.document.open();
logowin.document.writeln('<html><head><title>Big Image Upload</title></head><body bgcolor=#9C9C9C><form name="upload" action="function/img_uploading.php" method="POST" ENCTYPE="multipart/form-data"> <input type=hidden name=returnURL value='+logowin.opener.location+'><input type="file" name="file" size="30" maxlength=200><input type="hidden" name="tab_name" value="'+tab_name+'"><input type="hidden" name="DIRECTORY" value="'+dir+'"><input type="hidden" name="control" value="'+control+'"><input type="hidden" name="auto_id" value="'+auto_id+'">	  <input type="submit" value="Upload!">    </form></body></html>');
}

///////////////////////////////////////////////////////
