// JavaScript Document

function trim(inputString)
{
   if (typeof inputString != "string") { return inputString; }
   
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   
   while (ch == " ")
   { // Check for spaces at the beginning of the stringdocument
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   
   ch = retValue.substring(retValue.length-1, retValue.length);
   
   while (ch == " ")
   { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   

   while (retValue.indexOf("  ") != -1)
   { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

function submit_support_inquiry()
{
try
    {    //Run some code here
    var objfrmSupportInquiry=document.getElementById('frmSupportInquiry');
//var objfrmSupportInquiry=frmSupportInquiry;
//    if(objfrmSupportInquiry==null || objfrmSupportInquiry== undefined){objfrmSupportInquiry=document.frmSupportInquiry; }
    
	if (trim(objfrmSupportInquiry.name.value) =='')
	{
		alert('Please register a Name in order to submit the form');
	}
	else if (trim(objfrmSupportInquiry.organization.value) == '')
	{
		alert('Please enter your Company Name or Organization');
	}
	else if (trim(objfrmSupportInquiry.tel.value) == '')
	{
		alert('Please enter your Phone Number (Landline or Mobile) where you can be contacted');
	}
	else if (trim(objfrmSupportInquiry.city.value) == '')
	{
		alert('Please provide the City you stay in');
	}
	else if (trim(objfrmSupportInquiry.email.value) == '')
	{
		alert('Please enter your Email Address where we can contact you');
	}
	else if (trim(objfrmSupportInquiry.Software.value) == '')
	{
		alert('Please select the Software that you were using');
	}
	else if (trim(objfrmSupportInquiry.Software_Version.value) == '')
	{
		alert('Please enter the Software Version that you were using');
	}
	else if (trim(objfrmSupportInquiry.OS.value) == '')
	{
		alert('Please enter the Operating System where your Software is deployed');
	}
	else if (trim(objfrmSupportInquiry.OS_Version.value) == '')
	{
		alert('Please enter the Operating System version/service pack/build');
	}
	else if (trim(objfrmSupportInquiry.Problem_Description.value) == '')
	{
		alert('Please enter the error message,problem, scenario or events that lead to the problem');
	}
	else 
	{
		var strEmailAddTemp;
		strEmailAddTemp = objfrmSupportInquiry.email.value;
		if (strEmailAddTemp.indexOf("@") < 0 || strEmailAddTemp.indexOf(".") < 0)
		{
			alert('Invalid Email Address, please enter a valid email address');
		}
		else
		{
			objfrmSupportInquiry.action = 'http://www.gistec.com/gisworx/send_email_form.php';
			//transforming_reg_form.action = '../send_email_form.php';
	try{	
	objfrmSupportInquiry.submit();	
			}catch(errSend)
    {
        objfrmSupportInquiry.action = 'http://gistec.com/gisworx/send_email_form.php';
    }
    
			
		}
	}
	}catch(err)
    {
        alert(err.description);
    }
}

//function myAlert(myTitle, mytext){
//  html = "<html><head><title>" + myTitle +"</title></head>"
//  +"<body bgcolor=thistle>" +mytext +"</body></html>"
//  args = "width=200,height=100"
//  nw = window.open('',"myAlert",args)
//  nw.write(html)
//  alert("This is standard alert box:\n"+ html)
//}

function submit_events_inquiry()
{
try{
//myAlert('My Title', 'My Message');
var objfrmEventsInquiry=document.getElementById('frmEventsInquiry');
//var objfrmEventsInquiry=frmEventsInquiry;
//    if(objfrmEventsInquiry==null || objfrmEventsInquiry== undefined){objfrmEventsInquiry=document.frmEventsInquiry; }
    
	
	if (trim(objfrmEventsInquiry.name.value) =='')
	{
		alert('Please register a Name in order to submit the form');
	}
	else if (trim(objfrmEventsInquiry.organization.value) == '')
	{
		alert('Please enter your Company Name or Organization');
	}
	else if (trim(objfrmEventsInquiry.tel.value) == '')
	{
		alert('Please enter your Phone Number (Landline or Mobile) where you can be contacted');
	}
	else if (trim(objfrmEventsInquiry.email.value) == '')
	{
		alert('Please enter your Email Address where we can contact you');
	}
	else if (trim(objfrmEventsInquiry.feedback.value) == '')
	{
		alert('Please describe the event inquiry');
	}
	else 
	{
		var strEmailAddTemp;
		strEmailAddTemp = objfrmEventsInquiry.email.value;
		if (strEmailAddTemp.indexOf("@") < 0 || strEmailAddTemp.indexOf(".") < 0)
		{
			alert('Invalid Email Address, please enter a valid email address');
		}
		else
		{
			objfrmEventsInquiry.action = 'http://www.gistec.com/gisworx/send_email_form.php';
			//transforming_reg_form.action = '../send_email_form.php';
			//alert('Sending email');
			try{	
	objfrmEventsInquiry.submit();	
			}catch(errSend)
    {
        objfrmEventsInquiry.action = 'http://gistec.com/gisworx/send_email_form.php';
    }
		}
	}
	}catch(err)
    {
        alert(err.description);
    }
}

function submit_sales_inquiry()
{
try{
var objSalesInquiry=document.getElementById('frmSalesInquiry');
//var objSalesInquiry=SalesInquiry;
//    if(objSalesInquiry==null || objSalesInquiry== undefined){objSalesInquiry=document.SalesInquiry; }
    
	if (trim(objSalesInquiry.name.value) =='')
	{
		alert('Please register a Name in order to submit the form');
	}
	else if (trim(objSalesInquiry.organization.value) == '')
	{
		alert('Please enter your Company Name or Organization');
	}
	else if (trim(objSalesInquiry.tel.value) == '')
	{
		alert('Please enter your Phone Number (Landline or Mobile) where you can be contacted');
	}
	else if (trim(objSalesInquiry.email.value) == '')
	{
		alert('Please enter your Email Address where we can contact you');
	}
	else if (trim(objSalesInquiry.feedback.value) == '')
	{
		alert('Please describe the event inquiry');
	}
	else 
	{
		var strEmailAddTemp;
		strEmailAddTemp = objSalesInquiry.email.value;
		if (strEmailAddTemp.indexOf("@") < 0 || strEmailAddTemp.indexOf(".") < 0)
		{
			alert('Invalid Email Address, please enter a valid email address');
		}
		else
		{
			objSalesInquiry.action = 'http://www.gistec.com/gisworx/send_email_form.php';
			//transforming_reg_form.action = '../send_email_form.php';
			//alert('Sending email');
			try{	
	objSalesInquiry.submit();	
			}catch(errSend)
    {
        objSalesInquiry.action = 'http://gistec.com/gisworx/send_email_form.php';
    }
		}
	}
	}catch(err)
    {
        alert(err.description);
    }
}

function submit_services_inquiry()
{
try{
var objfrmServiceEnquiry=document.getElementById('frmServiceEnquiry');
//var objfrmServiceEnquiry=frmServiceEnquiry;
//    if(objfrmServiceEnquiry==null || objfrmServiceEnquiry== undefined){objfrmServiceEnquiry=document.frmServiceEnquiry; }
//    
	if (trim(objfrmServiceEnquiry.name.value) =='')
	{
		alert('Please register a Name in order to submit the form');
	}
	else if (trim(objfrmServiceEnquiry.organization.value) == '')
	{
		alert('Please enter your Company Name or Organization');
	}
	else if (trim(objfrmServiceEnquiry.tel.value) == '')
	{
		alert('Please enter your Phone Number (Landline or Mobile) where you can be contacted');
	}
	else if (trim(objfrmServiceEnquiry.email.value) == '')
	{
		alert('Please enter your Email Address where we can contact you');
	}
	else if (trim(objfrmServiceEnquiry.feedback.value) == '')
	{
		alert('Please describe the event inquiry');
	}
	else 
	{
		var strEmailAddTemp;
		strEmailAddTemp = objfrmServiceEnquiry.email.value;
		if (strEmailAddTemp.indexOf("@") < 0 || strEmailAddTemp.indexOf(".") < 0)
		{
			alert('Invalid Email Address, please enter a valid email address');
		}
		else
		{
			objfrmServiceEnquiry.action = 'http://www.gistec.com/gisworx/send_email_form.php';
			//transforming_reg_form.action = '../send_email_form.php';
			//alert('Sending email');
			try{	
	objfrmServiceEnquiry.submit();	
			}catch(errSend)
    {
        objfrmServiceEnquiry.action = 'http://gistec.com/gisworx/send_email_form.php';
    }
		}
	}
	}catch(err)
    {
        alert(err.description);
    }
}


function submit_survey_inquiry()
{
	try
    {
    var objfrmSurveyEnquiry=document.getElementById('frmSurveyEnquiry');
//    var objfrmSurveyEnquiry=frmSurveyEnquiry;
//    if(objfrmSurveyEnquiry==null || objfrmSurveyEnquiry== undefined){objfrmSurveyEnquiry=document.frmSurveyEnquiry; }
    
	    if (trim(objfrmSurveyEnquiry.realname.value) =='')
	    {
		    alert('Please register a Name in order to submit the form');
	    }
	    else if (trim(objfrmSurveyEnquiry.company.value) == '')
	    {
		    alert('Please enter your Company Name or Organization');
	    }
	    else if (trim(objfrmSurveyEnquiry.tel.value) == '')
	    {
		    alert('Please enter your Phone Number (Landline or Mobile) where you can be contacted');
	    }
	    else if (trim(objfrmSurveyEnquiry.email.value) == '')
	    {
		    alert('Please enter your Email Address where we can contact you');
	    }
    //	else if (trim(objfrmSurveyEnquiry.feedback.value) == '')
    //	{
    //		alert('Please describe the event inquiry');
    //	}
	    else 
	    {
		    var strEmailAddTemp;
		    strEmailAddTemp = objfrmSurveyEnquiry.email.value;
		    if (strEmailAddTemp.indexOf("@") < 0 || strEmailAddTemp.indexOf(".") < 0)
		    {
			    alert('Invalid Email Address, please enter a valid email address');
		    }
		    else
		    {
			    objfrmSurveyEnquiry.action = 'http://www.gistec.com/gisworx/send_email_form.php';
			    //transforming_reg_form.action = '../send_email_form.php';
			    //alert('Sending email');
			    try{	
	objfrmSurveyEnquiry.submit();	
			}catch(errSend)
    {
        objfrmSurveyEnquiry.action = 'http://gistec.com/gisworx/send_email_form.php';
    }
		    }
	    }
	    //Run some code here
    }catch(err)
    {
        alert(err.description);
    }
}

function IsValidMaximumProducts(Quantity,MaxAllowed)
   //  check for valid numeric strings	
   { try
    {
   var NumericQuantity=Quantity;
   if(NumericQuantity>MaxAllowed){return false;}else{return true;}
   }catch(err)
    {
         alert(err.description);//alert(err.description);
    }
	}
   
function IsNumeric(strString)
   //  check for valid numeric strings	
   {
	   try
    {
   var strValidChars = "0123456789";//.-
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }catch(err)
    {
         alert(err.description);//alert(err.description);
    }
	}

//function CalculatePrice(Product,Quantity)
//   //  check for valid numeric strings	
//   {
//   
//    var ProductnPrice = 'arcinfo 95900.00 79920.00 79920.00 69260.00 arceditor 62700.00 50610.00 43320.00 37740.00 arcview_cu 22200.00 20980.00 19180.00 17980.00 arcview_su 13440.00 11610.00 11610.00 10885.00 arcgisext 16650.00 13440.00 13440.00 11990.00';
//    //1	2	3-5	6-10
//    
//    var NumericQuantity=Quantity;
//    
//    if ( NumericQuantity==1)
//	{
//		NumericQuantity=1;
//	}
//	else if ( NumericQuantity==2)
//	{
//		NumericQuantity=2;
//	}
//	else if (NumericQuantity<6)
//	{
//	NumericQuantity=3;
//	}
//	else
//	{
//	NumericQuantity=4;
//	}
//	
//    var ProductnPriceArr = new Array();
//    ProductnPriceArr = ProductnPrice.split(' ');


//    for (i = 0; i < ProductnPriceArr.length; i++)
//        if (ProductnPriceArr[i]==Product) {
//            return ProductnPriceArr[i+NumericQuantity];
//        }
//    }

//function Testing()
//{
//try
//    {
//    var jhk;
//    
//    }catch(err)
//    {
//        alert(err.description);//alert(err.description);
//    }
//    }
   
   function submit_quote_inquiry()
{
try

    {
     var objfrmQuoteInquiry=document.getElementById('frmQuoteInquiry');
//    var objfrmQuoteInquiry=frmQuoteInquiry;
//    if(objfrmQuoteInquiry==null || objfrmQuoteInquiry== undefined){objfrmQuoteInquiry=document.frmQuoteInquiry; }
    
        if (trim(objfrmQuoteInquiry.cname.value) =='')
	{
		alert('Please enter your Name in order to submit the form');
	}
	else if (trim(objfrmQuoteInquiry.organization.value) == '')
	{
		alert('Please enter your Company Name or Organization');
	}
	else if (trim(objfrmQuoteInquiry.telephone.value) == '' && trim(objfrmQuoteInquiry.mobile.value) == '')
	{
		alert('Please enter your Phone Number (Landline or Mobile) where you can be contacted');
	}
	else if (trim(objfrmQuoteInquiry.city.value) == '')
	{
		alert('Please provide the City you stay in');
	}
	else if (trim(objfrmQuoteInquiry.email.value) == '')
	{
		alert('Please enter your Email Address where we can contact you');
	}
    else if (trim(objfrmQuoteInquiry.enduser_name.value) == '')
	{
		alert('Please enter the name of organization using the Software');
	}
	else if (trim(objfrmQuoteInquiry.agreement.checked) == false)
	{
		alert('Please accept the terms and conditions to get the price quotes');
	}
		else if (objfrmQuoteInquiry.arcinfo.checked == false && objfrmQuoteInquiry.arceditor.checked == false && objfrmQuoteInquiry.arcview_cu.checked == false && objfrmQuoteInquiry.arcview_su.checked == false && objfrmQuoteInquiry.dnalyst.checked == false && objfrmQuoteInquiry.arcgispublisher.checked == false && objfrmQuoteInquiry.arcscanforarcgis.checked == false && objfrmQuoteInquiry.datainteroperability.checked == false && objfrmQuoteInquiry.geostatisticalanalyst.checked == false && objfrmQuoteInquiry.maplexforarcgis.checked == false && objfrmQuoteInquiry.networkanalyst.checked == false && objfrmQuoteInquiry.schematics.checked == false && objfrmQuoteInquiry.spatialanalyst.checked == false && objfrmQuoteInquiry.surveyanalyst.checked == false && objfrmQuoteInquiry.trackinganalyst.checked == false)
	{
		alert('Please Select atleast one Product or Extension for License');
	}
	else 
	{
		var strEmailAddTemp;
		strEmailAddTemp = objfrmQuoteInquiry.email.value;
		if (strEmailAddTemp.indexOf("@") < 0 || strEmailAddTemp.indexOf(".") < 0)
		{
			alert('Invalid Email Address, please enter a valid email address');
		}
		else
		{
		var MaxAllowed=10;
		if (objfrmQuoteInquiry.arcinfo.checked == true){if (IsNumeric(objfrmQuoteInquiry.arcinfo_qty.value)==false){alert('Product ArcInfo Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.arcinfo_qty.value==0){alert('Product ArcInfo Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.arcinfo_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' products for ArcInfo');return;}}
	    if (objfrmQuoteInquiry.arceditor.checked == true){if (IsNumeric(objfrmQuoteInquiry.arceditor_qty.value)==false){alert('Product ArcEditor Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.arceditor_qty.value==0){alert('Product ArcEditor Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.arceditor_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' products for ArcEditor');return;}}
	    if (objfrmQuoteInquiry.arcview_cu.checked == true){if (IsNumeric(objfrmQuoteInquiry.arcview_cu_qty.value)==false){alert('Product ArcView Concurrent Use Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.arcview_cu_qty.value==0){alert('Product ArcView Concurrent Use Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.arcview_cu_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' products for ArcView Concurrent Use');return;}}
	    if (objfrmQuoteInquiry.arcview_su.checked == true){if (IsNumeric(objfrmQuoteInquiry.arcview_su_qty.value)==false){alert('Product ArcView Single Use Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.arcview_su_qty.value==0){alert('Product ArcView Single Use Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.arcview_su_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' products for ArcView Single Use');return;}}

        if (objfrmQuoteInquiry.dnalyst.checked == true){if (IsNumeric(objfrmQuoteInquiry.dnalyst_qty.value)==false){alert('Extension 3D Analyst Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.dnalyst_qty.value==0){alert('Extension 3D Analyst Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.dnalyst_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for 3D Analyst');return;}}
        if (objfrmQuoteInquiry.arcgispublisher.checked == true){if (IsNumeric(objfrmQuoteInquiry.arcgispublisher_qty.value)==false){alert('Extension Arcgis Publisher Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.arcgispublisher_qty.value==0){alert('Extension Arcgis Publisher Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.arcgispublisher_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Arcgis Publisher');return;}}
        if (objfrmQuoteInquiry.arcscanforarcgis.checked == true){if (IsNumeric(objfrmQuoteInquiry.arcscanforarcgis_qty.value)==false){alert('Extension ArcScan for Arcgis Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.arcscanforarcgis_qty.value==0){alert('Extension ArcScan for Arcgis Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.arcscanforarcgis_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for ArcScan for Arcgis');return;}}
        if (objfrmQuoteInquiry.datainteroperability.checked == true){if (IsNumeric(objfrmQuoteInquiry.datainteroperability_qty.value)==false){alert('Extension Data Interoperability Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.datainteroperability_qty.value==0){alert('Extension Data Interoperability Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.datainteroperability_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Data Interoperability');return;}}
        if (objfrmQuoteInquiry.geostatisticalanalyst.checked == true){if (IsNumeric(objfrmQuoteInquiry.geostatisticalanalyst_qty.value)==false){alert('Extension Geo Statistic Alanalyst Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.geostatisticalanalyst_qty.value==0){alert('Extension Geo Statistic Alanalyst Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.geostatisticalanalyst_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Geo Statistic Alanalyst');return;}}
        if (objfrmQuoteInquiry.maplexforarcgis.checked == true){if (IsNumeric(objfrmQuoteInquiry.maplexforarcgis_qty.value)==false){alert('Extension Maplex for Arcgis Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.maplexforarcgis_qty.value==0){alert('Extension Maplex for Arcgis Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.maplexforarcgis_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Maplex for Arcgis');return;}}
        if (objfrmQuoteInquiry.networkanalyst.checked == true){if (IsNumeric(objfrmQuoteInquiry.networkanalyst_qty.value)==false){alert('Extension Network Analyst Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.networkanalyst_qty.value==0){alert('Extension Network Analyst Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.networkanalyst_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Network Analyst');return;}}
        if (objfrmQuoteInquiry.schematics.checked == true){if (IsNumeric(objfrmQuoteInquiry.schematics_qty.value)==false){alert('Extension Schematics Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.schematics_qty.value==0){alert('Extension Schematics Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.schematics_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Schematics');return;}}
        if (objfrmQuoteInquiry.spatialanalyst.checked == true){if (IsNumeric(objfrmQuoteInquiry.spatialanalyst_qty.value)==false){alert('Extension Spatial Analyst Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.spatialanalyst_qty.value==0){alert('Extension Spatial Analyst Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.spatialanalyst_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Spatial Analyst');return;}}
        if (objfrmQuoteInquiry.surveyanalyst.checked == true){if (IsNumeric(objfrmQuoteInquiry.surveyanalyst_qty.value)==false){alert('Extension Survey Analyst Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.surveyanalyst_qty.value==0){alert('Extension Survey Analyst Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.surveyanalyst_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Survey Analyst');return;}}
        if (objfrmQuoteInquiry.trackinganalyst.checked == true){if (IsNumeric(objfrmQuoteInquiry.trackinganalyst_qty.value)==false){alert('Extension Tracking Analyst Quantity must be Numeric');return;}else if(objfrmQuoteInquiry.trackinganalyst_qty.value==0){alert('Extension Tracking Analyst Quantity must be greater than Zero');return;}if(! IsValidMaximumProducts(objfrmQuoteInquiry.trackinganalyst_qty.value,MaxAllowed)){alert('Please contact Gistec for ordering more than ' + MaxAllowed + ' Extensions for Tracking Analyst');return;}}
        
        //dnalyst_qty arcgispublisher_qty arcscanforarcgis_qty datainteroperability_qty geostatisticalanalyst_qty maplexforarcgis_qty networkanalyst_qty schematics_qty spatialanalyst_qty surveyanalyst_qty trackinganalyst_qty
        //dnalyst arcgispublisher arcscanforarcgis datainteroperability geostatisticalanalyst maplexforarcgis networkanalyst schematics spatialanalyst surveyanalyst trackinganalyst

        //var PriceArcInfo=CalculatePrice(objfrmQuoteInquiry.arcinfo.id,objfrmQuoteInquiry.arcinfo_qty.value);
	    //objfrmQuoteInquiry.action = 'http://www.gistec.com/gisworx/send_email_form.php';
		//alert('Sending email');
    	//alert(objForm);
			try{	
	objfrmQuoteInquiry.submit();	
			}catch(errSend)
    {
        objfrmQuoteInquiry.action = 'http://gistec.com/gisworx/send_email_form.php';
    }
		}
	}
			
	
	}catch(err)
    {
        alert(err.description);//alert(err.description);
    }
}


function submit_geocortex_inquiry()
{
try{
var objfrmGeoInquiry=document.getElementById('frmGeoInquiry');
//    var objfrmGeoInquiry=frmGeoInquiry;
//    if(objfrmGeoInquiry==null || objfrmGeoInquiry== undefined){objfrmGeoInquiry=document.frmGeoInquiry; }
    
	if (trim(objfrmGeoInquiry.name.value) =='')
	{
		alert('Please register a Name in order to submit the form');
	}
	else if (trim(objfrmGeoInquiry.organization.value) == '')
	{
		alert('Please enter your Company Name or Organization');
	}
	else if (trim(objfrmGeoInquiry.tel.value) == '')
	{
		alert('Please enter your Phone Number (Landline or Mobile) where you can be contacted');
	}
	else if (trim(objfrmGeoInquiry.email.value) == '')
	{
		alert('Please enter your Email Address where we can contact you');
	}
	else if (trim(objfrmGeoInquiry.feedback.value) == '')
	{
		alert('Please describe the event inquiry');
	}
	else 
	{
		var strEmailAddTemp;
		strEmailAddTemp = objfrmGeoInquiry.email.value;
		if (strEmailAddTemp.indexOf("@") < 0 || strEmailAddTemp.indexOf(".") < 0)
		{
			alert('Invalid Email Address, please enter a valid email address');
		}
		else
		{
			objfrmGeoInquiry.action = 'http://www.gistec.com/gisworx/send_email_form.php';
			//transforming_reg_form.action = '../send_email_form.php';
			//alert('Sending email');
			try{	
	objfrmGeoInquiry.submit();	
			}catch(errSend)
    {
        objfrmGeoInquiry.action = 'http://gistec.com/gisworx/send_email_form.php';
    }
		}
	}
	}catch(err)
    {
        alert(err.description);//alert(err.description);
    }
}

function submit_frmReseller()//submit_support_inquiry
{
    try{
    var objfrmReseller=document.getElementById('frmReseller');
//        var objfrmReseller=frmReseller;
//    if(objfrmReseller==null || objfrmReseller== undefined){alert(document.frmReseller);objfrmReseller=document.frmReseller; }
    
    if (trim(objfrmReseller.name.value) =='')
	{
		alert('Please register a First Name in order to submit the form');
	}
	else if (trim(objfrmReseller.lastname.value) == '')
	{
		alert('Please register a Last Name in order to submit the form');
	}
	else if (trim(objfrmReseller.jobtitle.value) == '')
	{
		alert('Please enter your Job Title');
	}
	else if (trim(objfrmReseller.tel.value) == '')
	{
		alert('Please enter your Phone Number (Landline or Mobile) where you can be contacted');
	}
	else if (trim(objfrmReseller.email.value) == '')
	{
		alert('Please enter your Email Address where we can contact you');
	}
	
	else if (trim(objfrmReseller.organization.value) == '')
	{
		alert('Please enter your Company Name or Organization');
	}
	else if (trim(objfrmReseller.companyaddress.value) == '')
	{
		alert('Please enter your Company Address');
	}
	else if (trim(objfrmReseller.city.value) == '')
	{
		alert('Please provide the City of your Company');
	}
	else if (trim(objfrmReseller.companyoverview.value) == '')
	{
		alert('Please provide Your Company Profile');
	}
	else 
	{
		var strEmailAddTemp;
		strEmailAddTemp = objfrmReseller.email.value;
		if (strEmailAddTemp.indexOf("@") < 0 || strEmailAddTemp.indexOf(".") < 0)
		{
			alert('Invalid Email Address, please enter a valid email address');
		}
		else
		{
			objfrmReseller.action = 'http://www.gistec.com/gisworx/send_email_form.php';
try{	
	objfrmReseller.submit();	
			}catch(errSend)
    {
        objfrmReseller.action = 'http://gistec.com/gisworx/send_email_form.php';
    }
		}
	}
    
    }catch(err)
        {
            alert(err.description);//alert(err.description);
        }
}
