var bascnt = 0;
var counts = get_cookie("HCI_CN"); 
if(counts != null) {
var count = counts.split("-");
var clgcnt = count[1];
var crscnt = count[2];
var tcnt = count[0];
} else {
  var clgcnt = 0;
  var crscnt = 0;
  var tcnt = 0;
}
var t = true;
function $(styleId) {return document.getElementById(styleId);}
function hideShowComponent(node1, node2, node3) {
if(document.getElementById(node1) != null) {
$(node1).style.display ="block"
if($(node1+"_id")!= null){
$(node1+"_id").value ="display:block"
}
$(node1).value="";
}
if($(node2) != null) {
$(node2).style.display ="none"
if($(node2+"_id")!= null){
$(node2+"_id").value ="display:none"
}
$(node2).value="";
}
if($(node3) != null) {
$(node3).style.display = "none"
}}
function imagePicked(imgObj, imgSrcId, defaulttxt) {
if(imgObj.value == ''){
$(imgSrcId).src =$(defaulttxt).value;
}else{
$(imgSrcId).src = "/commimg/hcicn/default/"+imgObj.value;
}}
function setRadioValue(obj) {
if ($("rec_"+obj.name.split("_")[1])!= null) {
$("rec_"+obj.name.split("_")[1]).value = obj.value
}}
function clearComponent(compName1, compName2, defaultTxt, inputId,event,flag) {
if (defaultTxt !=null && defaultTxt !='' &&  $(compName1)!=null && $(compName1).value == defaultTxt) { //if default txt passed then compname1, compName2 default value 
$(compName1).value = ""        
if ($(compName2) != null) {
$(compName2).value = "";
}}
else if(defaultTxt =='' && inputId =='') { // if both 3 and 4th param not send then clear the comp1, comp2 value
if($(event.id)!=null && $(event.id).value == '0') {//will set the default value when drop down value is 0
if(flag != null) {
$(compName1).value = $(flag).value;
}else{
$(event.id).value= $(event.id).value;
$(compName1).value = $("universitydefaulttxt").value;
}}}
else if($(inputId) !=null &&  $(compName1)!=null && $(compName1).value == $(inputId).value ){ //if inputId component id  passed then compname1, compName2 default value will clear
if ($(compName1) != null) {
$(compName1).value = "";
}   
if (compName2!= ''&& $(compName2) != null) {
$(compName2).value = "";
}}}
function clearCategory(obj) {
obj.value = '';
return false;
}
function openPopup(fileName, height,event){
if ($("chkalrt") != null && $("chkalrt").value == "chkalert") {
alert($("emanId").value);
return false;
}else{
if (fileName != "dummy" && (event == null) ) {// fire when it is other than home page link.
window.open(contextPath+fileName,'','height='+height+',width=740,scrollbars=yes,resizable=no');
return false;
}else{ //fire when the homepage link clicked from the top navigation
return true;
}}}
function check_length(my_form, maxLen) {
if (my_form.value.length>maxLen) {
my_form.value=my_form.value.substring(0,maxLen);
}}
function validateFindReviews(model,defText,error) {    
if($(model).value == '' || $(model).value == $(defText).value) {    
alert($(error).value);   
return false;
}
return true;
}
function chkList(clearObjId, showErrorId, errtextId){
if ($("coutId").value != '0' && $(clearObjId) != null && $(clearObjId).value == '' && !($("model").value == $("universitydefaulttxt").value || $("model").value == "")) {
$(showErrorId).style.display="block";
$(showErrorId).innerHTML = $(errtextId).value
}}
function keycheck(clearId, clearTxt,clearTxtId, e){
if(e.keyCode == 9){
if (clearTxt !=null && clearTxt !='' &&  $(clearId)!=null && $(clearId).value == clearTxt) { //if default txt passed then compname1, compName2 default value will clear
$(clearId).value = ""
}else if($(clearTxtId) !=null &&  $(clearId)!=null && $(clearId).value == $(clearTxtId).value ){ //if inputId component id  passed then compname1, compName2 default value will clear
$(clearId).value = "";
}}}
function loadImage() {
if($("formaction")!=null && $("formaction").value == "savereview"){
if($("selectimage_id")!= null && $("selectimage_id").value == "display:block"){
if($("selectimage").value != "") {
$("imageId").src ="/commimg/hcicn/default/"+$("selectimage").value
}
$("selectimage").style.display = "block";
$("uploadImage").style.display = "none";
}
if($("uploadImage_id")!= null && $("uploadImage_id").value == "display:block"){
$("uploadImage").style.display = "block";
$("selectimage").style.display = "none";
}}}
function trim(str){
return str.replace(/^\s*|\s*$/g,"")}
function showHideTab(showId,hideId,showTabVal,obj,ids,showdiv,hidediv) {        
$(showId).style.display = 'block';
$(hideId).style.display = 'none';    
$(showdiv).style.display = 'block';
$(hidediv).style.display = 'none'; 
$('showTab').value = showTabVal;
//$('cId').value = '0';
if($('instName').value != null) {
$('instName').value = $('sdef').value;
}
$('instId').value = null;
$('ccId').value = '0';
$('qId').value = '0';
if($('catName').value != null) {
$('catName').value = $('catdef').value;
}
$('catId').value = null;
//var curObj = $(obj);
//if(obj == 'clink') {            
//curObj.className = 'stabtop';            
//} else {
//curObj.className = 'stabbtm';
//}   
//$(ids).className = '';
//return false;
}
function replaceAll(OldString,FindString,ReplaceString) {
var SearchIndex = 0;
var NewString = ""; 
while (OldString != null && OldString.indexOf(FindString,SearchIndex) != -1) {
NewString += OldString.substring(SearchIndex,OldString.indexOf(FindString,SearchIndex));
NewString += ReplaceString;
SearchIndex = (OldString.indexOf(FindString,SearchIndex) + FindString.length); 
}
if(OldString != null)
NewString += OldString.substring(SearchIndex,OldString.length);
return NewString;}
function media(mediaFileName, writeDiv){
var s1 = new SWFObject(contextPath+"/script/mediaplayer.swf","mediaplayer","100","100","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("width","100");
s1.addVariable("height","100");
//s1.addVariable("file",'http://hotcourses.vo.llnwd.net/o18/'+mediaFileName);
//s1.addVariable("image",'http://hotcourses.vo.llnwd.net/o18/'+replaceAll(mediaFileName, ".flv", "")+'_tmb/0000.jpg');
s1.addVariable("file",mediaFileName);
s1.addVariable("image",replaceAll(mediaFileName, ".flv", "")+'_tmb/0000.jpg');
s1.addVariable('autostart','false');
s1.write(writeDiv);
}
function hideShowCourseDetail(node1, node2, node3) {
if($(node1) != null) {
$(node1).style.display ="block";
$(node1+"_1").className = "cdorangetab";
}
if($(node2) != null) {
$(node2).style.display ="none";
$(node2+"_1").className = "";
}
if($(node3) != null) {
$(node3).style.display = "none";
$(node3+"_1").className = "";
}}
function checkSearch() {
if($('qId').value =='99' || $('qId').value =='18') {
  /*if($("ccId").value=='0') {
      alert($('erremptyinst').value);
      return false;
  }
  $("searchpanelid").action="/6/efl/ /lc/"+($("ccId").value)+"/"+encodeURI($("eflurldata").value)+".html";
  $("searchpanelid").submit(); */
  return true;
} else {
if($('qId').value == '' && $('qId').value != '16') {
alert($('erremptyslevel').value);
return false;
}
if($('qId').value == '16' && $('catName').value == '') {
$('catName').value=$('mbahid').value;
$('catId').value='k-2';
}

if($('catName').value == null || trim($('catName').value) == trim($('catdef').value) || trim($('catName').value) == '') {
alert($('erremptykword').value);
return false;
}
}
return true;
}
function instsubmit() {
  if($("cId").value == 0) {
    alert($("erremptyinstcnt").value); 
    return false;
  }
  var cntId = $("cId").value;
  //var rgtId = $("regId").value;
  var kword = $("instName").value;
  if($("sdef").value==kword) {
    $("instName").value = "";
    kword="";
  }
  cntId = cntId.length>0 ? "cid/"+cntId+"/" : "";
  //commented for webcache
  //rgtId = rgtId.length>0 ? "rid/"+rgtId+"/" : "";
  kword = kword.length>0 ? "kwrd/"+kword+"/" : "";
  var pageURL = "pno/1/provider-search.html"
  //var eventurl = contextPath+"/provider/"+cntId+rgtId+kword+pageURL  
  var eventurl = contextPath+"/provider/"+cntId+kword+pageURL;    
  $("pvrfrm").action=eventurl;
  $("pvrfrm").submit();
}  
function checkProviderSearch() {
if($('instId').value == null || trim($('instId').value) == '') {
alert($('erremptyinst').value);
return false;
}
return true;
}
function checkProviderCourseSearch() {
if($('procatName').value == null || $('procatName').value == $('catdef').value || trim($('procatName').value) == '') {
alert($('erremptykword').value);
return false;
}
return true;
}
function translate(translatedId, sourceId, transImage, originalImg,pageName) {
splitval = $(sourceId).innerHTML.split("<span");
var firsttranslation = null;
var lasttranslation =  null;
if(splitval[0].length >1300) {
lastdotindex = splitval[0].substring(0, 1300);
lastdot= lastdotindex.substring(0,lastdotindex.lastIndexOf("."));
google.language.translate(lastdot,  sourceLang, transLang, function(result) {
if (result.translation) {  
firsttranslation = result.translation
lastdot= splitval[0].substring(lastdotindex.lastIndexOf(".")+1,splitval[0].length);
google.language.translate(lastdot,  sourceLang, transLang, function(result) {
if (result.translation) {  
lasttranslation = result.translation
showtext(translatedId, sourceId, transImage, originalImg,firsttranslation+lasttranslation);
}});
}});
} else {
google.language.translate(splitval[0],  sourceLang, transLang, function(result) {
if (result.translation) {  
lasttranslation = result.translation
showtext(translatedId, sourceId, transImage, originalImg, lasttranslation);   
}});}

var ajax=new sack();
ajax.requestFile = contextPath+"/loggoogletrans.html?pageName="+pageName;
ajax.onCompletion = function(){}
ajax.runAJAX();
}
function showtext(translatedId, sourceId, transImage, originalImg, text) {
if($(sourceId)!= null && $(sourceId).style.display == "none") {
$(sourceId).style.display = "inline";
$(translatedId).style.display = "none";
$(transImage).style.display = "inline";
$(originalImg).style.display = "none";
} else {
$(sourceId).style.display = "none";
$(translatedId).style.display = "inline"
$(transImage).style.display = "none";
$(originalImg).style.display = "inline";
$(translatedId).innerHTML = text
}}
var val = new Array();
val[0] = 0;
val[1] = 0;
val[2] = 0;
val[3] = 0;
function refreshCollege(outercount) {
if(isNaN(val[outercount]) || !val[outercount]) {
val[outercount] = 0
}
val[outercount] = parseInt(val[outercount]) + 1;
if(val[outercount] >= $("clcntId_"+outercount).value) { 
val[outercount]= 0; 
}
if ($("videoimage_"+outercount) != null) {
$("videoimage_"+outercount).style.display="none"
}
if($("ovallbk_"+outercount) !=  null){
$("ovallbk_"+outercount).style.display = "none"
}
if($("transcolname_"+outercount+"_"+val[outercount]) != null) {
$("ratdiv_"+outercount).style.display = "none"
transCollegeName = $("transcolname_"+outercount+"_"+val[outercount]).value;
collegeName = $("colname_"+outercount+"_"+val[outercount]).value;
if($("transcolname_"+outercount+"_"+val[outercount]).value.length > 8){
transCollegeName = transCollegeName.substring(0,7) +"..."
}
if($("colname_"+outercount+"_"+val[outercount]).value.length > 22){
collegeName = collegeName.substring(0,19) +"..."
}

colurl = $("colurl_"+outercount+"_"+val[outercount]).value;
alt = $("transcolname_"+outercount+"_"+val[outercount]).value +" "+$("colname_"+outercount+"_"+val[outercount]).value;
if($("url_"+outercount+"_"+val[outercount]) != null &&  $("url_"+outercount+"_"+val[outercount]).value.indexOf("commimg/myhotcourses/institution") != -1)
{
$("pimg_"+outercount).src = $("url_"+outercount+"_"+val[outercount]).value
}else{
$("pimg_"+outercount).src = $("img_"+outercount+"_"+val[outercount]).value
}
$("pimglink_"+outercount).href = colurl
$("pimglink_"+outercount).target = "_blank"
$("pimg_"+outercount).style.width = "84px";
$("pimg_"+outercount).style.height = "84px";
$("ptranscolname_"+outercount).innerHTML = "<a href = \""+colurl+"\" alt=\""+alt+"\" title=\""+alt+"\" rel=\"nofollow\">"+transCollegeName+"<span>"+collegeName+"</span></a>"
if($("ratdiv_"+outercount) != null && parseInt($("ovr_"+outercount+"_"+val[outercount]).value) > 0)  {
$("ratdiv_"+outercount).style.display = "block"
$("psrating_"+outercount).className = "srating"+parseInt($("ovr_"+outercount+"_"+val[outercount]).value)
$("ratcnt_"+outercount).innerHTML = "("+$("ovr_"+outercount+"_"+val[outercount]).value+")";
$("uniurl_"+outercount).href= $("colrwurl_"+outercount+"_"+val[outercount]).value
$("uniurl_"+outercount).alt=$("colrwct_"+outercount+"_"+val[outercount]).value
$("uniurl_"+outercount).title = $("colrwct_"+outercount+"_"+val[outercount]).value
}

if($("img_"+outercount+"_"+val[outercount]) != null &&  $("img_"+outercount+"_"+val[outercount]).value.indexOf("_tmb") != -1) {
colgId = $("colId_"+outercount+"_"+val[outercount]).value;
vpath = $("img_"+outercount+"_"+val[outercount]).value
videpath = replaceAll(vpath,"_tmb/0005.jpg",".flv")
$("pimglink_"+outercount).href = "javascript:opnlgtbx('"+colgId+"','null','"+videpath+"')";
$("pimglink_"+outercount).target ="";
$("pimg_"+outercount).style.width = "84px";
$("pimg_"+outercount).style.height = "55px";
$("vimg_"+outercount).style.display = "block"
if($("vtxt_"+outercount) != null) {
$("vtxt_"+outercount).href = "javascript:opnlgtbx('"+colgId+"','null','"+videpath+"')";
$("videodur_"+outercount).innerHTML = $("coldur_"+outercount+"_"+val[outercount]).value
}
}else {
$("vimg_"+outercount).style.display = "none"
}
}
setTimeout("refreshCollege("+outercount+")",3000);
}
function hideContent(count){
if($('rwfcnt' + count).style.display == 'none') {
$('rwfcnt' + count).style.display = '';
$('rstrs' + count).style.display = '';
$('bwspan' + count).style.display = '';
$('rwfcntm' + count).style.display = 'none';

} else {
$('rwfcnt' + count).style.display = 'none';
$('rstrs' + count).style.display = 'none';
$('bwspan' + count).style.display = 'none';
$('rwfcntm' + count).style.display = '';
}    
if(trim($('fespan' + count).innerHTML) == trim($('hidfold').value)) {        
$('fespan' + count).innerHTML = $('hidexpand').value;
} else {
$('fespan' + count).innerHTML = $('hidfold').value;
}
return false;
}  
var web = new Object();
var inval = true;
 var weblnk= null;
function enquiry(cId, courId, depnm, catId, kywd, countryId, qId, kId, obj,email,advertName,whatProfile,subId) {
$("load").style.display = "block";
$('fade').style.display='block'
$('fade').style.height = document.body.offsetHeight
$("ccId").style.display = 'none';
$("qId").style.display = 'none';
if(window.XMLHttpRequest)
request=new XMLHttpRequest()
else if(window.ActiveXObject)
request=new ActiveXObject("Microsoft.XMLHTTP")
url=contextPath+"/enquiry.html?cId="+cId+"&depnm="+depnm+"&courId="+courId+"&catId="+catId+"&kywd="+replaceAll(kywd,"-","%20") +"&countryId="+countryId+"&qId="+qId+"&kId="+kId+"&email="+email+"&advertName="+advertName+"&whatProfile="+whatProfile+"&subId="+subId;
request.onreadystatechange=function(){
    if(request.readyState==4){
        if(request.status==200){
            var weblinks = request.responseText.split("#@#@#@");
           if(weblinks[1]!=null){
                weblnk = weblinks[1];
                window.location.href= weblnk;
             }else {
                showEnquiry(request.responseText, cId);
             }
        }
    }
}
request.open("POST",url,true)
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
request.send(null)
}
function eflEnquiry(cId, courId, depnm, catId, kywd, countryId, qId, kId, obj, eflflag) {
$("load").style.display = "block";
$('fade').style.display='block'
$('fade').style.height = document.body.offsetHeight
$("ccId").style.display = 'none';
$("qId").style.display = 'none';
$("cId").style.display = 'none';
if(window.XMLHttpRequest)
request=new XMLHttpRequest()
else if(window.ActiveXObject)
request=new ActiveXObject("Microsoft.XMLHTTP")
url=contextPath+"/enquiry.html?cId="+cId+"&depnm="+depnm+"&courId="+courId+"&catId="+catId+"&kywd="+replaceAll(kywd,"-","%20") +"&countryId="+countryId+"&qId="+qId+"&kId="+kId+"&eflflag="+eflflag;
request.onreadystatechange=function(){
    if(request.readyState==4){
        if(request.status==200){
            var weblinks = request.responseText.split("#@#@#@");
           if(weblinks[1]!=null){
                weblnk = weblinks[1];
                
                window.location.href= weblnk;  
             }else {
                showEnquiry(request.responseText, cId);
             }
        }
    }
}
request.open("POST",url,true)
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
request.send(null)
}
function lfenquiry(cId, courId, depnm, catId, kywd, countryId, qId, kId, obj,email,advertName,whatProfile,subId) {
$("load").style.display = "block";
$('fade').style.display='block'
$('fade').style.height = document.body.offsetHeight
$("ccId").style.display = 'none';
$("qId").style.display = 'none';
if(window.XMLHttpRequest)
request=new XMLHttpRequest()
else if(window.ActiveXObject)
request=new ActiveXObject("Microsoft.XMLHTTP")
url=contextPath+"/lfenquiry.html?cId="+cId+"&depnm="+depnm+"&courId="+courId+"&catId="+catId+"&kywd="+replaceAll(kywd,"-","%20") +"&countryId="+countryId+"&qId="+qId+"&kId="+kId+"&email="+email+"&advertName="+advertName+"&whatProfile="+whatProfile+"&subId="+subId;
request.onreadystatechange=function(){
    if(request.readyState==4){
        if(request.status==200){
            var weblinks = request.responseText.split("#@#@#@");
           if(weblinks[1]!=null){
                weblnk = weblinks[1];
                window.location.href= weblnk;  
             }else {
                showEnquiry(request.responseText, cId);
             }
        }
    }
}
request.open("POST",url,true)
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
request.send(null)
}
function showEnquiry(pages, cId) {
enqomniture('enquiry-lightbox', cId);
if($("flashbanner")!= null) {
$("flashbanner").style.display ="none"
}
if($('load') !=  null)
$('load').style.display='none';
$('enqlight').style.display='block';
$("enqlight").innerHTML = pages;
var c_data = get_cookie("u_enq");
if(c_data != null) {
  var c_text = c_data.split("azw-wza");
  var opts = c_text[0];
  if(opts != '0') {   
      var optsVal = opts.split("az-za");        
      for(var i = 0 ; i < optsVal.length ; i++) {            
         $(optsVal[i]).checked = true;
       }
  }
  $('emailId').value = c_text[1];
  $('enquiryName').value = c_text[2];   
} else {
  for(var i=1; i<=8;i++) 
  {
    $("chk_"+i).checked = true;
  }
}
if($("procId"))
{
if($("procId").length == 1){
  $("procId").disabled = "disabled";
}
}
//$("terms").checked=true;
//$("proqId").value=$("stuqul").value;
}
function hdandsh(id) {
if ($(id).style.display == 'none') {
$(id).style.display = 'block';
} else {
$(id).style.display = 'none';
}
}
function valEnqFrm(emmsg, stmsg,nammsg, chkmsg, trtxt ,namtxt,eId,termtxt,wantmsg) {
var msg = "";
chk = true;
chkbxchk = null;
for(i=1;i<8;i++) {
if($("chk_"+i).checked) {
chkbxchk = true;
break;
}}
msg = validation(emmsg, stmsg,nammsg, chkmsg, trtxt ,namtxt,eId,termtxt,wantmsg);
if(msg.length >0 ) {
$("ncreview").style.display = "block";
$("err").innerHTML = msg;
chk = false;
} else{
loadCaptcha(msg);
}
return chk;
}
function validEmbedEnqFrm(emmsg, stmsg,nammsg, chkmsg, trtxt ,namtxt,eId,termtxt,wantmsg) {
var msg = "";
chk = true;
chkbxchk = null;
for(i=1;i<8;i++) {
if($("chk_"+i).checked) {
chkbxchk = true;
break;
}}
msg = validation(emmsg, stmsg,nammsg, chkmsg, trtxt ,namtxt,eId,termtxt,wantmsg);
if(msg.length >0 ) {
$("ncreview").style.display = "block";
$("err").innerHTML = msg;
if($("err")){
location.href="#err";
}
chk = false;
} else{
loadCaptcha(msg);
}
return chk;
}
function loadCaptcha(msg){
if(window.XMLHttpRequest) {
  request=new XMLHttpRequest();
} else if(window.ActiveXObject) {
  request=new ActiveXObject("Microsoft.XMLHTTP");
}
if($("recaptua").style.display=="block") {
  url=contextPath+"/captuaenquiry.html?cId="+$("sccId").value+"&email="+$("emailId").value+"&cap="+$("captuaCode").value;
} else {
  url=contextPath+"/captuaenquiry.html?cId="+$("sccId").value+"&email="+$("emailId").value;
}
request.open("POST",url,true);
request.send(null);  
request.onreadystatechange=function(){
if(request.readyState==4){
  if(request.status==200){
     var arr = request.responseText.split(",");
     if(arr[0]=="Y" && arr[1]=="false") {
      if($("recaptua").style.display == "block"){
        if($("captuaCode").value!="" || arr[1]=="false") {
          msg = msg + $("caperr").value;
          $("ncreview").style.display = "block";
          $("err").innerHTML = msg;
        }
        }
       $('recaptua').style.display="block";
       $('capcode').src = arr[2];
       $('captuaCode').style.display="block";
     } else {
       enqomniture('college-email-sent',$("sccId").value);
       $("enqid").action = contextPath+"/sendenquiry.html?type=sendenquiry";
       $("enqid").submit();
       $("enquirybtm").disabled = true;
}
}
}
}
}
function validateEnqFrm(emmsg, stmsg,nammsg, chkmsg, trtxt ,namtxt,eId,termtxt,wantmsg) {
var msg = "";
chk = true;
chkbxchk = null;
for(i=1;i<5;i++) {
if($("chk_"+i).checked) {
chkbxchk = true;
break;
}}
msg = validation(emmsg, stmsg,nammsg, chkmsg, trtxt ,namtxt,eId,termtxt,wantmsg);
if(msg.length >0 ) {
$("ncreview").style.display = "block";
$("err").innerHTML = msg;
chk = false;
} else{
if(window.XMLHttpRequest) {
  request=new XMLHttpRequest();
} else if(window.ActiveXObject) {
  request=new ActiveXObject("Microsoft.XMLHTTP");
}
if($("recaptua").style.display=="block") {
  url=contextPath+"/captuaenquiry.html?cId="+$("sccId").value+"&email="+$("emailId").value+"&cap="+$("captuaCode").value;
} else {
  url=contextPath+"/captuaenquiry.html?cId="+$("sccId").value+"&email="+$("emailId").value;
}
request.open("POST",url,true);
request.send(null);  
request.onreadystatechange=function(){
if(request.readyState==4){
  if(request.status==200){
      var arr = request.responseText.split(",");
      if(arr[0]=="Y" && arr[1]=="false") {
      if($("recaptua").style.display == "block"){
        if($("captuaCode").value!="") {
          msg = msg + $("caperr").value;
          $("ncreview").style.display = "block";
          $("err").innerHTML = msg;
        }
        }
       $('recaptua').style.display="block";
       $('capcode').src=arr[2];
       $('captuaCode').style.display="block";
     } else {
       enqomniture('college-email-sent',$("sccId").value);
       $("lenqid").action = contextPath+"/sendenquiry.html?type=sendenquiry";
       $("lenqid").submit();
       $("enquirybtm").disabled = true;
}
}
}
}
}
return chk;
}

function validation(emmsg, stmsg,nammsg, chkmsg, trtxt ,namtxt,eId,termtxt,wantmsg){
var msg = "";
if(!chkbxchk && ($("tr").value == trtxt || $("tr").value.length == 0) && !$("chk_9").checked) {
msg = msg + chkmsg + "<br />";
}

if($("tr").value.length > 0){
if(($("tr").value).indexOf("http") != -1 || ($("tr").value).indexOf("href") != -1 || ($("tr").value).indexOf("www") != -1) {
  msg = msg + wantmsg +" <br />";
}
}

if(!isEmailAddressValid($("emailId").value) || !isEmailAddressValid($("cemailId").value)){
msg  = msg + emmsg + "<br />";
}else if($("emailId").value != $("cemailId").value) {
msg = msg + $("confirmerror").value;
}


if($("enquiryName").value == namtxt || $("enquiryName").value.length == 0){
msg = msg + nammsg + "<br />";
}
if($("proqId").value == "" || $("proqId").value.length == 0){
msg = msg + $("stymdeerr").value + "<br />";
}

if($("sublvl")){
if($("sublvl").style.display=="block"){
if($("procId").value == "" || $("procId").value.length == 0 || $("procId").value == "0") {
msg = msg +  $("suberr").value + "<br />";
}
} }

if($("efllvl")){
if($("efllvl").style.display=="block"){
if($("eflprocId").value == "" || $("eflprocId").value.length == 0) {
msg = msg +  $("suberr").value + "<br />";
}
}
}

if($("terms").checked == false){
msg = msg + termtxt + "<br />";
}
if($("recaptua").style.display == "block"){
if($("captuaCode").value=="") {
msg = msg + $("caperr").value;
}
}
return msg;
}

function CheckConfirmationEmail(){
var msg = "";
if($("emailId").value != $("cemailId").value){

$("ncreview").style.display = "block";
msg = msg+$("confirmerror").value;
$("err_msg").innerHTML = msg;
}else{
$("err_msg").innerHTML = "";
}
}
function statsLog(cId, actId, conId, elink,pid,slid,ekey,psid,qid) { 
var ajax=new sack();
var uri = null;
var ref = null;
var reqAffId = null;
if($('uri') != null) { uri = $('uri').value; }
if($('ref') != null) { ref = $('ref').value; }
if($("reqAffId")) { reqAffId = $('reqAffId').value; }
ajax.requestFile = contextPath+"/logstats.html?cId="+cId+"&actId="+replaceAll(actId,"-", "%20")+"&conId="+conId+"&elink="+elink+"&pid="+pid+"&sid="+psid+"&qcode="+qid+"&slid="+slid+"&ekey="+ekey+"&uri="+uri+"&ref="+ref+"&reqAffId="+reqAffId
ajax.onCompletion = function(){}
ajax.runAJAX();
}
// For CPE Stats Log
function cpeStatsLog(collegeId, afflId, countryId, subOrderitemId , weblink, qualId, courseId,sectionId,url) {
var ajax=new sack();
ajax.requestFile = contextPath+"/cpedblogstats.html?collegeId="+collegeId+"&afflId="+afflId+"&countryId="+countryId+"&subOrderitemId="+subOrderitemId+"&weblink="+weblink+"&qualId="+qualId+"&courseId="+courseId+"&sid="+sectionId+"&inneLinkurl="+url;
ajax.onCompletion = function(){}
ajax.runAJAX();
}
function shwinfo(obj){
var id=obj.id;
if($("b"+id+"_sp") != null)
$("b"+id+"_sp").style.display="none";
if($(id).value==""){
$(id+"_sp").className = "info";
if($(id+"_i") != null) {
$(id+"_sp").innerHTML=$(id+"_i").value;
}
}}
function shwerr(obj){
var id=obj.id;
dval=true;
IdValue=$(id).value; 
if($("b"+id+"_sp") !=null)
$("b"+id+"_sp").style.display="none";
$(id+"_sp").className = "emes";
if(id=="eId"&&IdValue!=""&&!isEmailAddressValid(IdValue) || id=="nnId"&&IdValue!=""&&bLength(IdValue) > 12 ||
  (id=="pwdId"||id=="cfpwdId")&&IdValue!=""&&!chkalphanumsym(IdValue)){
$(id+"_sp").innerHTML = $(id+"_w").value
dval=false;
}
if((id=="pwdId"||id=="cfpwdId")&&IdValue!=""&&IdValue.length>12){
$(id+"_sp").innerHTML = $(id+"_w1").value
dval=false;
}
if($("cfpwdId").value!="" && $("pwdId").value!=""&&$("cfpwdId").value!=$("pwdId").value){
$("cfpwdId_sp").innerHTML = $("cfpwdId_w").value
dval=false;
}
if(IdValue==""){
$(id+"_sp").innerHTML=$(id+"_e").value;
dval=false;
}
if(dval){
$(id+"_sp").className = "";
$(id+"_sp").innerHTML="";
}}
function bLength(str) {
var escapedStr = encodeURI(str)
if (escapedStr.indexOf("%") != -1) {
var count = escapedStr.split("%").length - 1
if (count == 0) count++  //perverse case; can't happen with real UTF-8
var tmp = escapedStr.length - (count * 3)
count = count + tmp
} else {
count = escapedStr.length
}
return count
}
function chkalphanumsym(parm){
val ='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890!@#$%^&*()_-+={[}]|\":;?/>.<,~`'
if (parm == "") return true;
for (i=0; i<parm.length; i++) {
    if (val.indexOf(parm.charAt(i),0) == -1) return false;
}
return true;
}
function logout(){
var ajax=new sack();
ajax.requestFile = contextPath+"/logout.html"
ajax.onCompletion = function(){ 
$("lgotid").style.display='none'
$("logid").style.display='block'
}
ajax.runAJAX();
if($("bascrs")!=null) {
  $("bascrs").innerHTML = '0';
}
if($("bascol")!=null) {
  $("bascol").innerHTML = '0';
}
}
function lg(obj, e, redrct,swpos) { 
$('frgt').style.display='none'
$("email").value="";
$("pwd").value="";
$("lger").innerHTML="";
var div=$('lg')
if(redrct!=null){
    $("redrct").value= redrct;
}
if(swpos==""||swpos=='alrdy') {
    $("swpos").value= swpos
    $("redrct").value= "refer";
}
if(swpos==""||swpos=='thkrv') {
    $("swpos").value= swpos
    $("redrct").value= "thkrv";
}
if(div==null)
return
div.style.display='block'
if(swpos!='remXY'){
var y = getScrollXY()[1];
div.style.position="absolute"
div.style.left=e.clientX+'px'
div.style.top=e.clientY+y+'px'
$("X").value= e.clientX
$("Y").value= e.clientY+y
} else {
div.className='lgnpopup';
}
if($("swpos").value == 'alrdy' || $("swpos").value  == 'thkrv'){
div.className='loginpop';
}
$("email").focus();
}
function clslog (id) {
$(id).style.display = "none";
}
function logval(emand,ewrng,pmand,eexist){
$('lgimg').style.display='block'
val= false;
valmsg="";
var redrct = $("redrct").value != "" ? $("redrct").value :null;
var email = $("email").value;
var pwd = $("pwd").value;
if(email==""){
valmsg+=emand;
val=true;
}else if(!isEmailAddressValid(email)){
valmsg+=ewrng;
val=true;
}if(pwd==""){
valmsg+=pmand;
val=true;
}
if(val){
$("lger").style.display='block'
$("lger").innerHTML=valmsg;
}
if(!val){
var ajax=new sack();
var url = contextPath+"/login.html?email="+escape(email)+"&pwd="+escape(pwd);
if(redrct != null){
url = contextPath+"/login.html?email="+escape(email)+"&pwd="+escape(pwd)+"&redrct="+redrct;
}
if($('rid')!=null&&$('cname')!=null&&$('colid').value){
url = contextPath+"/login.html?email="+escape(email)+"&pwd="+escape(pwd)+"&redrct="+redrct+"&rid="+escape($('rid').value)+"&cname="+escape($('cname').value)+"&cid="+escape($('colid').value);
}
ajax.requestFile= url; 
ajax.onCompletion = function(){
if(ajax.response == "invalid") {
$("lger").style.display='block'
$("lger").innerHTML=eexist;
}else if(redrct!=null&&(redrct=='thkrv'||redrct=='refer')){
self.location=ajax.response;
}else{
$("lg").style.display='none';
$("headtop").innerHTML = "";
$("hdrid").innerHTML = "";
var rsp = ajax.response;
var crscount = rsp.substring(rsp.indexOf("success#") + 8,rsp.length);
if(crscount != "null" && trim(crscount) != '') {;$("bascol").innerHTML = crscount.split('-')[0];$("bascrs").innerHTML = crscount.split('-')[1];}
$("headtop").innerHTML = trim(ajax.response.substring(0,ajax.response.indexOf("success#")));
var brN=navigator.appName
if(brN =='Microsoft Internet Explorer')
$('src').style.marginTop='-17px'
}
}
ajax.runAJAX();
}
$('lgimg').style.display='none'
return val}
/**Check email id is in valid format*/
function isEmailAddressValid(str){
var c,count,domain
validEmailChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_@.-`"
validEmailDotChar="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890."
sty=stripCharsInBag(str,validEmailChars)
if(sty !=""){
return(false)}
if(str.length<5){
return(false)}
if(countOccurances(str,"@")==0 || countOccurances(str,"@")>1){
return(false)}
var mailid=str.split("@")
if(mailid[1].indexOf("..")!=-1){
return(false)}
var dlen=mailid.length
for(var i=0;i<dlen;i++){
var c=mailid[1].charAt(i)
if(validEmailDotChar.indexOf(c)==-1){
return false}}
if(countOccurances(str,".")==0){
return(false)}
if(((str.length-str.lastIndexOf("."))>7)||((str.length-str.lastIndexOf("."))<3)){
return(false)}
if(str.charAt(str.indexOf("@")+1)=="_"){
return(false)}
if(str.charAt(str.indexOf("@")+1)=="."){
return(false)}
return(true)}
function countOccurances(str,chr){
var count=0
for(incr=0;incr<str.length;incr++){
if(chr==str.charAt(incr))count++}
return count}
function stripCharsInBag(sty2,bag)
{var i
var returnString=""
for(i=0;i<sty2.length;i++)
{var c=sty2.charAt(i)
if(bag.indexOf(c)==-1)returnString+=c}
return returnString}
function hdlgpd(){
$("lg").style.display='none';
}
function frgtpwd(emerrr, emwrong){
var eval= $("femail").value;
valmsg="";
val=false
if(eval==""){
valmsg+=emerrr;
val=true;
}else if(!isEmailAddressValid(eval)){
valmsg+=emwrong;
val=true;
}
if(val){
$("frgter").style.display='block';
$("frgter").innerHTML=valmsg;
}
if(!val){
var ajax=new sack();
var url = contextPath+"/forgot.html?email="+escape(eval);
ajax.requestFile= url; 
ajax.onCompletion = function(){
rstspt = ajax.response;
rst=rstspt.split("#");
if(rst[0] =="0"){
$("frgter").style.display='block';
$("frgter").innerHTML=rst[1];
} else {
$("frgter").style.display='none'
$("frgter").innerHTML= '';
$('frgtint').style.display='none'
$('frgtout').style.display='block'
$("frtsuc").innerHTML=rst[1];
}}
ajax.runAJAX();}}
function frgtlog(obj, e) { 
$("lg").style.display="none"
$('frgtint').style.display='block'
$('frgtout').style.display='none'
$("femail").value="";$("frgter").innerHTML="";
var div=$('frgt')
if(div==null)
return
if($("X").value != "")  {
div.style.display='block'
div.style.position="absolute"
div.style.left=$("X").value+'px'
div.style.top=$("Y").value+'px'
} else {
div.style.display = 'block'
div.className='lgnpopup';
}
$('femail').focus();
}
function clsog(e){
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
i= targ.id;
if((i=='' || i=='nav')){
$("lg").style.display='none'
$("frgt").style.display='none'
}
if($('pmesclg')!=null){$('pmesclg').style.display = 'none';$('pmesclg').id ="pmesclg"; }
if($('pmescrs')!=null){$('pmescrs').style.display = 'none';$('pmescrs').id = "pmescrs";}
if($('pmesclg1') != null) {$('pmesclg1').id = "pmesclg";}
if($('pmescrs1') != null) {$('pmescrs1').id = "pmescrs";}
}
function shortlist(sourceId, sourceType,obj,event,cid,rfrsh) 
{
  if(sourceId != null && sourceType != null) 
  {   
    var ajaxObj = new sack();
    var tmes;
    ajaxObj.requestFile = contextPath+"/addshortlist.html?sid="+sourceId+"&action="+sourceType +"&cid=" +cid;        
    ajaxObj.onCompletion = function(){updateResponse(ajaxObj, sourceId, sourceType,rfrsh) };
    if('O' == sourceType) {
     if(rfrsh==null){
    var y = getScrollXY()[1];
    $("pmescrs").style.position="absolute";
    $("pmescrs").style.left = (event.clientX - 25) +'px';
    $("pmescrs").style.top = (event.clientY+y - 65) +'px';
    $("pmescrs").style.display = 'block';
    tmes = setTimeout("$('pmescrs').style.display = 'none';", 4000);
    $("pmescrs").id ="pmescrs1"; 
    }
  } else {    
    if(rfrsh==null){
    var y = getScrollXY()[1];    
    $("pmesclg").style.position="absolute";     
    $("pmesclg").style.left = (event.clientX - 25) +'px';
    $("pmesclg").style.top = (event.clientY+y - 65) +'px';
    $("pmesclg").style.display = 'block';
    tmes = setTimeout("$('pmesclg').style.display = 'none';", 4000);
    $("pmesclg").id = "pmesclg1";
  }
  }
   blink();
   ajaxObj.runAJAX();
  }
  
}

var t1,t2,t3;
function blink(){
    
    var time = 1000;
    t2 = setTimeout("$('fbasket').className = 'fltbskt'", time-200);
    t1 = setTimeout("$('fbasket').className = 'orgfltbskt';", time);    
    t3 = setTimeout("blink()", 1000); 
    clgcrscount();
//    if(ii == 4){
//       clearTimeout(t1);
//       clearTimeout(t2);
//      clearTimeout(t3);
//        $('fbasket').className = 'fltbskt';
//        ii = 0;
//        return;
//    }
  
}
function stopBlink(){
    clearTimeout(t1);
    clearTimeout(t2);
    clearTimeout(t3);
}
function clgcrscount(){
 var counts = get_cookie("HCI_CN");     
  if(counts != null) {
    var count = counts.split("-");  
    var clgcurcnt = count[1];
    var crscurcnt = count[2];    
  } else {
    var clgcurcnt = 0;
    var crscurcnt = 0;
  }
  $('loadbas').style.display='none';
 // alert(counts);
  if(bascnt == 0 || clgcurcnt != clgcnt || crscurcnt != crscnt) {
  //alert("I am here");
    clgcnt = clgcurcnt;
    crscnt = crscurcnt;
    if(clgcurcnt!=null && clgcurcnt!="null"){
        tcnt = parseInt(clgcurcnt);
    }
    if(crscurcnt!=null && crscurcnt!="null"){
        tcnt = tcnt + parseInt(crscurcnt);
    }
    $('clgpopcnt').innerHTML ='('+clgcurcnt+')';
    $('crspopcnt').innerHTML ='('+crscurcnt+')';
    $('tcount').innerHTML = '('+tcnt+')';
    bascnt = 1;
    
    var ajax=new sack();
    ajax.method ="GET"
    ajax.requestFile = contextPath+"/showshortlistpod.html"
    
    ajax.onCompletion = function(){
    $('loadbas').style.display='none';   
    var result = ajax.response.split('|||');
      if(result[0]!= null) {
        $('unilst').innerHTML = result[0];
      }
      if(result[1]!= null) {
        $('crslst').innerHTML = result[1];
      }    
       if(result[2]!= null) {         
        $('crslst').innerHTML = $('crslst').innerHTML + result[2];
        $('clg1').style.display = 'none';
        $('crs1').style.display = 'none';
      } 
    }
    ajax.runAJAX(); 
    if(clgcurcnt!= '0'){
        $('clg1').style.display = 'block';      
    }
    if(crscurcnt!= '0'){
        $('crs1').style.display = 'block';      
    }
  }
}
function updateResponse(ajaxObj, sourceId, sourceType,rfrsh)
{
  responseText = ajaxObj.response;
  /*if(responseText == '') 
  {
    alert(ajaxObj.response);
  }  */
  if(responseText == 'DUPLICATE_ITEM_ADDED') 
  {
    alert("Your choice is already in your shortlist. Please add a different one.");
  }
   else if(responseText == 'MAX_LIMIT_REACHED') 
  {
    alert("Your have reached your maximum shortlist limit.");
  }
  else 
  {
    if('O' == sourceType) 
    {
        var array = responseText.split("#");
        $("bascrs").innerHTML = array[1];
        responseText = array[0];       
    }  
		if($("bascol") != null){
        $("bascol").innerHTML = responseText;
		}
    if(rfrsh!=null && rfrsh =='Y'){
    location.href=contextPath+"/showshortlist.html?show=clg";
  }
  }  
  //return false;
}
function get_cookie (cookie_name)
{  
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
  if (results )
    return ( unescape ( results[2] ) );
  else
    return null;
}
function getBasketCount(){
  var counts = get_cookie("HCI_CN");  
  if(counts != null) {
    var count = counts.split("-");
    if($('bascol') != null) {
      $('bascol').innerHTML = count[1];
      if($('podbascol1') != null) {
        $('podbascol1').innerHTML = count[1];        
      }
       if($('podbascol2') != null) {
        $('podbascol2').innerHTML = count[1];        
      }
    }
    if($('bascrs') != null) {
      $('bascrs').innerHTML = count[2];
        if($('podbascrs1') != null) {
          $('podbascrs1').innerHTML = count[2];
        }
        if($('podbascrs2') != null) {
          $('podbascrs2').innerHTML = count[2];
        }
    }
  } else {
    $('bascol').innerHTML = 0;
      if($('podbascol1') != null) {
        $('podbascol1').innerHTML = 0;
      }
      if($('podbascol2') != null) {
        $('podbascol2').innerHTML = 0;
      }
    $('bascrs').innerHTML = 0;
    if($('podbascrs1') != null) {
      $('podbascrs1').innerHTML = 0;
    }
    if($('podbascrs2') != null) {
      $('podbascrs2').innerHTML = 0;
    }
  }
}
function deSelectAll(type,show,hide) {
var checkboxes = document.getElementsByTagName("input");
for(i=0;i<checkboxes.length;i++) {
if(checkboxes.item(i).attributes["type"].value == "checkbox") {
checkboxes.item(i).checked = false;
}
}
$('cmpType').value = type;
$(show).style.display = '';
$(show + "ol").style.display = '';
$(hide).style.display = 'none';
$(hide + "ol").style.display = 'none';
getBasketCount();
return true;
}
function validateCompare() {
var count = 0;
var checkboxes = document.getElementsByTagName("input");
for(i=0;i<checkboxes.length;i++) {
  if(checkboxes.item(i).attributes["type"].value == "checkbox") {
    if(checkboxes.item(i).checked){
      count++;
    }
  }
  }
  var cmpType = $("cmpType").value;
  if(count < 2) {
    if(cmpType == 'C') {
      alert($('clglowcnt').value);
    } else if(cmpType == 'O') {
      alert($('crslowcnt').value);
    }    
    return false
  }   
  else if(count > 4) {    
    if(cmpType == 'C') {
      alert($('clghighcnt').value);
    } else if(cmpType == 'O') {
      alert($('crshighcnt').value);
    } 
    return false;
  }
  return true;
}
function showCompare(show,hide){
  if($(show + "ol") != null) {
    $(show + "ol").style.display = '';
  }
  if($(hide + "ol") != null) {
    $(hide + "ol").style.display = 'none';
  }
  getBasketCount();
}
function addCompare(position,status,obj,id){  
  if(obj.value != '0') {
    var cvalues = $(id).value.substring(1,$(id).value.length);  
    var values = cvalues.split("-");
    var collegeIds = "";
    if(status == 'R') {
      for(var i = 0; i < values.length; i++) {
        if(i == position) {        
          if(collegeIds == "") {
            collegeIds =  obj.value + "-";
          } else {
            collegeIds =  collegeIds + obj.value + "-";
          }
        } else {
           if(collegeIds == "") {
            collegeIds = values[i] + "-";
           } else {
            collegeIds = collegeIds + values[i] + "-";
           }        
        }
      }
      collegeIds = collegeIds.substring(0,collegeIds.length - 1);
    } else {
      collegeIds = cvalues + "-" + obj.value;
    }    
    $(id).value = collegeIds;  
    $("compareAction").submit();
  }
}
function getScrollXY() {
var x = 0, y = 0;
if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
y = document.body.scrollTop;
x = document.body.scrollLeft;
}else if(document.documentElement&&( document.documentElement.scrollLeft||document.documentElement.scrollTop)){
y = document.documentElement.scrollTop;
x = document.documentElement.scrollLeft;
}
return [ x, y ];
}
function submitenter(e,emerr, wrem){
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13){
frgtpwd(emerr,wrem)
return false;
}
else {
    return true;
}

}
function showSub(pos){ 
  if($('subsec' + pos).style.display == 'none') {   
    $('subsec' +  pos).style.display = 'block';
  } else {
    $('subsec' + pos).style.display = 'none';
  }
 }
function showlevel(pos){
  if($('levelsec' + pos).style.display == 'none') {   
    $('levelsec' +  pos).style.display = 'block';
  } else {
    $('levelsec' + pos).style.display = 'none';
  }
}
function gtqualnm(val,dis){
document.getElementById('enquiryqid').value = document.getElementById("proqId").options[document.getElementById("proqId").options.selectedIndex].text;
if(document.getElementById('enquiryqid').value =="EFL"){
document.getElementById('efllvl').style.display='block';
document.getElementById("eflprocId").selectedIndex = 0;
document.getElementById('sublvl').style.display='none';
}else{
if(dis=="show"){
if($("efllvl")){
document.getElementById('efllvl').style.display='none';
}
if($("procId")){
$("procId").disabled="";
}
if($("sublvl")){
document.getElementById("sublvl").style.display="block";  
}
var qual= document.getElementById("proqId").value;
var arr = qual.split("#");
var qualId = arr[1];
var collegeId = document.getElementById("sccId").value;
var profileId = document.getElementById("profileId").value;
var courseId = document.getElementById("courseId").value;
var subOrderId=document.getElementById("subOrderItemId").value;
if(document.getElementById("procId")!=null)
{
loadSubjectList(collegeId, qualId, profileId, courseId,subOrderId);
}
}
}
}

var objXMLHttp=null, request=null;
function GetXmlHttpObject(){
        if (window.XMLHttpRequest){
                        objXMLHttp=new XMLHttpRequest();
        }else if (window.ActiveXObject){
                    objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    return objXMLHttp;
}

function loadSubjectList(collegeid, studylevel, pid, courseId,subOrderItemid) {
    request=GetXmlHttpObject();
    var url = contextPath+"/enquiry.html?ajax=true&cId="+collegeid+"&qId="+studylevel+"&kId="+pid +"&courId"+courseId+"&subId="+subOrderItemid;
    request.open("POST",url,true);
    request.send(null);  
    request.onreadystatechange = function(){ 
    if(request.readyState==4){
      if(request.status==200){   
         if(request.responseText){                  
             var x=request.responseText; 
             var arr = request.responseText.split("#"); 
             var cnt =0;  
             if(arr!="" && arr.length > 0){     
                document.getElementById("sublvl").style.display="block";
                document.getElementById("procId").options.length = 1;  
                for(var i=0; i<arr.length; i++) {
                var cat = arr[i].split("~");
                document.getElementById("procId").options[cnt] = new Option(cat[0],cat[1]);                
                cnt++;
                }  
             }
         }
      }
   }   
 }
}

function getqualnm(){
document.getElementById('enquiryqid').value = document.getElementById("proqId").options[document.getElementById("proqId").options.selectedIndex].text;
}

function gtsubnm(id){
//document.getElementById('enqcatgyName').value = document.getElementById("procId").options[document.getElementById("procId").options.selectedIndex].text;
document.getElementById('enqcatgyName').value = document.getElementById(id).options[document.getElementById(id).options.selectedIndex].text;
}
function showCnt(cnt){  
  if($('cntdt'+cnt).style.display == 'none') {$('cntdt'+cnt).style.display='block'} else {$('cntdt'+cnt).style.display='none'}  
}
function qulCnt(cnt) {
  if($('quldt'+cnt).style.display == 'none') {$('quldt'+cnt).style.display='block'} else {$('quldt'+cnt).style.display='none'}
}
function enqomniture(pagename, cId){

var affId = $("affId").value;
var s_account="hotcourseschinaprod";
//var s_account="hotcourseschinadev"
if(affId != null && affId=="230709") {
  s_account="hotcourseshongkongprod";
}
if(affId != null && affId=="60809") {
  s_account="hotcoursestaiwanprod";
}
if(affId != null && affId=="70809") {
  s_account="hotcoursesjapanprod";
}
var s=s_gi(s_account)
s.eVar33=s.prop33="";
s.eVar34=s.prop34=s.pageName=pagename
s.server=serverName;
s.channel=hurl
s.hier1=hier1
s.prop32=cId
if(pagename!="enquiry-lightbox") {
  s.events="event13"; 
  s.prop33="H.ES.AC."+cId;
}
var s_code=s.t();if(s_code)document.write(s_code);
}
function setPropsValue(position, pageno, domainname){ 
var respos = position;
if(pageno != "1")
respos = ((pageno-1)*10)+parseInt(position);
Set_Cookie("Scposition", respos, 30, '/', domainname,"")
}
function Set_Cookie( name, value, expires, path, domain, secure){
var today = new Date();
today.setTime( today.getTime() );
if ( expires ){
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function openQuest(){
var filename = "/jsp/scholarship/bondInfoPopup.jsp";
window.open (contextPath + filename,"mywindow","scrollbars=no,resizable=no,width=300,height=300"); 
}
function popBasket(){
    stopBlink();
    clgcrscount();
  if(bascnt == 0) {
     $('stbox').style.display='block';
     $('stbox').style.visibility='visible';
     $('loadbas').style.display='block';
     $('fbasket').className = 'ofltbskt';
  } else {
    $('stbox').style.display='block';
    $('stbox').style.visibility='visible';
    $('loadbas').style.display='none'; 
    $('fbasket').className = 'ofltbskt';
  }
}
function hideBasket(){ 
  $('loadbas').style.display='none';
  $('stbox').style.display='none';  
  $('stbox').style.visibility='hidden';
  $('fbasket').className = 'fltbskt';
}
function showpopbasket(showlink,showdiv,hidelink,hidediv){
  $(showlink).className = 'active';
  $(hidelink).className = '';
  $(showdiv).style.display = 'block';
  $(hidediv).style.display = 'none';
}
function opnlgtbx(cId, kId, vId, eflflag){
$("load").style.display = "block";
$('fade').style.display='block'
$('fade').style.height = document.body.offsetHeight
$("ccId").style.display = 'none';
$("qId").style.display = 'none';
$("cId").style.display = 'none';
//$("regId").style.display = 'none';
var ajax=new sack();
var uri = null;
var ref = null;
var URL =contextPath+"/videolightbox.html?cId="+cId+"&kId="+kId+"&pgnm=COURSE_SEARCH&vId="+vId+"&eflflag="+eflflag;
ajax.requestFile = URL;
ajax.onCompletion = function(){
$('light').style.display='block';
$("light").innerHTML = ajax.response
document.getElementById("load").style.display = "none";
}
ajax.runAJAX();
}
function articlePlayer(videoPath,imgPath)
{
  $('fade').style.display='block'
  $('fade').style.height = document.body.offsetHeight
  var ajax=new sack(); 
  var URL =contextPath+"/jsp/common/articleVideoPlayer.jsp?fileName="+videoPath;  
  ajax.requestFile = URL;
  ajax.onCompletion = function(){
    $('light').style.display='block';
    $("light").innerHTML = ajax.response
    document.getElementById("load").style.display = "none";
  }
  ajax.runAJAX();
}

function closepop(){
$("flashbanner").innerHTML = "" 
$("load").style.display = "none";
$('fade').style.display='none'
$('light').style.display='none'
$("ccId").style.display = 'block';
$("qId").style.display = 'block';
$("cId").style.display = 'block';
//$("regId").style.display = 'block';
}
function showcrosslink(){
  if($('crslnk').style.display == "none") {
    $('crslnk').style.display = 'block';    
  }else {
    $('crslnk').style.display = 'none';    
  }
}
/**
* Custom scipt to add listeners for swf video player
* please refer "http://developer.longtailvideo.com/trac/wiki/FlashEvents#Viewevents" for types of event listeners available
*/
// this scenario works well if you have only one player for a page
var mPlayer;
function playerReady(obj) {
 if(obj && obj != null){
    mPlayer = $(obj['id']);
  }
}
function addListeners(eve, funt){
     try{
        if(mPlayer){
          mPlayer.addControllerListener(eve, funt);
          
        }else{
          setTimeout("addListeners('" + eve + "','" + funt + "')", 100);
        }
      }catch(e){
        setTimeout("addListeners('" + eve + "','" + funt + "')", 100);
      }
}

function changeOrder(obj, end) {
    action =  contextPath+$('url').value+obj.value+"/1/"+end+".html";
    $('sidemap').action  = action;
    $('sidemap').submit();
}
function getRegionList(cntid) {         
    document.getElementById("instName").value = document.getElementById("sdef").value;
    if(cntid=="0") {
        document.getElementById("regId").options.length = 1;
    }
    if(cntid != null && cntid!="0") {      
        var url = contextPath+"/search-panel.html?cntid="+cntid;        
        var ajax=new sack();
        ajax.method = "GET";
        ajax.requestFile=url;
        ajax.onCompletion=function(){getListData(ajax);}
        ajax.runAJAX(); 
    }
  }
  function getListData(ajax) {
    var regiondata = ajax.response.split("#");    
    document.getElementById("regId").options.length = 1;
    var cnt =1;
    for(var i=0; i<regiondata.length; i=i+2) {
      document.getElementById("regId").options[cnt] = new Option(regiondata[i+1],regiondata[i]);
      cnt++;
    }
  }
  function catbg(bg,obj) {
    obj.className = bg;  
  }
  function rankorderby(cobj) {
    var obj = cobj.href.split("/")
    if(obj.length == 10){
       val  = "http://"+obj[2]+"/"+obj[3]+"/"+obj[4]+"/"+obj[5]+"/"+obj[6]+"/"+obj[8]+"/"+obj[9]
       self.location = val;
    } else {
        self.location=cobj.href
    }
  } 
  function geodisply(geo){
        if(geo !="null" && geo != 'done'){
         var url = contextPath+"/jsp/common/geoTarget.jsp";       
        var ajax=new sack();
        ajax.requestFile=url;
        ajax.onCompletion=function(){
        if(trim(ajax.response) != "")
        {
            $("geoheader").style.display="block";
        }
        
        $("geoheader").innerHTML = ajax.response}
        ajax.runAJAX(); 
    }else {
        $("geoheader").style.display="none";
    }
  }
  function swaptab(id)
{
var idsarray=new Array("sprofile","eflpro","lprofile")
var liarrays=new Array("sprof","efltab","lprof")
	for (var i=0;i<idsarray.length;i++)
	{
	 if(idsarray[i]==id)
	 {
	  if(document.getElementById(idsarray[i])!=null)
		{
		 document.getElementById(idsarray[i]).style.display="block";
		 document.getElementById(liarrays[i]).className ="active";
    }
	 }
	 else
	 {
	  if(document.getElementById(idsarray[i])!=null)
		{
		 document.getElementById(idsarray[i]).style.display="none";
	   document.getElementById(liarrays[i]).className ="";
		}
	 }
	}
}

  function swaptabs(id)
{
var idsarray=new Array("event","newscnt")
var liarrays=new Array("evt","news")

	for (var i=0;i<idsarray.length;i++)
	{
	 if(idsarray[i]==id)
	 {
	  if(document.getElementById(idsarray[i])!=null)
		{
		 document.getElementById(idsarray[i]).style.display="block";
		 document.getElementById(liarrays[i]).className ="active";
    }
	 }
	 else
	 {
	  if(document.getElementById(idsarray[i])!=null)
		{
		 document.getElementById(idsarray[i]).style.display="none";
	   document.getElementById(liarrays[i]).className ="";
		}
	 }
	}
document.getElementById((idsarray[i])).style.display="block";
document.getElementById((liarrays[i])).className ="active";
}
  function getTwittes(scrname) {    
    $('twit').innerHTML = "<img src='/6/img/layout/loading.gif' class='load' />";
    var ajax=new sack();
    ajax.requestFile = contextPath+"/twitter.html?scrname="+scrname;
    ajax.onCompletion = function(){parseXML(ajax.response);}
    ajax.runAJAX();    
    
  }
  function parseXML(xmlData) {  
    try {        
        var text = xmlData.split('#@#@$');
        if(text != null && text != ""){
          var twittes = '';
          for(var i = 0; i< 10; i += 2) {          
            twittes +=  '<li><span class="nws">' + text[i] + '</span><span class="date">' + text[i + 1] + '</span></li>';
          }
           $('twit').innerHTML = twittes;
        }else{
         $('twit').innerHTML = "";
        }
    } catch(e) {
        alert(e);
    }   
  }
   function qualsort(curl) {
    var url = curl.value;        
    if(url != "0") {
        document.location.href = url;
    }
    return false;
    }
    
function floatopen(){
  var counts = get_cookie("HCI_CN");     
  if(counts != null) {
    var count = counts.split("-");  
    var clgcurcnt = count[1];
    var crscurcnt = count[2];    
  } else {
    var clgcurcnt = 0;
    var crscurcnt = 0;
  }
  $('colbstcnt').innerHTML ='('+clgcurcnt+')';
  $('crsbstcnt').innerHTML ='('+crscurcnt+')';
  var ajax=new sack();
  ajax.requestFile = contextPath+"/showshortlistpod.html"
  ajax.onCompletion = function(){
    var result = ajax.response.split('|||');
    if(result[0]!= null) {
      $('unibskt').innerHTML = result[0];
    }
    if(result[1]!= null) {
      $('crsbskt').innerHTML = result[1];
    }
  }
  ajax.runAJAX();
	$('floatbskt').style.display = 'block';
	$('fbasket').className = 'ofltbskt';
}
function floatclose(){
	$('floatbskt').style.display = 'none';
	$('fbasket').className = 'fltbskt';
}
 
function clearAutoCategory() {
  $("catName").value="";
  $("catId").value="";
}
function enqclose() {
  $("enqlight").style.display="none";
  $("fade").style.display="none";
  if($("flashbanner")!= null) {
    $("flashbanner").style.display ="block";
  }
  
  $("ccId").style.display ="block";
  $("qId").style.display ="block";
  $("cId").style.display ="block";
  if($('cntyinst')){
  $('cntyinst').style.display = 'block';
  $('agprv').style.display = 'block';
  $('agttwn').style.display = 'block';
  }
//  $("regId").style.display ="block";
}

function getEFlCountryList(obj) {
  if(obj.value=="99") {
    $("searchmode").value="EFL";
    var url = contextPath+"/fetchAjaxList.html?type=country";
    var ajax=new sack();
    ajax.requestFile=url;
    ajax.onCompletion=function(){getAjaxData(ajax);}
    ajax.runAJAX();
  } else {
    if(obj.value=="18") {
    $("searchmode").value="PW";
    }else{
    $("searchmode").value="COURSE";
    }
    $("ccId").style.display="block";
    $("catName").style.display="inline";
    $("eflcnty").style.display="none";
    $("ctype").style.display="none";
  }
  }
  function getAjaxData(ajax) {
    var ajaxdata = ajax.response.split("$$");
    //Country
    var regiondata = ajaxdata[0].split("##");
    $("ccId").style.display="none";
    $("eflcnty").style.display="block";
    $("eflcnty").options.length = 1;
    var cnt =1;
    for(var i=0; i<regiondata.length; i=i+2) {
      $("eflcnty").options[cnt] = new Option(regiondata[i+1],regiondata[i]);
      cnt++;
    }
    //CourseType
    var coursedata = ajaxdata[1].split("##");
    $("catName").style.display="none";
    $("ctype").style.display="block";
    var cnt =1;
    for(var i=0; i<coursedata.length; i=i+2) {
      $("ctype").options[cnt] = new Option(coursedata[i+1],coursedata[i]);
      cnt++;
    }
  }
  
  
function generateHtmlCode(siteURL)
{     
  if(window.XMLHttpRequest)
    request=new XMLHttpRequest()
  else if(window.ActiveXObject)
    request=new ActiveXObject("Microsoft.XMLHTTP")    
    //var url="http://" + siteURL + ":8989/6/ajaxwidget.html?type=display";      
    var url="http://" + siteURL + "/6/ajaxwidget.html?type=display";  
    request.onreadystatechange=function() {
      if(request.readyState==4) {
        if(request.status==200) {          
          document.getElementById("widgetcode").value = request.responseText;
        }
      }
    }
    request.open("POST",url,true);
    request.send(url);
} 


function showPost(head,post)
{  
  if(document.getElementById(post).style.display=="none")
  {          
    document.getElementById(head).className = "active";     
    document.getElementById(post).style.display="block";
  }else{       
    document.getElementById(head).className="none";
    document.getElementById(post).style.display="none";
  }
}  
  
function mBrowse(divId){
if(document.getElementById(divId).style.display=="none"){
document.getElementById(divId).style.display="block";
}else{
document.getElementById(divId).style.display="none";
}
}

function getShareUrl(userid,title123,webid,share){
var url123=document.location.href;
var surl="http://www.jiathis.com/"+share+"/?";
if(share=="share")
{
var shareurl=surl+"uid="+userid+"&url="+url123+"&title="+title123;
window.open(shareurl);
}else{
var shareurl=surl+"uid="+userid+"&url="+url123+"&title="+title123+"&webid="+webid;
window.open(shareurl);
}
}

function hideS(){
	document.getElementById('shareinner').style.display = 'block';
}
function closeS(){
	document.getElementById('shareinner').style.display = 'none';
}

function getAddThisUrl(username,title123,webid)
{
var browser_url=document.location.href;

if(webid=="share")
{
var surl="http://api.addthis.com/oexchange/0.8/offer?";
var shareurl=surl+"username="+username+"&url="+browser_url+"&title="+title123;
window.open(shareurl);
}else{
var surl="http://api.addthis.com/oexchange/0.8/forward/"+webid+"/offer?";
var shareurl=surl+"username="+username+"&url="+browser_url+"&title="+title123;
window.open(shareurl);
}
}

//For Hide and collapse

function showdata(show)
{
if(document.getElementById(show).style.display=='none')
{
document.getElementById(show).style.display='block';
}else{
document.getElementById(show).style.display='none';
}
}

function cpeWebClick(obj,afflId,collegeId,countryId,subOrderitemId,weblink,qualId,courseId)
{
    //var s_account="hotcourseschinadev
    var chanel=getChannel(afflId,countryId)
    var splt=chanel.split('-');
    s.linkTrackVars="server,channel,hier1,prop32,prop33,prop34,eVar32,eVar33,eVar34,events";
    s.linkTrackEvents="event14";
    s.events="event14";
    s.prop32=collegeId;
    s.server=document.location.hostname;
    s.channel=splt[0];
    s.hier1=splt[1]; 
    s.eVar32=collegeId;
    s.prop33="H.WC."+collegeId; 
    s.eVar34=s.prop34=s.pageName;
		s.tl(obj,'o', 'webclick:'+ collegeId);
    //stats log for website click
   // if(sname.length>0) {
     // url = sname
    //}
    cpeStatsLog(collegeId,afflId,countryId,subOrderitemId,weblink,qualId,courseId,null,null);
}

function getChannel(aff,countryId)
{
//This is For Channel Array
var chan1 = new Array();
 chan1['260109'] = 'chinese';
 chan1['230709'] = 'hongkongers';
 chan1['60809'] = 'taiwanese';
 chan1['70809'] = 'japanese';
//This is For hierl Array
var country = new Array();
country['9'] = 'australia'; country['168'] = 'singapore'; country['210']= 'uk'; country['211']= 'usa'; country['134']='newzealand'; country['114'] = 'malaysia';
var countryName;
if(countryId==null || countryId=='null')
{
countryName='all';
}else{
countryName=country[countryId];
}
var  hurl="int:"+chan1[aff]+":"+countryName;
var  hier1="int,"+chan1[aff]+","+countryName;
var s=hurl+"-"+hier1;
return s;
}
//This is for Inner Links  script
function hcAdClick(obj,colgId,afflId,sectionId,suborderId,countryId)
{
    var url=queryString(obj,"url")
    var chanel=getChannel(afflId,countryId)
    var splt=chanel.split('-');
    s.linkTrackVars="server,channel,hier1,prop32,prop33,prop34,eVar32,eVar33,eVar34,events";     
    s.linkTrackEvents="event14";         
    s.events="event14";       
    s.prop32=colgId;		
    s.server=document.location.hostname;  
    s.channel=splt[0]; 
    s.hier1=splt[1];  
    s.eVar32=colgId;
     s.prop33="H.WC."+colgId; 
    //alert(s.prop33);
    s.eVar34=s.prop34=s.pageName ; 
    s.tl(obj,'o', 'webclick:'+colgId); 
    cpeStatsLog(colgId,afflId,countryId,suborderId,null,null,null,sectionId,url);
}


function queryString(link,url) {
  var loc = link.search.substring(1, link.search.length);
  var param_value = false;
  if(loc.indexOf('&')!=-1)
  {
  var params = loc.split("&");
  for (i=0; i<params.length;i++) {
      param_name = params[i].substring(0,params[i].indexOf('='));
      if (param_name == url) {
          param_value = params[i].substring(params[i].indexOf('=')+1)
      }
  }
  }else{
    param_name = loc.substring(0,loc.indexOf('='));
    if(param_name ==url)
    {
     param_value = loc.substring(loc.indexOf('=')+1)
    }
  }
  if (param_value) {
      return param_value;
  }
  else {
      return false; //Here determine return if no parameter is found
  }
}

//this function for EFL DBStats logging
function eflWebClick(obj,afflId,collegeId,countryId,webform,courseId)
{
    //var s_account="hotcourseschinadev
    var chanel=getChannel(afflId,countryId)
    var splt=chanel.split('-');
    s.linkTrackVars="server,channel,hier1,prop32,prop33,prop34,eVar32,eVar33,eVar34,events";
    s.linkTrackEvents="event14";
    s.events="event14";
    s.prop32=collegeId;
    s.server=document.location.hostname;
    s.channel=splt[0];
    s.hier1=splt[1]; 
    s.eVar32=collegeId;
    s.prop33="H.WC."+collegeId; 
    s.eVar34=s.prop34=s.pageName;
	  	s.tl(obj,'o', 'webclick:'+ collegeId);
    //stats log for website click
   // if(sname.length>0) {
     // url = sname
    //}
    //statsLog(collegeId,afflId,countryId,subOrderitemId,weblink,qualId,courseId,null,null);
    eflStatsLog(collegeId,afflId,countryId,webform,courseId,null,null,null);
}
//For Efl Stats Log
function eflStatsLog(collegeId,afflId,countryId,webform,courseId,sectionId,keyId,innerlinkurl) { 
var ajax=new sack();
ajax.requestFile = contextPath+"/efllogstats.html?cId="+collegeId+"&conId="+countryId+"&reqAffId="+afflId+"&webform="+webform+"&courseId="+courseId+"&sectionId="+sectionId+"&keyId="+keyId+"&innerlinkurl="+innerlinkurl;
ajax.onCompletion = function(){}
ajax.runAJAX();
}
//This is for efl Inner Links  script
function eflAdClick(obj,colgId,afflId,sectionId,keyId,countryId)
{
    var url=queryString(obj,"url")
    var chanel=getChannel(afflId,countryId)
    var splt=chanel.split('-');
    s.linkTrackVars="server,channel,hier1,prop32,prop33,prop34,eVar32,eVar33,eVar34,events";     
    s.linkTrackEvents="event14";         
    s.events="event14";       
    s.prop32=colgId;		
    s.server=document.location.hostname;  
    s.channel=splt[0]; 
    s.hier1=splt[1];
    s.prop33="H.WC."+colgId; 
   
    //alert(s.prop33);
    s.eVar34=s.prop34=s.pageName ; 
    s.tl(obj,'o', 'webclick:'+colgId);
    eflStatsLog(colgId,afflId,countryId,null,null,sectionId,keyId,url);
}


function sendPostEnquiry()
  {
    count=$("post_count").value;
    var checked = true;
    for(var i=1; i<parseInt(count); i++) { 
      if(document.getElementById("ch"+i).checked==true) {
        checked = false;
      }
    }
     if(checked) {
      msg = $("post_msg").value;
       return false;
     }
   }

function cpeEnquiry(cId, courId, depnm, catId, kywd, countryId, qId, kId, obj,email,advertName,whatProfile,subId, cpeFlag) {
$("load").style.display = "block";
$('fade').style.display='block'
$('fade').style.height = document.body.offsetHeight
$("ccId").style.display = 'none';
$("qId").style.display = 'none';
if(window.XMLHttpRequest)
request=new XMLHttpRequest()
else if(window.ActiveXObject)
request=new ActiveXObject("Microsoft.XMLHTTP")
url=contextPath+"/enquiry.html?cId="+cId+"&depnm="+depnm+"&courId="+courId+"&catId="+catId+"&kywd="+replaceAll(kywd,"-","%20") +"&countryId="+countryId+"&qId="+qId+"&kId="+kId+"&email="+email+"&advertName="+advertName+"&whatProfile="+whatProfile+"&subId="+subId+"&cpeFlag="+cpeFlag;
request.onreadystatechange=function(){
    if(request.readyState==4){
        if(request.status==200){
            var weblinks = request.responseText.split("#@#@#@");
           if(weblinks[1]!=null){
                weblnk = weblinks[1];
                window.location.href= weblnk;
             }else {
                showEnquiry(request.responseText, cId);
             }
        }
    }
}
request.open("POST",url,true)
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
request.send(null)
}
      
function prospectusenquiry(collegeId, affiliateId, keyword, categoryCode, qualLevel, countryId, courseId, profileKeyId) {
$("load").style.display = "block";
$('fade').style.display='block';
$('fade').style.height = document.body.offsetHeight;
$('ccId').style.display = 'none';
$('qId').style.display = 'none';
if(window.XMLHttpRequest)
request=new XMLHttpRequest()
else if(window.ActiveXObject)
request=new ActiveXObject("Microsoft.XMLHTTP")
url=contextPath+"/prospectusenquiry.html?collegeId="+collegeId+"&affiliateId="+affiliateId+"&keyword="+keyword+"&categoryCode="+categoryCode+"&qualLevel="+qualLevel+"&countryId="+countryId+"&courseId="+courseId+"&profileKeyId="+profileKeyId;
request.onreadystatechange=function(){
    if(request.readyState==4){
        if(request.status==200){
            var weblinks = request.responseText.split("#@#@#@");
           if(weblinks[1]!=null){
                weblnk = weblinks[1];
                window.location.href= weblnk;  
             }else {
                showprospectusEnquiry(request.responseText);
             }
        }
    }
}
request.open("POST",url,true)
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
request.send(null)
}

function showprospectusEnquiry(pages) {
if($("flashbanner")!= null) {
$("flashbanner").style.display ="none"
}
if($('load') !=  null)
$('load').style.display='none';
$('enqlight').style.display='block';
$("enqlight").innerHTML = pages;
var c_data = get_cookie("pros_enq");
/*if(c_data != null) {
  var c_text = c_data.split("azw-wza");
  if(c_text[0] != null){
  $('enquiryName').value = c_text[0];
  }
  if(c_text[1] != null ){
  $("emailId").value = c_text[1];   
  }
 }*/
}

function valdownloadpros(obj, namtxt, namemsg, emptyemail, invalidemail, termsmsg){
var msg = "";
var chk=true;
if($("prospenquiryName").value == namtxt || $("prospenquiryName").value.length == 0){
msg = msg + namemsg + "<br />";
}
if($("emailId").value != null && $("emailId").value != ""){
if(!isEmailAddressValid($("emailId").value)){
msg  = msg + invalidemail + "<br />";
}
}else{
msg  = msg + emptyemail + "<br />";
}
if($("terms").checked == false){
msg = msg + termsmsg + "<br />";
}
if(msg.length >0 ) {
$("ncreview").style.display = "block";
$("err").innerHTML = msg;
chk = false;
}else{
$("err").innerHTML = "";
var dpPath = "//www.hotcoursesinternational.com/6";
var afflId=$("dlafflId").value;
var countryId=$("dlcnId").value;
var collegeId=$("dlpId").value;
cpeDownloadProspectus(obj,afflId,collegeId,countryId);var a='s.tl(';
$("enqid").action = dpPath+"/sendprospectusenquiry.html?type=sendprospectusenquiry&afflId="+afflId;
$("enqid").target='_blank';
$("enqid").submit();
$("enquirybtm").disabled = true;
if($('enqlight')!=null){
$('enqlight').style.display="none";
}
if($('fade')!=null){
$('fade').style.display="none";
}
}
return chk;
}

//This function is to set the auto complete off for the first form
function autocompleteOff(element) {
	self.focus(); //Bring window to foreground if necessary.
	var form = $(element); // grab the form element.
	if(form)
	{
		form.setAttribute("autocomplete","off"); // Turn off Autocomplete for the form, if the browser supports it.
  }
}

function cpeDownloadProspectus(obj,afflId,collegeId,countryId) { 
var chanel=getChannel(afflId,countryId)
    var splt=chanel.split('-');
    s.linkTrackVars="server,channel,hier1,prop32,prop33,prop34,eVar32,eVar33,eVar34,events";
    s.linkTrackEvents="event14";
    s.events="event14";
    s.prop32=collegeId;
    s.server=document.location.hostname;
    s.channel=splt[0];
    s.hier1=splt[1]; 
    s.eVar32=collegeId;
    s.prop33="H.WC."+collegeId;
    s.eVar34=s.prop34=s.pageName;
    s.tl(obj,'o', 'webclick:'+ collegeId);
}


