//common functions for byo
function ShowStandardFeatures(model)
{
    //change for prod
	var url = '/Standard/Content/BYO/standardfeatures.aspx?NAModelCode=' + model;
	var popwidth = 622;
	var popheight = 792;
	var winleft = (screen.width - popwidth) / 2;
	var wintop = (screen.height - popheight) / 2;
	window.open(url, 'standardfeatures', 'height=' + popheight + ',width=' + popwidth + ',top=' + wintop + ',left=' + winleft + ',toolbar=no,scrollbars=yes,status=no,location=no,menubar=no,');

}
//common functions for byo
function ShowLeaseOffer(model)
{
    //change for prod
	var url = '/Standard/Content/BYO/leaseoffer.aspx?NAModelCode=' + model;
	var popwidth = 565;
	var popheight = 692;
	var winleft = (screen.width - popwidth) / 2;
	var wintop = (screen.height - popheight) / 2;
	window.open(url, 'leaseoffer', 'height=' + popheight + ',width=' + popwidth + ',top=' + wintop + ',left=' + winleft + ',toolbar=no,scrollbars=yes,status=no,location=no,menubar=no,');

}
function ShowPrint(model)
{
    //change for prod
	var url = '/Standard/Content/BYO/PrintVehicle.aspx?NAModelCode=' + model;
	var popwidth = 650;
	var popheight = 700;
	var winleft = (screen.width - popwidth) / 2;
	var wintop = (screen.height - popheight) / 2;
	window.open(url, 'byoprint', 'height=' + popheight + ',width=' + popwidth + ',top=' + wintop + ',left=' + winleft + ',toolbar=no,scrollbars=yes,status=no,location=no,menubar=no,');

}

//hide function for the colorchips 
 function HideByoColorChipWindow(name, type){
     var popupControl ;
     if(type == 'ext') 
     {
       popupControl = ASPxClientControl.GetControlCollection().Get('ctl00_ctl00_ctl00_ctl00_MasterContent_NoSideNavContent_byoContentPlaceHolder_ucexterior1_pcExteriorHovers');
     }
     if(type == 'int') 
     {
       popupControl = ASPxClientControl.GetControlCollection().Get('ctl00_ctl00_ctl00_ctl00_MasterContent_NoSideNavContent_byoContentPlaceHolder_ucinterior1_pcInteriorHovers');

     }
     if(popupControl)
     {
      var ccWindow= popupControl.GetWindowByName(name);
     
     if(ccWindow)
         {
         popupControl.HideWindow(ccWindow);
         }
     
     }
}

//select checkboxes when the names are clicked. 
function CheckUnCheckOption(field)
{
    var checkbox = $get(field); 
    if(!checkbox.disabled)
    {   
      checkbox.click();
    }
    else
    {
      if(field.indexOf('package') > -1) 
        {  alert('Please select the Package before selecting this Option'); }
    }
    return;   
}