function load_catlist_content_cattype_aj(num_items,per_page,start_item,category_id,cat_type,sortBy){start_item=start_item?start_item:0;if(category_id>0)document.forms["form2"].elements["cat_id"].value=category_id;else if(document.forms["form2"].elements["cat_id"].value>0)category_id=document.forms["form2"].elements["cat_id"].value;xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.open("POST",'category_listing_aj.php?'+category_id+sortBy,false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('cat_type='+cat_type+'&num_items='+num_items+'&per_page='+per_page+'&start='+start_item+'&category_id='+category_id+'&sortBy='+(sortBy?sortBy:''))}document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;};function load_catlist_content_cattype_aj_alphabet(category_id,firstname,sortBy){xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.open("POST",'category_listing_aj.php?'+category_id+firstname,false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('category_id='+category_id+'&firstname='+firstname+'&sortBy=alphabet')}document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;};function show_full_image(image_id){xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.onreadystatechange=state_change_full_image;xmlhttp.open("POST",'show_full_image_aj.php',false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('image_id='+image_id)}document.getElementById(aid_val).className="inactive1";document.getElementById("last_clicked").value=category_id;document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;};function state_change_full_image(){if(xmlhttp.readyState==4){}};function load_catlist_content_aj(num_items,per_page,start_item,category_id,sortBy){if(category_id>0)document.forms["form2"].elements["cat_id"].value=category_id;else if(document.forms["form2"].elements["cat_id"].value>0)category_id=document.forms["form2"].elements["cat_id"].value;xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.onreadystatechange=state_change_catlist;xmlhttp.open("POST",'category_listing_aj.php',false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('num_items='+num_items+'&per_page='+per_page+'&start='+start_item+'&category_id='+category_id+'&sortBy='+(sortBy?sortBy:''));}aid_val="aid_"+category_id;if(document.getElementById("last_clicked").value!=''){last_aid="aid_"+document.getElementById("last_clicked").value;document.getElementById(last_aid).className="active1";}document.getElementById(aid_val).className="inactive1";document.getElementById("last_clicked").value=category_id;document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;};function state_change_catlist(){if(xmlhttp.readyState==4){}};function category_reset(){document.forms["form2"].elements["cat_id"].value='';};function load_ajax_content_aj(show_type,num_items,per_page,start_item,category_id,user_id,sortBy){if(category_id>0)document.forms["form2"].elements["cat_id"].value=category_id;else if(document.forms["form2"].elements["cat_id"].value>0)category_id=document.forms["form2"].elements["cat_id"].value;if(show_type!='')document.forms["form2"].elements["show_type"].value=show_type;else if(document.forms["form2"].elements["show_type"].value!='')show_type=document.forms["form2"].elements["show_type"].value;if(show_type=='newest')tag_id='tag_newest';else if(show_type=='best_rated')tag_id='tag_bestr';else if(show_type=='my_favourite')tag_id='tag_myf';if(show_type=='my_favourite'&& !user_id){window.location.href='login.php';document.forms["form2"].elements["cat_id"].value='';document.forms["form2"].elements["show_type"].value='';}xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp&&show_type!=''){xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){}};xmlhttp.open("POST",'index_aj.php',false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('show_type='+show_type+'&user_id='+user_id+'&num_items='+num_items+'&per_page='+per_page+'&start_item='+start_item+'&category_id='+category_id+'&sortBy='+(sortBy?sortBy:''))}document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;};function state_change(){if(xmlhttp.readyState==4){}};function show_ad_image1(){document.getElementById('ad_imagediv1').style.visibility='visible';document.getElementById('ad_imagediv1').style.display='block';document.all.img1.src=document.all.image1.value;};function show_ad_image2(){document.getElementById('ad_imagediv2').style.visibility='visible';document.getElementById('ad_imagediv2').style.display='block';document.all.img2.src=document.all.image2.value;};function show_ad_image3(){document.getElementById('ad_imagediv3').style.visibility='visible';document.getElementById('ad_imagediv3').style.display='block';document.all.img3.src=document.all.image3.value;};function show_ad_image4(){document.getElementById('ad_imagediv4').style.visibility='visible';document.getElementById('ad_imagediv4').style.display='block';document.all.img4.src=document.all.image4.value;};function show_ad_image5(){document.getElementById('ad_imagediv5').style.visibility='visible';document.getElementById('ad_imagediv5').style.display='block';document.all.img5.src=document.all.image5.value;};function show_ad_image6(){document.getElementById('ad_imagediv6').style.visibility='visible';document.getElementById('ad_imagediv6').style.display='block';document.all.img6.src=document.all.image6.value;};function show_ad_image7(){document.getElementById('ad_imagediv7').style.visibility='visible';document.getElementById('ad_imagediv7').style.display='block';document.all.img7.src=document.all.image7.value;};function show_ad_image8(){document.getElementById('ad_imagediv8').style.visibility='visible';document.getElementById('ad_imagediv8').style.display='block';document.all.img8.src=document.all.image8.value;};function calculate_monthly_income(group){var total_income_id='total_'+group;var total_income=document.getElementById(total_income_id);var income_id;var income;var cal=parseFloat("0.00");total_income.value="0.00";for(var i=1;;i++){income_id=group+i;income=document.getElementById(income_id);if(!income)break;if(income.value=="")income.value="0.00";cal=parseFloat(total_income.value)+parseFloat(income.value);total_income.value=cal;}var total_monthly_income=document.getElementById("total_monthly_income");var total_housing=document.getElementById("total_housing");var total_transportation=document.getElementById("total_transportation");var total_debt=document.getElementById("total_debt");var total_food=document.getElementById("total_food");var total_clothing=document.getElementById("total_clothing");var total_miscellaneous=document.getElementById("total_miscellaneous");var total_saving=document.getElementById("total_saving");var total_expenses=document.getElementById("total_expenses");total_expenses.value=parseFloat(total_housing.value)+parseFloat(total_transportation.value)+parseFloat(total_debt.value)+parseFloat(total_food.value)+parseFloat(total_clothing.value)+parseFloat(total_miscellaneous.value);total_saving.value=parseFloat(total_monthly_income.value)-parseFloat(total_expenses.value);};function chcek_numeric(e,th){var isIE=(window.event)?1:0;if(isIE){if(e.keyCode<46||e.keyCode>57){e.returnValue=false;}}else{if(e.which<46||e.which>57){if(e.which!=8)e.preventDefault();}}};function enable_field(ths,en_field_id){en_field=document.getElementById(en_field_id);if(ths.checked==true)en_field.disabled=false;};function clear_field(ths,en_field_id){en_field=document.getElementById(en_field_id);if(ths.checked==true){en_field.disabled=true;en_field.value="";}};function print_preview(str){var arg='resizable=no, toolbar=no,location=no,directories=no,addressbar=no,scrollbars=yes,status=no,menubar=no,width=850,height=950,top=20,left=250';window.open(str,"_blank",arg);};function check_agree(){if(document.form1.i_agree.checked==false){alert('You have to agree the terms.');return false;}if(document.form1.i_agree_spouse&&document.form1.i_agree_spouse.checked==false&&document.form1.spouse_name.value!=""){alert('Spouse or co-applicant have to agree the terms if he/she wants to sign.');return false;}return true;};function confirm_delete(){var val;val=confirm("Do you want to delete?");return val;};function set_focus_login(){document.getElementById("name").setfocus=true;};function email_check(){var emailchar=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(emailchar.test(document.getElementById("email").value)){return true}else{alert("Please, enter a valid email address.");}};function show_logo(){document.getElementById('logodiv').style.visibility='visible';document.getElementById('logodiv').style.display='block';document.all.logo.src=document.all.userfile.value;};function show_popup(str){var arg='resizable=yes, toolbar=no,location=no,directories=no,addressbar=no,scrollbars=yes,status=no,menubar=no,width=780,top=20,left=0';window.open(str,"_blank",arg);};function startAjaxIndicator(dv,nt,pp,st,ci,ui,sr){document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif'>";setTimeout("category_reset();load_ajax_content_aj('"+dv+"', '"+nt+"', '"+pp+"', '"+st+"', '"+ci+"', '"+ui+"', '"+sr+"');",30);};function endAjaxIndicator(){document.getElementById('loaderContainer').style.display='none';};function startAjaxIndicator2(nt,pp,st,ci,dv,sr){document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif'>";setTimeout("load_catlist_content_cattype_aj('"+nt+"', '"+pp+"', '"+st+"', '"+ci+"', '"+dv+"', '"+sr+"');",10);};function startAjaxIndicator3(nt,pp,st,ci){document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif'>";setTimeout("load_catlist_content_aj('"+nt+"', '"+pp+"', '"+st+"', '"+ci+"');",30);};function startAjaxIndicatorAlphabet(category,firstname){document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif'>";setTimeout("load_catlist_content_cattype_aj_alphabet('"+category+"', '"+firstname+"');",30);}