var jsWidth = '' + '';
var jsHeight = '' + '';
if (jsWidth != '' && jsHeight != ''){
if (navigator.userAgent.indexOf('MSIE') != -1) {
top.resizeTo(parseInt(jsWidth),parseInt(jsHeight));
}
else if (navigator.appName.indexOf('Netscape') != -1) {
top.outerWidth=parseInt(jsWidth);
top.outerHeight=parseInt(jsHeight);
}
}
<!--
function changeval(what,str,k)
 {
  var strmain = '';
  var strdd = '';
  var strmm = '';
  var stryy= '';
  if (k==0)
  {
   strmain='F'+str;
   strdd = 'dd'+str;
   strmm = 'mm'+str;
   stryy = 'yy'+str;   
  }
  else
  {
   strmain='*F'+str;
   strdd = '*dd'+str;
   strmm = '*mm'+str;
   stryy = '*yy'+str;
  }
    selected1 = what.elements[''+strmm].selectedIndex;
    if(selected1==-1)
 value1='';
 else
 value1 = what.elements[''+strmm].options[selected1].value;
    selected2 = what.elements[''+strdd].selectedIndex;
 if(selected2==-1)
  value2='';
 else
    value2 = what.elements[''+strdd].options[selected2].value;
    selected3 = what.elements[''+stryy].selectedIndex;
 if(selected3==-1)
  value3='';
 else
    value3 = what.elements[''+stryy].options[selected3].value;
 what.elements[''+strmain].value = value1 + '/' +value2 + '/' +value3+'';
}
  var radioarray = new Array();
 //Make sure all required fields are entered
 function CheckRequiredFields() {
  var elementname;
  var elementvalue;
  var elementtype;
  var emailvalue;
  var emailagainvalue;
  var nochecked=0;
  //Loop through all elements on the page
  for (var i=0; i < document.forms[0].elements.length; i++) {
   elementtype = document.forms[0].elements[i].type;
   
   //If the first position of the element name equals "*"
   elementname = document.forms[0].elements[i].name;
 
   //Save the value of the email field
   if (elementname == '*email') {
    emailvalue = document.forms[0].elements[i].value;
   }
   //Save the value of the email again field
   if (elementname == '*emailagain') {
    emailagainvalue = document.forms[0].elements[i].value;
   }
   //If this is a required field
   if (elementname.substr(0,1) == '*') {
   elementvalue = document.forms[0].elements[i].value;
     if (elementtype.indexOf('radio') > -1) 
     {
      addarray(elementname);
               if (document.forms[0].elements[i].checked) 
      {
      nochecked++;
      }
           }
     
           if (elementtype.indexOf('select') > -1)
              if (document.forms[0].elements[i].selectedIndex == 0) 
     {
      if((elementname.indexOf('*dd')>-1)||(elementname.indexOf('*mm')>-1)||(elementname.indexOf('*yy')>-1))
      {
       if(trim(elementvalue)=="0"||trim(elementvalue)=="00")
       { 
         alert('Invalid Date. Please try again');
         return false;
       }
      }
      if((trim(elementvalue)==" ") || (elementvalue.indexOf('Select') > -1))
      {
      alert('All required fields have not been entered.');
      return false;
      }
     }
    
        
        
    //If the value is empty
    if (elementvalue.length == 0 || trim(elementvalue) == " ") {
     alert('All required fields have not been entered.');
     return false;
    }
   }
  }
  
//    if (radioButtons && !radioChecked)
 if(radioarray.length!=nochecked)
 {
     alert('All required fields have not been entered.');
     return false;
 
 }

  if (emailvalue != emailagainvalue) {
   alert('Your email address must be entered the same way twice.');
   return false;
  }
  return true;
 }
function addarray(elementname){
var flag=0;
for (var i=0;i<radioarray.length;i++)
{
 if(radioarray[i]==elementname)
 flag = 1;
}
if(flag==0)
radioarray[radioarray.length] = elementname;
}
 /// This checks the string passed in as a domain name and requires that it
 ///   either end in one of the '.com' style endings or ends with '.cc' where the
 ///   'cc' represents two alphabetic characters of a country code domain.
 ///   I don't actually check for a valid country code, only for the proper form.
 /// This function needs JS1.2 and does not work in Opera3.5
 function isStandardDomain(domainIn) {
  /// The value to return, start out assuming invalid domain.
  var isStandardReturn = false;
  /// Change as on 06-17-2008 by JAIDEEP as requested by josh
  /// Add last5chars for Validation of email address of '.info' also
  /// Holds the last 5 characters of domain name.
  var last5chars  =  domainIn.substring( domainIn.length-5, domainIn.length );
  /// Holds the last 4 characters of domain name.
  var last4chars  =  domainIn.substring( domainIn.length-4, domainIn.length );
  /// Holds the last 3 characters of domain name.
  var last3chars  =  domainIn.substring( domainIn.length-3, domainIn.length );
  /// Change as on 06-17-2008 by JAIDEEP as requested by josh
  /// Add last5chars for Validation of email address of '.info' also
  /// Uppercase it for comparison purposes.
  last4chars = last4chars.toUpperCase();
  last5chars = last5chars.toUpperCase();
  /// A regular expression pattern to match country code domains.
  ///  In otherwords a Dot character followed by two alphabetic characters.
  /// NOTE:  This line doesn't work at all in Opera3.5 and prevents the
  ///  entire script from running!!!  BUMMER!!!
  ///  It also seems to not work in Opera4.02 but only prevents
  ///  the 2 letter codes from working but doesn't crash the script.
  var countryCodePattern = /\.[a-zA-Z][a-zA-Z]/;
  if      ( last4chars == ".COM" ) isStandardReturn = true;
  else if ( last4chars == ".EDU" ) isStandardReturn = true;
  else if ( last4chars == ".GOV" ) isStandardReturn = true;
  else if ( last4chars == ".NET" ) isStandardReturn = true;
  else if ( last4chars == ".MIL" ) isStandardReturn = true;
  else if ( last4chars == ".ORG" ) isStandardReturn = true;
  else if ( last4chars == ".BIZ" ) isStandardReturn = true;
  else if ( last5chars == ".INFO" ) isStandardReturn = true;
  else if ( last3chars.search( countryCodePattern )   !=  -1 )
  isStandardReturn = true;
  return  isStandardReturn;
 } // Ends isStandardDomain(domainIn)

 /// Checks basic validity of an email address that's passed in.
 ///  Requires proper configuration of the '@' character lack of Spaces
 ///  and calls function "isStandardDomain()" to check on the form of the
 ///  domain name part.
 /// Used an alert box to display it's answer.
 /// This function needs JS1.2 [because isStandardDomain() does] and does not work in Opera3.5.
 function  validateEmailAddress(objName) {
  var emailIn;
  emailIn = objName.value;
  /// Number of '@' chars present in input string.
  var numAtChars;
  /// The part of input address before the '@' character.
  var userNameIn;
  /// The part of input address after the '@' character.
  var domainNameIn;
  /// Holds the fields of the entered address, delimitted by '@' chars.
  var addressFields = new Array();
  // Concatenate all alert output to here.
  var alertString = "";
  /// Divide the input email address into fields.
  ///  Note that the array "addressFields" will have one more element
  ///  than the number of '@' signs in the input string.
  /// IE4 handles this OK with '@' as last character but NS4,4.5 and Opera 3.5 don't.
  addressFields = emailIn.split('@');
  numAtChars = addressFields.length - 1;
  alertString += "Email Address ";
  if ( emailIn == "" )
   alertString += "must be entered.";
  else if ( numAtChars  ==  0 )
   alertString += "contains no '@' character and is therefore Not a valid Email Address.";
  else if ( numAtChars  >  1 )
   alertString += "contains " + numAtChars + " '@' characters and is therefore Not a valid Email Address.";
  else if ( addressFields[0] == "" )
   alertString += "has no Username before the '@' character and is therefore Not a valid Email Address.";
  else if ( addressFields[1] == "" )
   alertString += "has no Domain Name after the '@' character and is therefore Not a valid Email Address.";
  else {
   userNameIn   = addressFields[0];
   domainNameIn = addressFields[1];
   if ( userNameIn.indexOf( " " ) != -1 )
    alertString += "has one or more Spaces in the Username before the '@' character and is therefore Not a valid Email Address.";
   else if ( domainNameIn.indexOf( " " ) != -1 )
    alertString += "has one or more Spaces in the Domain Name after the '@' character and is therefore Not a valid Email Address.";
   else if ( isStandardDomain( domainNameIn ) == false )
    alertString += "does not end with a '.com' style domain or two letter country code domain and is therefore Not a valid Email Address.";
   else
    alertString = "";
  } // Ends else from outer string of if-then-else's.
  // Post the alert box.
  if (alertString.length > 0) {
   alert(alertString);
   objName.focus();
   return false;
  }
  return true;
 } // Ends validateEmailAddress(objName)
 function isEmpty(objName) {
  var field;
  var fieldvalue;
  field = objName;
  fieldvalue = field.value;
  if (fieldvalue.length == 0) {
   alert("This is a required field.");
   objName.focus();
  }
 }
 function checkdate(objName) 
 {
  var datefield = objName;
  if (chkdate(objName) == false) 
  {
   document.forms[0].elements[datefield].select();
   alert("The date is invalid.  Please try again.");
   
   return false;
  }
  else 
  {
   return true;
  }
 }
 //Validate a date field
 function chkdate(objName) 
 {
  
  var strDatestyle = "US"; //United States date style
  //var strDatestyle = "EU";  //European date style
  var strDate;
  var strDateArray;
  var strDay;
  var strMonth;
  var strYear;
  var intday;
  var intMonth;
  var intYear;
  var booFound = false;
  var datefield = objName;
  var strSeparatorArray = new Array("-"," ","/",".");
  var intElementNr;
  var err = 0;
  var strMonthArray = new Array(12);
  strMonthArray[0] = "Jan";
  strMonthArray[1] = "Feb";
  strMonthArray[2] = "Mar";
  strMonthArray[3] = "Apr";
  strMonthArray[4] = "May";
  strMonthArray[5] = "Jun";
  strMonthArray[6] = "Jul";
  strMonthArray[7] = "Aug";
  strMonthArray[8] = "Sep";
  strMonthArray[9] = "Oct";
  strMonthArray[10] = "Nov";
  strMonthArray[11] = "Dec";
  strDate = document.forms[0].elements[datefield].value;
  //If the date field is empty, return without validating
  if (strDate.length < 1) 
  {
   return true;
  }
  //Retrieve the month, day and year portions of the date
  for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) 
  {
   if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) 
   {
    strDateArray = strDate.split(strSeparatorArray[intElementNr]);
    if (strDateArray.length != 3) 
    {
     err = 1;
     return false;
    }
    else 
    {
     strDay = strDateArray[0];
     strMonth = strDateArray[1];
     strYear = strDateArray[2];
    }
    booFound = true;
   }
  }
  if (booFound == false) 
  {
   if (strDate.length > 5) 
   {
    strDay = strDate.substr(0, 2);
    strMonth = strDate.substr(2, 2);
    strYear = strDate.substr(4);
   }
   else
    return false;
  }
  //If year is only 2 positions long, then prefix with "20"
  if (strYear.length == 2) 
  {
   strYear = '20' + strYear;
  }
  // US style
  if (strDatestyle == "US") 
  {
   strTemp = strDay;
   strDay = strMonth;
   strMonth = strTemp;
  }
  intday = parseInt(strDay, 10);
  if (isNaN(intday)) 
  {
   err = 2;
   return false;
  }
  intMonth = parseInt(strMonth, 10);
  if (isNaN(intMonth)) 
  {
   for (i = 0;i<12;i++) 
   {
    if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) 
    {
     intMonth = i+1;
     strMonth = strMonthArray[i];
     i = 12;
    }
   }
   if (isNaN(intMonth)) 
   {
    err = 3;
    return false;
   }
  }
  intYear = parseInt(strYear, 10);
  if (isNaN(intYear)) 
  {
   err = 4;
   return false;
  }
  if (intMonth>12 || intMonth<1) 
  {
   err = 5;
   return false;
  }
  if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) 
  {
   err = 6;
   return false;
  }
  if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) 
  {
   err = 7;
   return false;
  }
  if (intMonth == 2) 
  {
   if (intday < 1) 
   {
    err = 8;
    return false;
   }
   if (LeapYear(intYear) == true) 
   {
    if (intday > 29) 
    {
     err = 9;
     return false;
    }
   }
   else 
   {
    if (intday > 28) 
    {
     err = 10;
     return false;
    }
   }
  }
  return true;
 }
 //Determine if year is a leap year
 function LeapYear(intYear) {
  if (intYear % 100 == 0) {
   if (intYear % 400 == 0) { return true; }
  }
  else {
   if ((intYear % 4) == 0) { return true; }
  }
  return false;
 }
 function trim(stringToTest)
 {
     var kk
     var subStart
     var subEnd
   if (stringToTest == null)
     return (" ")
   if (stringToTest.length == 0)
        return (" ")

     subStart = (-1)
     for (kk=0;kk<stringToTest.length;kk++)
     {
         if (stringToTest.charAt(kk) > " ")
         {
           subStart = kk
           break;
         }
     }
     for (kk=stringToTest.length;kk>=0;kk--)
     {
         if (stringToTest.charAt(kk) > " ")
         {
            subEnd = kk
            break;
         }
     }
     if (subStart < 0)
        return (" ")
     return (stringToTest.substr(subStart,subEnd+1))
 }

 function getValues() 
 {
   var elementname;
   var elementnamefix;
   var elementvalue;
   var elementtype;
   //Loop through all elements on the page
   for (var i=0; i < document.forms[0].elements.length; i++) 
   {
    elementtype = document.forms[0].elements[i].type;
    //If the first position of the element name equals "*"
    elementname = document.forms[0].elements[i].name;
     
   //set SId 
   if(elementname == 'SId')
   {
   elementnamefix = elementname;
   }
      
  //set MId
  if(elementname == 'MId')
  {
   elementnamefix = elementname;
  }
  
  //Set TN
  if(elementname == 'TN')
  {
   elementnamefix = elementname;
  }
  //set TNS
  if(elementname == 'TNS')
  {
   elementnamefix = elementname;
  }

  elementnamefix = elementname;
  //Removes * anf F
  if (elementname.substr(0,1) == 'F')
  {
   elementnamefix = elementname.substr(1);
  }
  if (elementname.substr(0,1) == '*')
  {
   elementnamefix = elementname.substr(2);
  }
    
    //Check for Radio
    if (elementtype.indexOf('radio') > -1) 
    {
   var checked;
   checked = (getQueryVariable(elementnamefix));
   if (typeof(checked) != "undefined"  && checked == document.forms[0].elements[i].value)
   {
    document.forms[0].elements[i].checked ='checked';
   }
    }
    //Check for CheckBox
    if (elementtype.indexOf('checkbox') > -1) 
    {
   var checked = '';
   checked = (getQueryVariable(elementnamefix));
   if (typeof(checked) != "undefined"  && checked.indexOf('True') > -1)
   {
    document.forms[0].elements[i].checked ='checked';
   }
  }
  
  //Check for Date
  if (elementname.substr(0,2) == 'mm' || elementname.substr(0,2) == 'dd' || elementname.substr(0,2) == 'yy') 
  {   
   var qDate = (getQueryVariable(elementname.substr(2,elementname.length)));
   
   if (typeof(qDate) != "undefined")
   {
   //Set month
    if(elementname.substr(0,2) == 'mm')
    {
     document.forms[0].elements[i].value = qDate.substr(0,2);
    }
     //Set day
      if(elementname.substr(0,2) == 'dd')
      {
    document.forms[0].elements[i].value = qDate.substr(3,2);
      }
     //Set year
      if(elementname.substr(0,2) == 'yy')
      {
    document.forms[0].elements[i].value = qDate.substr(6,4);
      }
   }
 
  }
  else
  {   
   if(elementname != 'FId')
   {
    if(typeof(getQueryVariable(elementnamefix)) != "undefined")
    {
     document.forms[0].elements[i].value = (getQueryVariable(elementnamefix));
    }
    else 
    {
     document.forms[0].elements[i].value = "";
    }
            }
  }
 }
}
 function getQueryVariable(variable) 
 { 
  var query = window.location.search.substring(1); 
  var vars = query.split("&"); 
  for (var i=0;i<vars.length;i++) 
  { 
   var pair = vars[i].split("="); 
   if (pair[0] == variable) 
   { 
    pair[1] = pair[1].replace(/\%20/g," ");
    return pair[1]; 
   } 
  }
 }
 function postPage()
 { 
  var dateField = new Array();
  var numDates = 0;
   //Loop elements
   for (var i=0; i < document.forms[0].elements.length; i++) 
   {
         var eleName = document.forms[0].elements[i].name;
         var eleNameFix = eleName;
         
          
        //Removes * anf F
      if (eleName.substr(0,1) == 'F')
      {
       eleNameFix = eleName.substr(1);
      }
      if (eleName.substr(0,1) == '*')
      {
       eleNameFix = eleName.substr(1);
      }
        
         if(eleNameFix.substr(0,2) == 'mm')
         {
           dateField[numDates] = eleNameFix.substr(2);
           numDates++;
         }
    }
    
    //Checks Fields if required
     
  if(CheckRequiredFields())
  { var val = 1;
    var reqVal= 1;
       for(var i=0; i < numDates; i++) 
       { 
              
       
           var dateFieldName = dateField[i];
              if(typeof(document.forms[0].elements['*F'+dateFieldName]) !=  "undefined")
        { 
        if(checkdate(document.forms[0].elements['*F'+dateFieldName].name))
            {
             
             reqVal = 1;
            }
            else 
            {
             reqVal = 0;
            }
     
       }
         
       else if(typeof(document.forms[0].elements['F'+dateFieldName]) !=  "undefined")
        { 
           if(document.forms[0].elements['F'+dateFieldName].value != "")
           {
            if(checkdate(document.forms[0].elements['F'+dateFieldName].name))
                {
                
                 reqVal = 1;
                }
            else 
                {
                
                 reqVal = 0;
                }
         }
         
         else if(i == (numDates - 1))
               {
               
                             val = 1;
               }
       }
       if(i == (numDates - 1))
       {
       
                    val = 1;
       }
      
         }
         if((val == 1) && (reqVal == 1))
         {
    document.forms[0].action = "http://adsmart360.net/tracking/FormTracking/FormTacking.aspx";
       document.forms[0].method = "POST";
             document.forms[0].submit();
         }
  }
 }
 
 function updCheck(name)
 {
  if(document.forms[0].elements[name].type == 'checkbox')
  {
   if(document.forms[0].elements[name].checked == 'checked' || document.forms[0].elements[name].value == "True")
   {
    document.forms[0].elements[name].value = false;
         }
   else
         {
    document.forms[0].elements[name].value = true;
   }
  }
    }
  function updRadio(rdName, rdValue)
    {  
       for (i=0;i<document.forms[0].elements[rdName].length;i++) 
       {    
           if (document.forms[0].elements[rdName][i].checked) 
           {
             for (i=0;i<document.forms[0].elements[rdName].length;i++) 
             {   
                 document.forms[0].elements[rdName][i].value = rdValue;
             }
           }
        } 
    }

 
// -->