var headline_count;var headline_interval;var old_headline=0;var current_headline=0;$(document).ready(function(){if(document.all){}$(".customize").mouseover(function(){$("#subnavigasi .areasubnav ol .customize .caption").css("visibility","visible")});$(".customize").mouseout(function(){$("#subnavigasi .areasubnav ol .customize .caption").css("visibility","hidden")});$(".customize .caption .customize_panel #saveChoices").click(function(){$("#subnavigasi .areasubnav ol .customize .caption").css("visibility","hidden")});$("#wp_fokus_1").hover(function(){$(".fokus .thumbs1").css("opacity",".2");$(".fokus .thumbs1").css("filter","alpha(opacity=20)");viva_change_wp_fokus(0)},function(){$(".fokus .thumbs1").css("opacity","1");$(".fokus .thumbs1").css("filter","alpha(opacity=100)")});$("#wp_fokus_2").hover(function(){$(".fokus .thumbs2").css("opacity",".2");$(".fokus .thumbs2").css("filter","alpha(opacity=20)");viva_change_wp_fokus(1)},function(){$(".fokus .thumbs2").css("opacity","1");$(".fokus .thumbs2").css("filter","alpha(opacity=100)")});$(".sorot").mouseover(function(){$(".sorot").css("height","200px");$(".sorot .thumbs").css("opacity",".3");$(".sorot .thumbs").css("filter","alpha(opacity=30)");$(".sorot .coversorot").css("visibility","visible")});$(".sorot").mouseout(function(){$(".sorot").css("height","60px");$(".sorot .thumbs").css("opacity","1");$(".sorot .thumbs").css("filter","alpha(opacity=100)");$(".sorot .coversorot").css("visibility","hidden")});$(".fokus").mouseover(function(){$(".fokus").css("height","233px");$(".isifokus").css("visibility","visible")});$(".fokus").mouseout(function(){$(".fokus").css("height","61px");$(".isifokus").css("visibility","hidden")});$(".theme01").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="01";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/01/theme.css")});$(".theme02").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="02";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/02/theme.css")});$(".theme03").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="03";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/03/theme.css")});$(".theme04").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="04";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/04/theme.css")});$(".theme05").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="05";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/05/theme.css")});$(".theme06").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="06";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/06/theme.css")});$(".theme07").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="07";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/07/theme.css")});$(".theme08").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="08";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/08/theme.css")});$(".theme09").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="09";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/09/theme.css")});$(".theme10").click(function(){selSkin="01";$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css");selTheme="10";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__theme_cookie_name,selTheme,{expires:b,path:"/"});$("#VIVATheme").attr("href",__wp_appaux_url+"themes/10/theme.css")});$(".skin01").click(function(){selSkin="01";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/01/skin.css")});$(".skin02").click(function(){selSkin="02";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/02/skin.css")});$(".skin03").click(function(){selSkin="03";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/03/skin.css")});$(".skin04").click(function(){selSkin="04";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/04/skin.css")});$(".skin05").click(function(){selSkin="05";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/05/skin.css")});$(".skin06").click(function(){selSkin="06";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/06/skin.css")});$(".skin07").click(function(){selSkin="07";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/07/skin.css")});$(".skin08").click(function(){selSkin="08";var b=new Date();b.setTime(b.getTime()+(30*24*60*60*1000));$.cookie(__skin_cookie_name,selSkin,{expires:b,path:"/"});$("#VIVASkin").attr("href",__wp_appaux_url+"skins/08/skin.css")});$(".ititle").hover(function(){$(this).parents(".subkanal").addClass("titlehover")},function(){$(this).parents(".subkanal").removeClass("titlehover")});if(!document.all){$(window).resize(function(){})}var a=0;headline_count=$("div.tick").size();$("div.tick:eq("+current_headline+")").css("top","2px");headline_interval=setInterval(headline_rotate,5000);$("#scrollup").hover(function(){clearInterval(headline_interval)},function(){headline_interval=setInterval(headline_rotate,3000)});moveBanner();initSortable()});function addBoxEffect(a){alert("widget:"+a+" :: theme:"+$.cookie("selSkin"))}function addRunningNews(wid){var widdata=eval("widgetdata_rn_"+wid);var wididx=eval("widgetdata_"+wid+"_idx");if(wididx<=widdata.length){var iclassname="runningnews";if(wid=="video"){iclassname="headline2"}if(wid=="berita"){$("#widget_"+wid).find("#runningnews").append('<li><div class="jam">'+widdata[wididx-1][2]+'</div><a href="'+widdata[wididx-1][0]+'">'+widdata[wididx-1][1]+"</a></li>")}else{$("#widget_"+wid).find("#runningnews").append('<li><a href="'+widdata[wididx-1][0]+'">'+widdata[wididx-1][1]+"</a></li>")}eval("widgetdata_"+wid+"_idx++;");var idate=new Date();idate.setTime(idate.getTime()+(30*24*60*60*1000));$.cookie("widgetdata_"+wid+"_rncount",eval("widgetdata_"+wid+"_idx"),{expires:idate,path:"/"})}}function delRunningNews(wid){var wididx=eval("widgetdata_"+wid+"_idx");var maxrec=3;if(wid=="video"){maxrec=2}if(wididx>maxrec){eval("widgetdata_"+wid+"_idx--");if(wid=="berita"){$("#widget_"+wid).find("#runningnews").find("li:eq("+(wididx-1)+")").remove()}else{$("#widget_"+wid).find("#runningnews").find("li:eq("+(wididx-1)+")").remove()}var idate=new Date();idate.setTime(idate.getTime()+(30*24*60*60*1000));$.cookie("widgetdata_"+wid+"_rncount",eval("widgetdata_"+wid+"_idx"),{expires:idate,path:"/"})}}function widgetContainerHTML(a,b,d){var c='<div id="widget_'+a+'" class="subkanal" style="display:block;">';c+='<div class="titlebox" style="/*width:220px; height: 30px;*/ display:block;" id="title">';c+='<div class="boxatur">';c+='<a class="kurang" href="javascript:void(0)" onclick="delRunningNews(\''+a+"')\"></a>";c+='<a class="tambah" href="javascript:void(0)" onclick="addRunningNews(\''+a+"')\"></a>";c+='<a class="tutup" href="javascript:void(0)" onclick="$(\'#widget_'+a+"').find('#icontent').slideToggle('slow');\"></a>";c+='</div><div class="ititle">';c+='<a href="'+d+'">'+b+"</a>";c+="</div></div>";c+='<div id="icontent"><div style="text-align:center; padding: 4px 0 0px 0;"><img src="'+__appaux_images_url+'ajax-loader.gif" width="220" height="19" border="0" /></div></div>';c+="</div>";return c}function adsContainerHTML(a,b,d){var c='<div id="widget_'+a+'" class="subkanal">';c+='<div id="icontent" style="border:0px;background:#ddd;">&nbsp;</div>';c+="</div>";return c}function widgetIndex(b){for(var a=0;a<widget_ids.length;a++){if(widget_ids[a][0]==b){return a}}return -1}function randRange(c,a){var b=Math.floor(Math.random()*(a-c+1))+c;return b}var widgetPlacementCtr=0;function addWidget(d,e,g){if($("div > #widget_"+d).size()==0){$("#input_widget_"+d).attr("checked",true);var f=new Date();f.setTime(f.getTime()+(30*24*60*60*1000));$.cookie(__widget_cookie_name+"_"+d,1,{expires:f,path:"/"});var c=widget_ids[widgetIndex(d)][3];var b=widget_ids[widgetIndex(d)][4];if(b){if(c==1){$("div > #ileftc").append(adsContainerHTML(d,e,g))}else{if(c==2){$("div > #irightc").append(adsContainerHTML(d,e,g))}else{if(c==3){$("div > #irightblock").append(adsContainerHTML(d,e,g))}}}}else{if(c==1){$("div > #ileftc").append(widgetContainerHTML(d,e,g))}else{if(c==2){$("div > #irightc").append(widgetContainerHTML(d,e,g))}else{if(c==3){$("div > #irightblock").append(widgetContainerHTML(d,e,g))}}}}var a=Math.random();$("#widget_"+d).find("#icontent").load("/widget/read/"+d+"/"+escape(a));initSortable()}else{$.cookie(__widget_cookie_name+"_"+d,0,{path:"/"});$("div > #widget_"+d).remove();$("#input_widget_"+d).attr("checked",false)}}var group_list=["ileftc","irightc","irightblock"];onSortChange=function(c){var b="";$(group_list).each(function(d,e){serial=$("#"+e).sortable("toArray");stringItems=serial.toString();while(stringItems.indexOf(",")==0){stringItems=stringItems.substr(1)}if(stringItems){if(d>0){b+="&"+e+"="+stringItems}else{b+=e+"="+stringItems}}});var a=new Date();a.setTime(a.getTime()+(30*24*60*60*1000));$.cookie(__widget_cookie_name+"_sort",b,{expires:a,path:"/"})};function initSortable(){$("#ileftc").sortable({connectWith:"#ileftc, #irightc, #irightblock",handle:".ititle",update:onSortChange});$("#irightc").sortable({connectWith:"#ileftc, #irightc, #irightblock",handle:".ititle",update:onSortChange});$("#irightblock").sortable({connectWith:"#ileftc, #irightc, #irightblock",handle:".ititle",update:onSortChange});$("#ileftc").disableSelection();$("#irightc").disableSelection();$("#irightblock").disableSelection()};
