﻿
 function FindCareers()
 {
  //alert("here");
//  debugger;
  var searchByKeyword = $("#searchByKeyword").val().trim();
  var region = $("#region").val().trim();
  var experienceLevel = $("#experienceLevel").val().trim();
//  var experienceLevel = "";
  var categoryId = $("#categoryId").val().trim();
  var isValid=true;
//  if($("#searchByKeyword").val().trim()=="")
//  {
//        document.getElementById("searchByKeywordError").innerHTML ="Required";
//        isValid = false;
//  }else
//  {
//        document.getElementById("searchByKeywordError").innerHTML ="";  
//  }
  if(isValid)
  {
        window.location = "/Content?&findSearch=1&categoryId=" + categoryId + "&experienceLevel=" + experienceLevel + "&region=" + region +"&searchByKeyword=" + searchByKeyword;
        
  //    $("#homeContainer").load("/Content.aspx?q="+(new Date()).getTime() + "&experienceLevel=" + experienceLevel + "&region=" + region +"&searchByKeyword=" + searchByKeyword +"&findSearch=1"+" #homeContainer", function() {
  //                         // debugger;
  //                          //$("#browseDiv").fadeIn("slow");
  //                      });
  }
 }
 function BrowseCareersByProvince(provinceId)
 {
  //debugger;
  $("#homeContainer").load("/Content.aspx?q="+(new Date()).getTime() + "&provinceId=" + provinceId + "&provinceSearch=1"+" #homeContainer", function() {
                           // debugger;
                            //$("#browseDiv").fadeIn("slow");
                        });

 }
 function BrowseCareersByExperienceLevel(experienceLevelId)
 {
  //debugger;
  $("#homeContainer").load("/Content.aspx?q="+(new Date()).getTime() + "&experienceLevelId=" + experienceLevelId + "&experienceLevelSearch=1"+" #homeContainer", function() {
                           // debugger;
                            //$("#browseDiv").fadeIn("slow");
                        });

 }
 function BrowseCareersByPostingDate(postingDate)
 {
  //debugger;
  $("#homeContainer").load("/Content.aspx?q="+(new Date()).getTime() + "&postingDate=" + postingDate + "&postingDateSearch=1"+" #homeContainer", function() {
                           // debugger;
                            //$("#browseDiv").fadeIn("slow");
                        });

 }
  function NewSearch()
 {
 //debugger;
  $("#homeContainer").load("/Home.aspx?q="+(new Date()).getTime() + "&startRows="+ arguments[0]+" #homeContainer", function() {
                           // debugger;
                            //$("#searchBrowseArea").fadeIn("slow");
                        });
 } 
function CareerDetail(careerId)
{
  // debugger;
   var lastSearch = $("#lastSearch").val().trim();
  $("#homeContainer").load("/Content.aspx?q="+(new Date()).getTime() + "&careerId=" + careerId + "&careerDetailSearch=1"+ lastSearch+ " #homeContainer", function() {
                           // debugger;
                            //$("#browseDiv").fadeIn("slow");
                        });
}
function BackSearch()
{
   //debugger;
   var lastSearch = $("#lastSearch").val().trim();
  $("#homeContainer").load("/Content.aspx?"+ lastSearch + " #homeContainer", function() {
                           // debugger;
                            //$("#browseDiv").fadeIn("slow");
                        });
}
 //set page modified status on default is 1
function fOnChange() {
    document.getElementById("modifyState").value = "0";
}
//set the page modified status off
function fOnUnChange() {
    document.getElementById("modifyState").value = "1";
}
function SetSize()
{
    alert("a");
    document.getElementById("region").style.size ="4";

}
function SetPaging(startRows,last)
{

  var lastSearch = last;  
  var careersPerPage = $("#careersPerPage").val().trim(); 
  var careerStartRows = startRows;
  lastSearch = lastSearch.replace("careerStartRows","");
  lastSearch = lastSearch.replace("careersPerPage","");  
  window.location = "/Content?&careerStartRows=" + careerStartRows + "&careersPerPage=" + careersPerPage + lastSearch;
}
   function MoreProvinve()
 {
// window.location = "/Content";
////  <a href="/Home">Home</a>
  $("#byProvince").load("/BrowseCareers.aspx?q="+(new Date()).getTime() + "&startRows="+ arguments[0]+" #byProvince", function() {
                           // debugger;
                            //$("#searchBrowseArea").fadeIn("slow");
                       });
 }
    function MoreCategory()
 {
// window.location = "/Content";
////  <a href="/Home">Home</a>
  $("#byCategory").load("/BrowseCareers.aspx?q="+(new Date()).getTime() + "&categoryStartRows="+ arguments[0]+" #byCategory", function() {
                           // debugger;
                            //$("#searchBrowseArea").fadeIn("slow");
                       });
 }
   function SetAd()
   {
    setInterval("ChangeAd()",10000);
   }
   function ChangeAd()
   {
    var oldURL =  document.getElementById("adSpaceBannerInner").style.backgroundImage;
    $("#adSpaceBanner").load("/NavBarHorCareer.aspx?adChange=NextAd&oldURL="+oldURL+" #adSpaceBanner",function(){
        });
//    var adSpaceBannerURL= document.getElementById("adSpaceBanner").style.backgroundImage;
//    if(adSpaceBannerURL =="url(/style/UCANLogo.png)"){
//    document.getElementById("adSpaceBanner").style.backgroundImage = "url(/style/vcadLogo.png)";    
//    }else{
//    document.getElementById("adSpaceBanner").style.backgroundImage = "url(/style/UCANLogo.png)";        
//    }
//      
    }
 //SetAd();
