var isExitPopEnable=true;

function passValue(formName,a)
{
    document.forms[formName].Dealer.value=a;

}
function popupPreview(urltxt, wid, high) 
{           
  wid+=0;
  high+=0;
  var flagvar=0;

  try{
            confirmWin.close();
            confirmWin=window.open(urltxt, "kwu", 
                         "height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
                         "resizable=no,status=no,toolbar=no,scrollbars=yes,left=10,top=20");
      }
      catch(e)
      {
           confirmWin=window.open(urltxt, "kwu", 
                         "height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
                         "resizable=no,status=no,toolbar=no,scrollbars=yes");
      }

  if (window.confirmWin)
  { 
    if (window.focus) 
    { 
      if ((navigator.appName.indexOf("Microsoft Internet Explorer")!=-1)
         &&
          (navigator.appVersion.indexOf("4.") != -1)
          &&

          (parent.length>0))

      { 

        window.confirmWin.close(); 

        flagvar=1;

        timevar = setTimeout("openit(urltxt)", 300);      

      }

      else

      {

        confirmWin.focus();

      }

    } 

    else

    {  

      if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1)  // If this is a MSIE Browser

      {  

        if (navigator.appVersion.indexOf("3.") != -1)  // MSIE 3.x

        {

          if (isLoaded == true)

          {

            alert("If the large image does not pop up, press the 'Product Close-up' tab in your task bar, or locate the image browser behind your open window." );

            return;

          }

          else

          {

            alert("If the Site Menu bar does not pop up, press the 'Product Close-up' tab in your task bar, or locate the image browser behind your open window." );

            return;

          } 

        } 

      }

    }

  }          

  else

  {

    confirmWin = window.open(urltxt, "kwu", 

                             "height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +

                   "resizeable=no,status=no,toolbar=no");

    var isLoaded = true;

  }

  

  // This is important for Netscape 2.0 to enable the opener property

  if (flagvar!=1)

  {

    if (confirmWin.opener == null)

    {

      confirmWin.opener = self;

    }

  }

  wid=0;

  high=0;

}
function doSub()
{
    document.forms[0].elements['subFlag'].value = 'Y';
   
}

function submitform()
{
	document.forms[0].submit();
	isExitPopEnable=false;
}

function formImageSubmit() 
{
	document.form.selectvalue.value='Y';
	isExitPopEnable=false;
}


function changeProgramDisclaimer() 
{

    
	var a2;
	var a1; 
	if(document.forms[0].ProgramOfInterest.selectedIndex != null) {
		a1 = document.forms[0].ProgramOfInterest.options[document.forms[0].ProgramOfInterest.selectedIndex].value;
	}

	if(document.forms[0].CampusLocation.selectedIndex != null) {
		a2 = document.forms[0].CampusLocation.options[document.forms[0].CampusLocation.selectedIndex].value;
	}
		
	document.getElementById('requirementDiv').className='thide';
 	   
	if ( a1 == "WSB" && a2 == "80610") 
	{
	    document.getElementById('requirementDiv').className='tshow';
	
	}
	else
	{
		document.getElementById('requirementDiv').className='thide';
	
	}
}
 
function CampusLocationClick()
{	

    document.forms[0].elements['isCampusSelected'].value = 'Y';
	document.form.submit();
}

function doProcessing() {
	isExitPopEnable = false;
} 

function onExitWindow(){
	if(isExitPopEnable)
	popupPreview('popups/exitPopUp.jsp',450,300);
}
