﻿// JScript File
function FillCity(strState){
			var div = document.getElementById("divCity");
			var country=document.getElementById('ddlCountry').value;
			var strItems = AjaxFunctions.FillCityfromState(strState,country); 
			if (strState !== "NONE"){
                div.innerHTML = strItems.value;
            }
			else{
			    div.innerHTML = "&nbsp;<input class='text' name=ddlCity id=ddlCity type=text />";
			}
		}	
function CheckCountry(strCountry){
        var ddlState = document.getElementById("ddlState");
        var div = document.getElementById("divCity");
        if (strCountry !== "United States of America"){
            ddlState.selectedIndex = 34;
            ddlState.disabled=true;
            div.innerHTML = "&nbsp;<input class='text' name=ddlCity id=ddlCity type=text />";
        }
        else{
            ddlState.disabled=false;
            ddlState.selectedIndex = 0;
            var div = document.getElementById("divCity");
            div.innerHTML = "<select class='dropdown'></select>";
        }
}
function FillCityfromMAP(strState){
			var div = document.getElementById("divMAP");
			var div1 = document.getElementById("divSelect");
			var div2 = document.getElementById("divSelectS");
			var strItems = AjaxFunctions.FillCityfromStateMAP(strState); 
			div.innerHTML = strItems.value;
			div1.innerHTML = "CLICK ON Your City";
			div2.innerHTML = "CLICK ON Your City";
		}	
function ReturnMAP(){
			var div = document.getElementById("divMAP");
			var div1 = document.getElementById("divSelect");
			var div2 = document.getElementById("divSelectS");
			div.innerHTML = "<img src='i/map.jpg' width='531' height='354' class='map' usemap='#map' />";
			div1.innerHTML = "CLICK ON Your State";
			div2.innerHTML = "CLICK ON Your State";
		}			

function FillItem(strMainCategory, strCategory){
			var div = document.getElementById("divItems");
			var strItems = AjaxFunctions.FillItemfromCategory(strMainCategory,strCategory); 
			div.innerHTML = strItems.value;
		}
function FillCategory(strMainCategory, strType){
			var div = document.getElementById("divCategories");
			var div1 = document.getElementById("divItems");
			var strItems = AjaxFunctions.FillCategoryfromType(strMainCategory,strType); 
			var intCNT = AjaxFunctions.ReturnIntVal("select count(distinct(subcategory)) from tblNewCategoriesItem where MainCategory = '" + strType + "'"); 
			div1.innerHTML = "<select class='dropdown'></select>";
			div.innerHTML = strItems.value;
			if (intCNT.value == '1'){
			    var divItems = document.getElementById("divItems");
			    strItems = AjaxFunctions.FillItemfromCategory(strMainCategory, strType); 
			    divItems.innerHTML = strItems.value;
			}
			
		}
function showHideTopRightAHref(strSession)
        {
            if (strSession == ''){
			    document.getElementById('login').style.display = 'block';
			    document.getElementById('logout').style.display = 'none';
			    document.getElementById('register').style.display = 'block';
			    document.getElementById('account').style.display = 'none';
			}
			else{
			    document.getElementById('login').style.display = 'none';
			    document.getElementById('logout').style.display = 'block';
			    document.getElementById('register').style.display = 'none';
			    document.getElementById('account').style.display = 'block';
			}
        }
function FillCategoryAdmin(strType){
			var div = document.getElementById("divCategories");
			var strItems = AjaxFunctions.FillCategoryfromTypeAdmin(strType); 
			var intCNT = AjaxFunctions.ReturnIntVal("select count(distinct(subcategory)) from tblNewCategoriesItem where MainCategory = '" + strType + "'"); 
			div.innerHTML = strItems.value;
		
		}
function ShowCategory(show, show1, hide){
    document.getElementById(hide).style.display = 'none';
    document.getElementById(show).style.display = 'block';
    document.getElementById(show1).style.display = 'block';
    return false;
}		
function HideCategory(hide, hide1, show){
    document.getElementById(hide).style.display = 'none';
    document.getElementById(hide1).style.display = 'none';
    document.getElementById(show).style.display = 'block';
    return false;
}
function ShowSelectedCategory(){
    var fullurl = location.href
    if (fullurl.substr(0,30) == "http://www.uxlist.com/Services"){
        document.getElementById('imgServicesDown').style.display = 'none';
        document.getElementById('imgServicesUp').style.display = 'block';
        document.getElementById('divServices').style.display = 'block';
    }
    if (fullurl.substr(0,31) == "http://www.uxlist.com/Community"){
        document.getElementById('imgCommunityDown').style.display = 'none';
        document.getElementById('imgCommunityUp').style.display = 'block';
        document.getElementById('divCommunity').style.display = 'block';
    }
    if (fullurl.substr(0,32) == "http://www.uxlist.com/Contractor"){
        document.getElementById('imgContractorDown').style.display = 'none';
        document.getElementById('imgContractorUp').style.display = 'block';
        document.getElementById('divContractor').style.display = 'block';
    }
    if (fullurl.substr(0,32) == "http://www.uxlist.com/Employment"){
        document.getElementById('imgEmploymentDown').style.display = 'none';
        document.getElementById('imgEmploymentUp').style.display = 'block';
        document.getElementById('divEmployment').style.display = 'block';
    }
    if (fullurl.substr(0,29) == "http://www.uxlist.com/ForSale"){
        document.getElementById('imgForSaleDown').style.display = 'none';
        document.getElementById('imgForSaleUp').style.display = 'block';
        document.getElementById('divForSale').style.display = 'block';
    }
    if (fullurl.substr(0,26) == "http://www.uxlist.com/Free"){
        document.getElementById('imgFreeStuffDown').style.display = 'none';
        document.getElementById('imgFreeStuffUp').style.display = 'block';
        document.getElementById('divFreeStuff').style.display = 'block';
    }
    if (fullurl.substr(0,31) == "http://www.uxlist.com/LostFound"){
        document.getElementById('imgLostFoundDown').style.display = 'none';
        document.getElementById('imgLostFoundUp').style.display = 'block';
        document.getElementById('divLostFound').style.display = 'block';
    }
    if (fullurl.substr(0,32) == "http://www.uxlist.com/Membership"){
        document.getElementById('imgMembershipDown').style.display = 'none';
        document.getElementById('imgMembershipUp').style.display = 'block';
        document.getElementById('divMembership').style.display = 'block';
    }
    if (fullurl.substr(0,32) == "http://www.uxlist.com/RealEstate"){
        document.getElementById('imgRealEstateDown').style.display = 'none';
        document.getElementById('imgRealEstateUp').style.display = 'block';
        document.getElementById('divRealEstate').style.display = 'block';
    }
    if (fullurl.substr(0,28) == "http://www.uxlist.com/Wanted"){
        document.getElementById('imgWantedDown').style.display = 'none';
        document.getElementById('imgWantedUp').style.display = 'block';
        document.getElementById('divWanted').style.display = 'block';
    }

}