var gMapLoaded=false;function limitText(txtArea,maxChars,infoID,text){var obj=document["getElementById"](infoID);if(txtArea["value"]["length"]>maxChars){txtArea["value"]=txtArea["value"]["substring"](0,maxChars);} ;obj["innerHTML"]=maxChars-txtArea["value"]["length"]+" "+text;} ;function checkMinChars(id){obj=document["getElementById"](id);if(obj["value"]["length"]<3){alert("Minimum search input is 3 charaters");return false;} ;return true;} ;function checkall(obj,opt){var id="";switch(opt){case 1:id="DNNInfo_MessagePanel";break ;;case 2:id="DNNInfo_CountryPanel";break ;;case 3:id="DNNInfo_StatePanel";break ;;case 4:id="DNNInfo_CityPanel";break ;;case 5:id="DNNInfo_CategoryPanel";break ;;case 6:id="DNNInfo_ClassifiedPanel";break ;;case 7:id="DNNInfo_ClassificationPanel";break ;;} ;var divObj=document["getElementById"](id);if(divObj){if(obj["checked"]){for(i=0;i<divObj["getElementsByTagName"]("input")["length"];i++){if(divObj["getElementsByTagName"]("input")[i]["type"]=="checkbox"){if(divObj["getElementsByTagName"]("input")[i]["id"]!="checker"){divObj["getElementsByTagName"]("input")[i]["checked"]=true;} ;} ;} ;} else {for(i=0;i<divObj["getElementsByTagName"]("input")["length"];i++){if(divObj["getElementsByTagName"]("input")[i]["type"]=="checkbox"){if(divObj["getElementsByTagName"]("input")[i]["id"]!="checker"){divObj["getElementsByTagName"]("input")[i]["checked"]=false;} ;} ;} ;} ;} ;} ;function BuildRatings(divid,p,id){$("#"+divid)["html"]("\x3Cimg src=\x27"+spath+"/DesktopModules/DNNInfo_Classifieds/images/loading.gif\x27/\x3E");$["ajax"]({cache:false,url:spath+"/DesktopModules/DNNInfo_Classifieds/RatingHandler.ashx?divid="+divid+"\x26p="+p+"\x26id="+id,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){$("#"+divid)["html"](msg);} });} ;function BuildYoutubeVideos(ctype,type,divid,yvp,ycid,mid){$("#"+divid)["html"]("\x3Cimg src=\x27"+spath+"/DesktopModules/DNNInfo_Classifieds/images/loading.gif\x27/\x3E");$["ajax"]({cache:false,url:spath+"/DesktopModules/DNNInfo_Classifieds/YouTubeHandler.ashx?ctype="+ctype+"\x26type="+type+"\x26divid="+divid+"\x26ycid="+ycid+"\x26yvp="+yvp+"\x26mid="+mid,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){$("#"+divid)["html"](msg);} });} ;function LoadYouTubeVideo(type,divid,yvcode,yvid,mid){$(document)["ready"](function (){$("#"+divid)["html"]("\x3Cimg src=\x27"+spath+"/DesktopModules/DNNInfo_Classifieds/images/loading.gif\x27 /\x3E");$["ajax"]({cache:false,url:spath+"/DesktopModules/DNNInfo_Classifieds/YouTubeVideoHandler.ashx?type="+type+"\x26divid="+divid+"\x26yvcode="+yvcode+"\x26yvid="+yvid+"\x26mid="+mid,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){$("#"+divid)["html"](msg);} });} );} ;function CleanUp(obj,mid,iframeurl,filename){obj["disabled"]=true;$("#divAjaxLoading_"+mid)["removeClass"]("DNNInfo_Hidden");$("#divProgressBox_"+mid)["removeClass"]("DNNInfo_Hidden");$("#spanAjaxLoading_"+mid)["html"]("\x3Cimg src=\x27"+spath+"/DesktopModules/DNNInfo_Classifieds/images/ajax.gif\x27/\x3E");objiframe=document["getElementById"]("iframeProgress_"+mid);objiframe["src"]=iframeurl;setTimeout("GetFileInfo("+mid+",\x27"+spath+"\x27,\x27"+filename+"\x27)",1000);} ;function GetFileInfo(mid,path,filename){$["ajax"]({cache:false,url:path+"/DesktopModules/DNNInfo_Classifieds/FileHandler.ashx?f="+filename,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){if(msg=="1"){$("#divAjaxLoading_"+mid)["addClass"]("DNNInfo_Hidden");$("#btnCleanUp_"+mid)["addClass"]("DNNInfo_Hidden");$("#divAjaxComplete_"+mid)["removeClass"]("DNNInfo_Hidden");$("#divAjaxComplete_"+mid)["addClass"]("DNNInfo_Block");} else {setTimeout("GetFileInfo("+mid+",\x27"+path+"\x27,\x27"+filename+"\x27)",1000);} ;} });} ;function SyncClients(obj,mid,iframeurl){obj["disabled"]=true;objiframe=document["getElementById"]("iframeProgress_"+mid);objiframe["src"]=iframeurl;} ;function resetDD(id,txtID){$("#"+id)["val"]("");$("#"+txtID)["val"]("");} ;function LoadLocation(typeID,portalID,ddTopParent,ddParent,ddChild,hiddenStateID,title){var ddTopID=0;var ddID=0;var querystring="";if(ddTopParent!=""){objDDTopParent=document["getElementById"](ddTopParent);if(objDDTopParent){ddTopID=objDDTopParent["options"][objDDTopParent["selectedIndex"]]["value"];} ;} ;objDDParent=document["getElementById"](ddParent);if(objDDParent){ddID=objDDParent["options"][objDDParent["selectedIndex"]]["value"];} ;objDDChild=document["getElementById"](ddChild);objHiddenState=document["getElementById"](hiddenStateID);if(objDDChild){if(objDDChild){for(var i=objDDChild["options"]["length"];i>=0;i--){objDDChild["remove"](i);} ;} ;$("#"+ddChild)["append"]("\x3Coption value=\x27\x27\x3E"+title+"\x3C/option\x3E");if(ddID>0){switch(typeID){case 1:querystring="?portalID="+portalID+"\x26ctid="+ddID;break ;;case 2:querystring="?portalID="+portalID+"\x26ctid="+ddTopID+"\x26sid="+ddID;break ;;} ;$["ajax"]({cache:false,url:spath+"/DesktopModules/DNNInfo_Classifieds/LocationHandler.ashx"+querystring,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){$("#"+ddChild)["append"](msg);} });} ;} ;} ;function LoadHiddenLocation(typeID,portalID,countryID,ddParent,ddChild,hiddenStateID,title){var ddTopID=countryID;var ddID=0;var querystring="";objDDParent=document["getElementById"](ddParent);if(objDDParent){ddID=objDDParent["options"][objDDParent["selectedIndex"]]["value"];} ;objDDChild=document["getElementById"](ddChild);objHiddenState=document["getElementById"](hiddenStateID);if(objDDChild){if(objDDChild){for(var i=objDDChild["options"]["length"];i>=0;i--){objDDChild["remove"](i);} ;} ;$("#"+ddChild)["append"]("\x3Coption value=\x27\x27\x3E"+title+"\x3C/option\x3E");if(ddID>0){switch(typeID){case 1:querystring="?portalID="+portalID+"\x26ctid="+ddID;break ;;case 2:querystring="?portalID="+portalID+"\x26ctid="+ddTopID+"\x26sid="+ddID;break ;;} ;$["ajax"]({cache:false,url:spath+"/DesktopModules/DNNInfo_Classifieds/LocationHandler.ashx"+querystring,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){$("#"+ddChild)["append"](msg);} });} ;} ;} ;function LoadStatistic(portalID,mid,typeID,titleType,startDate,endDate,noOfRecords,classifiedType){$("#spanAjaxStatistic_"+mid)["html"]("\x3Cimg src=\x27"+spath+"/DesktopModules/DNNInfo_Classifieds/images/loading.gif\x27/\x3E");$["ajax"]({cache:false,url:spath+"/DesktopModules/DNNInfo_Classifieds/StatisticHandler.ashx?portalID="+portalID+"\x26mid="+mid+"\x26typeID="+typeID+"\x26titleType="+titleType+"\x26startDate="+startDate+"\x26endDate="+endDate+"\x26noOfRecords="+noOfRecords+"\x26ctype="+classifiedType,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){$("#spanAjaxStatistic_"+mid)["addClass"]("DNNInfo_Hidden");$("#divAjaxStatistic_"+mid)["html"](msg);} });} ;function GetYoutubeImage(labelid,portalID,youtubeCode,ctype){$("#"+labelid)["html"]("\x3Cimg src=\x27"+spath+"/DesktopModules/DNNInfo_Classifieds/images/loading.gif\x27/\x3E");$["ajax"]({cache:false,url:spath+"/DesktopModules/DNNInfo_Classifieds/YouTubeImageHandler.ashx?portalID="+portalID+"\x26youtubecode="+youtubeCode+"\x26ctype="+ctype,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){$("#"+labelid)["html"](msg);} });} ;function setDropDownlist(id,hiddenid){obj=document["getElementById"](id);hiddenobj=document["getElementById"](hiddenid);if(obj&&hiddenobj){hiddenobj["value"]=obj["options"][obj["selectedIndex"]]["value"];} ;} ;function popupControl(path,mode,classifiedID,tabID){window["open"](path+"/desktopmodules/dnninfo_classifieds/popupcontrol.aspx?mode="+mode+"\x26id="+classifiedID+"\x26tid="+tabID,"newwindow","height=420,width=520, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no");} ;function showPropertyListingType(obj,trPriceID,trRentID,trRentPeriodID){if(obj["options"][obj["selectedIndex"]]["value"]=="1"){$("#"+trPriceID)["show"]();$("#"+trRentID)["hide"]();$("#"+trRentPeriodID)["hide"]();} else {if(obj["options"][obj["selectedIndex"]]["value"]=="2"){$("#"+trPriceID)["hide"]();$("#"+trRentID)["show"]();$("#"+trRentPeriodID)["show"]();} else {$("#"+trPriceID)["hide"]();$("#"+trRentID)["hide"]();$("#"+trRentPeriodID)["hide"]();} ;} ;} ;function LoadClassificationValues(portalID,ctype,cname,parentID,subParentID,title){var subParentValue="";var querystring="";objParentID=document["getElementById"](parentID);if(objParentID){subParentValue=objParentID["options"][objParentID["selectedIndex"]]["value"];} ;objSubParentID=document["getElementById"](subParentID);if(objSubParentID){for(var i=objSubParentID["options"]["length"];i>=0;i--){objSubParentID["remove"](i);} ;$("#"+subParentID)["append"]("\x3Coption value=\x27\x27\x3E"+title+"\x3C/option\x3E");if(subParentValue["length"]>0){querystring="?portalID="+portalID+"\x26ctype="+ctype+"\x26cname="+cname+"\x26cgroup="+subParentValue;$["ajax"]({cache:false,url:spath+"/DesktopModules/DNNInfo_Classifieds/ClassificationHandler.ashx"+querystring,data:"{}",contentType:"text/html; charset=utf-8",dataType:"html",error:function (xhr,status,error){} ,success:function (msg){$("#"+subParentID)["append"](msg);} });} ;} ;} ;function expandDiv(id,divID){$("#"+id)["show"]();$("#"+divID)["hide"]();} ;function hideDiv(id,divID){$("#"+id)["hide"]();$("#"+divID)["show"]();} ;function showHideObj(chk,id){if($("#"+chk)["attr"]("checked")=="checked"){$("#"+id)["hide"]();} else {$("#"+id)["show"]();} ;} ;function getYoutubeVideoID(id){$("#"+id)["val"]($("#"+id)["val"]());if($("#"+id)["val"]()["match"]("http://(www.)?youtube|youtu.be")){$("#"+id)["val"]($("#"+id)["val"]()["split"](/v\/|v=|youtu\.be\//)[1]["split"](/[?&]/)[0]);} ;} ;
