(function(){
    function httpGetAsync(theUrl, callback)
    {
        var xmlHttp = new XMLHttpRequest();
        xmlHttp.onreadystatechange = function() {
            if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
                callback(xmlHttp.responseText);
        }
        xmlHttp.open("GET", theUrl, true); // true for asynchronous
        xmlHttp.withCredentials = true;

        xmlHttp.send(null);
    }

    withCol1Class='';
    if(3 <= 1){
        withCol1Class = 'svca__with-col-1';
    }

    if (3 <= 5) {
        blockGridClass = 'svca__xsmall-block-grid-1 svca__small-block-grid-2  svca__medium-block-grid-3';
    } else {
        blockGridClass = 'svca__xsmall-block-grid-1 svca__small-block-grid-2  svca__medium-block-grid-3';
    }

var cardClass = '';
    var htmlStart= '<div id="js__sabavision-content-ad" class="sabavision-content-ad ">   <style>     .sabavision-content-ad.sabavision_zoomit2 .svca__heading{       display: none;    }        .sabavision-content-ad.sabavision_zoomit2{     border: none !important;     padding: 0 20px !important;    }        .sabavision-content-ad.sabavision_zoomit2 .svca-content:hover .item-img {       -webkit-transform: scale(1) !important;       -ms-transform: scale(1) !important;       transform: scale(1) !important;     }         .sabavision-content-ad {       direction: rtl;       text-align: right;       border: solid 1px #ccc;       border-radius: 3px;       font-size: 12px;     }     .sabavision-content-ad .svca__heading {       margin-bottom: 5px;       background: #eee;       padding: 10px 10px;       border-bottom: solid 1px #bbb;       border-radius: 0;       position: relative;     }     .sabavision-content-ad .svca-item a {       overflow: hidden;       margin-bottom: 10px;       font-weight: bold;     }     .sabavision-content-ad .svca-content .item-img {       -webkit-transform: scale(1);       -ms-transform: scale(1);       transform: scale(1);       -webkit-transition: transform 350ms ease;       -ms-transition: transform 350ms ease;       transition: transform 350ms ease;     }     .sabavision-content-ad .svca-content:hover .item-img {             -webkit-transform: scale(1.1);       -ms-transform: scale(1.1);       transform: scale(1.1);     }     .sabavision-content-ad .svca__img {       width: 32px;       vertical-align: middle;       margin-left: 10px;     }     .sabavision-content-ad .svca__title {       font-size: 16px;       font-weight: bold;       float: right;     }     .sabavision-content-ad .svca__sabavision {       font-size: 12px;   float: left;   font-weight: bold;   direction: ltr;   position: absolute;   left: 25px;   /*margin-top: 5px*/     }     .sabavision-content-ad .svca__sabavision span,     .sabavision-content-ad .svca__sabavision a {       vertical-align: middle;     }     .sabavision-content-ad .svca__sabavision span {       position: absolute;       transition: opacity 200ms ease-in;       width: 80px;       text-align: left;       left: 25px;     }     .sabavision-content-ad .svca__logo:hover {        background-image: url(https://click.sabavision.com/public/public/images/logo/Sabavision-Farsi-1.png);         width: 105px;         -webkit-transition: all 0.3s ease-in-out;         -moz-transition: all 0.3s ease-in-out;         -o-transition: all 0.3s ease-in-out;         transition: all 0.3s ease-in-out;         height: 21px;         bottom: 0px;         background-color: transparent;         background-size: 90px;         left: 10px;     }     .sabavision-content-ad .svca__logo {       width: 20px;       height: 14px;       line-height: 14px;       background-color: transparent;       -webkit-transition: all 0.2s ease-in-out;       -moz-transition: all 0.2s ease-in-out;       -o-transition: all 0.2s ease-in-out;       transition: all 0.2s ease-in-out;       color: rgba(0, 0, 0, 0.7);       border-radius: 0 3px 3px 0;       z-index: 9999999;       background-image: url(https://click.sabavision.com/public/public/images/logo/sabavision-logo.png);       background-repeat: no-repeat;       background-position: 3px center;       display: inline-block;       background-size: 17px;     }         .sabavision-content-ad .svca__logo:hover+span {       opacity: 0;     }     .sabavision-content-ad img {       width: 100%;     }     .sabavision-content-ad a {       text-decoration: none;       color: #000;     }     .sabavision-content-ad ul, .sabavision-content-ad li {       margin: 0;       padding: 0;       list-style-type: none;     }     .sabavision-content-ad li {       padding: 10px;       font-weight: bold;       font-size: 14px;     }       .sabavision-content-ad li a {       display: block;     }     .sabavision-content-ad .svca__clearfix:before, .sabavision-content-ad .svca__clearfix:after {       content: " ";       display: table;     }     .sabavision-content-ad .svca__clearfix:after {       clear: both;     }     .sabavision-content-ad .svca__block-grid {       display: block;       position: relative;     }     .sabavision-content-ad .svca__block-grid, .sabavision-content-ad .svca__block-grid * {       box-sizing: border-box;     }     .sabavision-content-ad .svca__block-grid .bg-item {       float: right;       list-style: none;     }     .sabavision-content-ad .svca__block-grid--slider {       margin-right: 0;       margin-left: 0;     }         .svca__with-col-1.svca__logo-label{       display: none;     }         .svca__with-col-1.svca__title{       font-size: 12px;     }     @media (min-width: 0px) {       .svca__xsmall-block-grid-1.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__xsmall-block-grid-1.is-not-center .bg-item:nth-of-type(1n + 1) {         clear: both;       }       .svca__xsmall-block-grid-1 .bg-item {         width: 100%;       }       .svca__xsmall-block-grid-2.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__xsmall-block-grid-2.is-not-center .bg-item:nth-of-type(2n + 1) {         clear: both;       }       .svca__xsmall-block-grid-2 .bg-item {         width: 50%;       }       .svca__xsmall-block-grid-3.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__xsmall-block-grid-3.is-not-center .bg-item:nth-of-type(3n + 1) {         clear: both;       }       .svca__xsmall-block-grid-3 .bg-item {         width: 33.33333%;       }       .svca__xsmall-block-grid-4.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__xsmall-block-grid-4.is-not-center .bg-item:nth-of-type(4n + 1) {         clear: both;       }       .svca__xsmall-block-grid-4 .bg-item {         width: 25%;       }       .svca__xsmall-block-grid-5.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__xsmall-block-grid-5.is-not-center .bg-item:nth-of-type(5n + 1) {         clear: both;       }       .svca__xsmall-block-grid-5 .bg-item {         width: 20%;       }       .svca__xsmall-block-grid-6.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__xsmall-block-grid-6.is-not-center .bg-item:nth-of-type(6n + 1) {         clear: both;       }       .svca__xsmall-block-grid-6 .bg-item {         width: 16.66667%;       }     }     @media (min-width: 321px) {       .svca__small-block-grid-1.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__small-block-grid-1.is-not-center .bg-item:nth-of-type(1n + 1) {         clear: both;       }       .svca__small-block-grid-1 .bg-item {         width: 100%;       }       .svca__small-block-grid-2.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__small-block-grid-2.is-not-center .bg-item:nth-of-type(2n + 1) {         clear: both;       }       .svca__small-block-grid-2 .bg-item {         width: 50%;       }       .svca__small-block-grid-3.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__small-block-grid-3.is-not-center .bg-item:nth-of-type(3n + 1) {         clear: both;       }       .svca__small-block-grid-3 .bg-item {         width: 33.33333%;       }       .svca__small-block-grid-4.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__small-block-grid-4.is-not-center .bg-item:nth-of-type(4n + 1) {         clear: both;       }       .svca__small-block-grid-4 .bg-item {         width: 25%;       }       .svca__small-block-grid-5.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__small-block-grid-5.is-not-center .bg-item:nth-of-type(5n + 1) {         clear: both;       }       .svca__small-block-grid-5 .bg-item {         width: 20%;       }       .svca__small-block-grid-6.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__small-block-grid-6.is-not-center .bg-item:nth-of-type(6n + 1) {         clear: both;       }       .svca__small-block-grid-6 .bg-item {         width: 16.66667%;       }     }     @media (min-width: 480px) {       .svca__medium-block-grid-1.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__medium-block-grid-1.is-not-center .bg-item:nth-of-type(1n + 1) {         clear: both;       }       .svca__medium-block-grid-1 .bg-item {         width: 100%;       }       .svca__medium-block-grid-2.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__medium-block-grid-2.is-not-center .bg-item:nth-of-type(2n + 1) {         clear: both;       }       .svca__medium-block-grid-2 .bg-item {         width: 50%;       }       .svca__medium-block-grid-3.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__medium-block-grid-3.is-not-center .bg-item:nth-of-type(3n + 1) {         clear: both;       }       .svca__medium-block-grid-3 .bg-item {         width: 33.33333%;       }       .svca__medium-block-grid-4.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__medium-block-grid-4.is-not-center .bg-item:nth-of-type(4n + 1) {         clear: both;       }       .svca__medium-block-grid-4 .bg-item {         width: 25%;       }       .svca__medium-block-grid-5.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__medium-block-grid-5.is-not-center .bg-item:nth-of-type(5n + 1) {         clear: both;       }       .svca__medium-block-grid-5 .bg-item {         width: 20%;       }       .svca__medium-block-grid-6.is-not-center .bg-item:nth-of-type(1n) {         clear: none;       }       .svca__medium-block-grid-6.is-not-center .bg-item:nth-of-type(6n + 1) {         clear: both;       }       .svca__medium-block-grid-6 .bg-item {         width: 16.66667%;       }     }         .sabavision-content-ad .svca-item.card2 a{       float: right !important;;       width: 30% !important;       margin-left: 5%;     }       .sabavision-content-ad .svca-item.card2 a.svca-content-title {       width: 60% !important;       float: right;       font-weight : bold;     }         .bg-item svca-item card2{       padding-bottom: 0 !important;     }     @media screen and (max-width: 992px) {      .sabavision-content-ad .svca-item.card2 a {         width: 100%;       }       .card2 .svca-content-title {         width: 100% !important;         float: right;       }     }   </style>     <style>         @media (max-width: 480px) {       .hidden.bg-item.svca-item:last-child{          display: none;       }     }   </style> <style>    .sabavision-content-ad .svca-item a{       font-size: 13px !important;     }             .sabavision-content-ad .svca-item.card2 a.svca-content-title {       font-size: 12px !important;     } </style><div class="svca__heading svca__clearfix"> 		<span class="svca__title ' + withCol1Class +'">جدیدترین مطالب وب</span> <span class="svca__sabavision"><a class="svca__logo" href="http://www.sabavision.com" rel="nofollow" target="_blank"></a><span class="svca__logo-label ' + withCol1Class +'">اختصاصی از</span></span> 	</div> 	<ul class="svca__clearfix svca__block-grid ' + blockGridClass +' is-not-center ">';
    var htmlEnd= '</ul></div>';
    
     httpGetAsync('https://click.sabavision.com/get_camp.php?id=75028,75027,75026,75025,75024,75023&mode=api&count=6',function(data){
         data = JSON.parse(data);
         if(data[0]['click_url']) {
<!--             for (i = 0; i < data.length; i++) {-->
<!--                console.log(i);-->
<!--                htmlStart += '<li class="bg-item svca-item '+cardClass+'"><div class="svca-content"><a href="'+data[i]['click_url']+encodeURIComponent(window.location.host)+'" target="_blank" rel="nofollow"><img  class="item-img" alt="TITLE" src="'+data[i]['banner_url']+'"></a><a href="'+data[i]['click_url']+encodeURIComponent(window.location.host)+'" class="svca-content-title" target="_blank" rel="nofollow">'+data[i]['title']+'</a></div></li>';-->
<!--             }-->

<!--             for (var i in data) {-->
<!--                console.log("1");-->
<!--                htmlStart += '<li class="bg-item svca-item '+cardClass+'"><div class="svca-content"><a href="'+data[i]['click_url']+encodeURIComponent(window.location.host)+'" target="_blank" rel="nofollow"><img  class="item-img" alt="TITLE" src="'+data[i]['banner_url']+'"></a><a href="'+data[i]['click_url']+encodeURIComponent(window.location.host)+'" class="svca-content-title" target="_blank" rel="nofollow">'+data[i]['title']+'</a></div></li>';-->
<!--             }-->

<!--            document.getElementById('--><!--').innerHTML = (htmlStart+htmlEnd);-->
            var result = data.reduce(function(accumulator, currentValue) {
                return accumulator + '<li class="bg-item svca-item '+cardClass+'"><div class="svca-content"><a href="'+currentValue['click_url']+encodeURIComponent(window.location.host)+'" target="_blank" rel="nofollow"><img  class="item-img" alt="TITLE" src="'+currentValue['banner_url']+'"></a><a href="'+currentValue['click_url']+encodeURIComponent(window.location.host)+'" class="svca-content-title" target="_blank" rel="nofollow">'+currentValue['title']+'</a></div></li>';;
            },"");
            
            document.getElementById('click_sabavision_585831').innerHTML = (htmlStart+result+htmlEnd);
         }
     });
    })();



