﻿// JScript File
function getbrand(x,y){

window.open("http://www.car2you.com/search/searchtool/castsubmodelcompare.aspx?brand_id="+x+"&name="+y,'sc1');
}
function getbrand1(x,y){

window.open("http://www.car2you.com/search/searchtool/castsubmodelcompare.aspx?brand_id="+x+"&name="+y,'sc2');
}
function send_data1(){

var brand=window.document.getElementById('ctl00_ContentPlaceHolder1_SearchCompareTotal1_SearchCompare1_ddlbrand').value;

var brand1=document.getElementById('ctl00_ContentPlaceHolder1_SearchCompareTotal1_SearchCompare1_1_ddlbrand').value;



if (brand!="c.choose" && brand1!="c.choose"){
var model=document.getElementById('Cctl00_ContentPlaceHolder1_SearchCompareTotal1_SearchCompare1_div1').value;
var model1=document.getElementById('Cctl00_ContentPlaceHolder1_SearchCompareTotal1_Searchcompare1_1_div1').value;

  if (model!="all" && model1!="all"){
  document.getElementById('TempCheckValue').value=model+";"+model1;
  document.search_hiden.action ="http://www.car2you.com/search/comparecar/comparedetail.aspx";
  document.search_hiden.target ="_blank";
  document.search_hiden.method="post";
  document.search_hiden.submit(); }
  else
        {
        alert("กรุณาเลือกรุ่นเพื่อเปรีบบเทียบ")
        }
  }
  else
  {
  alert("กรุณาเลือกยี่ห้อเพื่อเปรียบเทียบ");
  }
}

function compare_fix(x){

 document.getElementById('TempCheckValue').value=x;
  document.search_hiden.action ="http://www.car2you.com/search/comparecar/comparedetail.aspx?";
  document.search_hiden.target ="_blank";
  document.search_hiden.method="post";
  document.search_hiden.submit(); 
}


