var pic_html = '



'; $(document).ready(function() { if($(".portlet").length>0) { $(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all") .find(".portlet-header") .addClass("ui-widget-header ui-corner-all") .prepend('') .end() .find(".portlet-content"); $(".portlet-header .ui-icon").click(function() { $(this).toggleClass("ui-icon-minusthick"); $(this).parents(".portlet:first").find(".portlet-content").toggle(); }); $(".column").disableSelection(); } if($(".column").length>0) { $(".column").sortable({ connectWith: '.column', handle: '.portlet-header', update: function() { //var res = $(".column").sortable("serialize"); //alert(res); } }); } if($("#imdbSlika").length>0) { $("#imdbSlika").click(function(){ $("#imdbSlika").hide(); }); } if($("#infoBox").length>0) { $("#infoBox").click(function(){ $("#infoBox").hide(); }); } if($(".mButton2").length>0) { $(".mButton2").click(function(){ $(".mButton2").css("background","#f00"); $(".mButton2").css("color","#fff"); $(".mButton2").val("Saving..."); document.title = 'Saving...'; $("BODY").focus(); $("#mainList").css("opacity",".3"); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = $(window).height()/2 - (height / 2) + "px"; //show the popup message and hide with fading effect $('#popuup_div').html("

Saving movie details


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); }); } }); function Confirm(link,text) { if(confirm(text)) window.location=link } function expw(listID) { if(listID.style.display=="none") listID.style.display=""; else listID.style.display="none"; window.event.cancelBubble=true; } function contw(listID) { if(listID.style.display=="show") listID.style.display=""; else listID.style.display="none"; window.event.cancelBubble=true; } function checkAll(field) { for(i = 0; i < field.elements.length; i++) field[i].checked = true ; } function uncheckAll(field) { for(i = 0; i < field.elements.length; i++) field[i].checked = false ; } function updatePreview(id,event) { if(event!=0) { x=event.clientX y=event.clientY document.getElementById("preview_box").style.left = x+80; document.getElementById("preview_box").style.top = y - 100; } $("#preview_box").load("includes/updatePreview.php?id="+id); } function updateEpisode(season,episode,ime,datum) { document.forms['forma'].ime.value = ime; document.forms['forma'].season.value = season; document.forms['forma'].episode_number.value = episode; document.forms['forma'].air_date.value = datum; } function updateIMDB() { var id = $("#imdb_id").val(); var mybackcolor = $("#mbutton1").css("background"); var mycolor = $("#mbutton1").css("color"); $("#mbutton1").css("background","#f00"); $("#mbutton1").css("color","#fff"); $("#mbutton1").val("Updating... "); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = $(window).height()/2 - (height / 2) + "px"; //show the popup message and hide with fading effect $('#popuup_div').html("

Updating movie details


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); $.ajax({type: "GET", url: "includes/getMovieDetails.php?id="+id, dataType: "xml", success: function(xml) { $(xml).find('movie_data').each(function() { var imek = $(this).find('title').text(); imek.replace('"',"x"); document.forma.ime.value = imek; document.forma.country.value = $(this).find('country').text(); if($(this).find('year').text() !== "") document.forma.leto.value = $(this).find('year').text(); if($(this).find('release_date').text() !== "") document.forma.release_date.value = $(this).find('release_date').text(); document.forma.language.value = $(this).find('language').text(); document.forma.running_times.value = $(this).find('runtime').text(); document.forma.cast.value = $(this).find('actors').text(); document.forma.director.value = $(this).find('director').text(); document.forma.colors.value = $(this).find('color').text(); document.forma.webpage.value = $(this).find('url_address').text(); document.forma.soundmix.value = $(this).find('soundmix').text(); document.forma.certificate.value = $(this).find('certification').text(); document.forma.distributor.value = $(this).find('distributor').text(); document.forma.locations.value = $(this).find('locations').text(); document.forma.asin.value = $(this).find('asin').text(); document.forma.releases.value = $(this).find('release_dates').text(); document.forma.imdb_rate.value = $(this).find('imdb_rate').text(); document.forma.posters.value = $(this).find('posters').text(); document.forma.production.value = $(this).find('production').text(); document.forma.soundtrack.value = $(this).find('soundtrack').text(); var m_genre = $(this).find('genre').text(); if(m_genre.length>0) { var genre = m_genre.split("#"); $(".genrebox").attr('checked',false); for ( var i in genre ) { $("#"+genre[i]).attr('checked',true); } } }); $("#mbutton1").val("Check IMDB"); $("#mbutton1").css("background","#449"); $("#mbutton1").css("color",mycolor); $('#popuup_div').css({ left: leftVal, top: topVal }).hide(); } }); } function changeSubmit() { document.forma.mySubmit.style.backgroundColor = "#fa5a4a"; document.forma.mySubmit.style.color = "#000"; } function getIMDBPoster() { var id = $("#imdb_id").val(); var myid = $("#movie_id").val(); $("#mojaSlika").html(pic_html); $("#mojaSlika").load("includes/getPoster.php?id="+id+"&myid="+myid); $("#upPic").css("background","#f0f"); $("#upPic").css("color","#303"); } function updateIMDBPoster() { var id = $("#imdb_id").val(); var myid = $("#movie_id").val(); $("#imdbSlika").html(pic_html); $("#imdbSlika").load("includes/getPoster.php?id="+id+"&myid="+myid); $("posters2").attr("src","/gfx/16x16/star.gif"); } function findPoster(myid,id,namek) { $('#infoBox').hide(); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = ($(document).scrollTop() + $(window).height()/2 - (height / 2)) + "px"; var tops = $(document).scrollTop(); //show the popup message and hide with fading effect $('#popuup_div').html("

Searching for Movie Posters


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); var visina = findPosY(namek) - 2; var levo = findPosX(namek) + 16; $('#infoBox').css("top",visina+"px"); $('#infoBox').css("left",levo+"px"); $("#infoBox").load("includes/getPosters.php?id="+id+"&myid="+myid, function(data){ if(data == 1) { $("#infoBox").html('Posters was added!'); $("#posters1").attr("src","/gfx/16x16/ok.gif"); } else { $("#infoBox").html('No Posters Was Found!'); $("posters1").attr("src","/gfx/16x16/star.gif"); } //$("#infoBox").html(data); $('#infoBox').show(); $('#popuup_div').hide(500); }); } function updateReleaseDate(myid,id,namek) { $('#infoBox').hide(); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = ($(document).scrollTop() + $(window).height()/2 - (height / 2)) + "px"; var tops = $(document).scrollTop(); //show the popup message and hide with fading effect $('#popuup_div').html("

Searching for Movie Release Date


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); var visina = findPosY(namek) - 2; var levo = findPosX(namek) + 16; $('#infoBox').css("top",visina+"px"); $('#infoBox').css("left",levo+"px"); $("#infoBox").load("includes/getReleaseDate.php?id="+id+"&myid="+myid, function(data){ $(namek).html(data); $('#popuup_div').hide(500); }); } function updateRating(myid,id,namek) { $('#infoBox').hide(); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = ($(document).scrollTop() + $(window).height()/2 - (height / 2)) + "px"; var tops = $(document).scrollTop(); //show the popup message and hide with fading effect $('#popuup_div').html("

Searching for Movie Posters


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); var visina = findPosY(namek) - 2; var levo = findPosX(namek) + 16; $('#infoBox').css("top",visina+"px"); $('#infoBox').css("left",levo+"px"); $("#infoBox").load("includes/getRating.php?id="+id+"&myid="+myid, function(data){ $(namek).html(data); $('#popuup_div').hide(500); }); } function findDirector(myid,id,namek) { $('#infoBox').hide(); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = ($(document).scrollTop() + $(window).height()/2 - (height / 2)) + "px"; var tops = $(document).scrollTop(); //show the popup message and hide with fading effect $('#popuup_div').html("

Searching for Movie Details


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); var visina = findPosY(namek) - 2; var levo = findPosX(namek) + 16; $('#infoBox').css("top",visina+"px"); $('#infoBox').css("left",levo+"px"); $("#infoBox").load("includes/getDirector.php?id="+id+"&myid="+myid, function(data){ if(data == 1) { $("#infoBox").html('Director was added!'); $(namek).attr("src","/gfx/16x16/ok.gif"); } else { $("#infoBox").html('No Director Was Found!'); $(namek).attr("src","/gfx/16x16/star.gif"); } //$("#infoBox").html(data); $('#infoBox').show(); $('#popuup_div').hide(500); }); } function updateIMDBPic1(myid,id,namek) { $('#imdbSlika').show(); $("#imdbSlika").html(pic_html); var visina = findPosY(namek) - 50; var levo = findPosX(namek) + 10; $('#imdbSlika').css("top",visina+"px"); $('#imdbSlika').css("left",levo+"px"); $("#imdbSlika").load("includes/getPoster.php?id="+id+"&myid="+myid, function(data){ var val = data; if(val == "0") { $("#imdbSlika").html("no poster!"); $("posters2").attr("src","gfx/16x16/star.gif"); } else { $("#imdbSlika").html(data).show(); $("posters2").attr("src","gfx/16x16/ok.gif"); $("posters2").html(data); } }); } function updateIMDBPic() { var id = document.imdbBox.imdb_id.value; var myid = document.imdbBox.id.value; var m_html = '



'; $('#imdbSlika').css("top",visina+"px"); $('#imdbSlika').html(m_html); $("#imdbSlika").load("includes/getTVEpisodePoster.php?id="+id+"&myid="+myid); } function findPosX(obj) { var curleft = 0; if(obj.offsetParent) while(1) { curleft += obj.offsetLeft; if(!obj.offsetParent) break; obj = obj.offsetParent; } else if(obj.x) curleft += obj.x; return curleft; } function findPosY(obj) { var curtop = 0; if(obj.offsetParent) while(1) { curtop += obj.offsetTop; if(!obj.offsetParent) break; obj = obj.offsetParent; } else if(obj.y) curtop += obj.y; return curtop; } function updateIMDBPic2(myid,id,h,namek) { var m_html = '



'; var visina = findPosY(namek) - 50; $('#imdbSlika').css("top",visina+"px"); $('#imdbSlika').html(m_html); $("#imdbSlika").load("includes/getTVEpisodePoster.php?id="+id+"&myid="+myid); } function findIMDB(id,type,namek) { $('#infoBox').hide(); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = ($(document).scrollTop() + $(window).height()/2 - (height / 2)) + "px"; var tops = $(document).scrollTop(); //show the popup message and hide with fading effect $('#popuup_div').html("

Searching for IMDB ID


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); var visina = findPosY(namek) - 2; var levo = findPosX(namek) + 16; $('#infoBox').css("top",visina+"px"); $('#infoBox').css("left",levo+"px"); $("#infoBox").load("includes/updateIMDB.php?id="+id+"&type="+type, function(data){ var visina = findPosY(namek) - 50; var sirina = findPosX(namek) + 20; $('#imdbSlika').css("top",visina+"px"); $('#imdbSlika').css("left",sirina+"px"); $("#imdbSlika").html(data).show(); $('#popuup_div').hide(500); }); /* var m_html = '



'; var visina = findPosY(namek) - 50; $("#imdb_box").css('top',visina+'px'); $("#imdb_box").html(m_html); $("#imdb_box").load("GET", "); */ } function updatePreview2(id,event) { if(event!=0) { x=event.clientX y=event.clientY document.getElementById("preview_box").style.left = x+80; document.getElementById("preview_box").style.top = y - 100; } $("#preview_box").load("GET", "includes/updateContentPreview.php?id="+id); } function hideImdbBox() { document.getElementById("imdb_box").innerHTML = ""; } function hidePreview() { document.getElementById("preview_box").innerHTML = ""; } function followmouse(e) { var xcoord = offsetfrommouse[0] var ycoord = offsetfrommouse[1] docwidth=document.all? truebody().scrollLeft+truebody().clientWidth - 15 : pageXOffset+window.innerWidth - 15 docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight - 15) : Math.min(window.innerHeight) if (typeof e != "undefined") { if ((docwidth - e.pageX) <= srcImageRight) // within 300 pixels of the right edge. { xcoord = e.pageX - (2 * xcoord) - currentImageWidth; // Move to the left side of the cursor } else { xcoord += e.pageX; } if (docheight - e.pageY <= (currentImageHeight + 40)) { ycoord += e.pageY - Math.max(0,(40 + currentImageHeight + e.pageY - docheight - truebody().scrollTop)); } else { ycoord += e.pageY; } } else if (typeof window.event != "undefined") { if ((docwidth - event.clientX) < srcImageRight) { // Move to the left side of the cursor xcoord = event.clientX + truebody().scrollLeft - (2 * xcoord) - currentImageWidth; } else { xcoord += truebody().scrollLeft + event.clientX; } if (docheight - event.clientY < (currentImageHeight + 20)) { ycoord += event.clientY + truebody().scrollTop - Math.max(0,(20 + currentImageHeight + event.clientY - docheight)); } else { ycoord += truebody().scrollTop + event.clientY; } } var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15 var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight) if (ycoord < 0) { ycoord = ycoord * -1; } gettrailobj().left = xcoord + "px" gettrailobj().top = ycoord + "px" } function uploadBox(id) { $('#uploadBox').load('/admin/includes/upload_flash_form.php?id='+id); $('#uploadBox').show(); } function closeUploadForm() { $('#uploadBox').hide(); } function resetIMDBFiles(imdb_id) { $.get("includes/removeImdbFiles.php?id="+imdb_id, function(data){ $("#remFiles").css("background","#f0f"); $("#remFiles").css("color","#303"); }); } function updateActorsBirthday(myid,id,namek) { $('#infoBox').hide(); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = ($(document).scrollTop() + $(window).height()/2 - (height / 2)) + "px"; var tops = $(document).scrollTop(); //show the popup message and hide with fading effect $('#popuup_div').html("

Searching for Movie Posters


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); var visina = findPosY(namek) - 2; var levo = findPosX(namek) + 16; $('#infoBox').css("top",visina+"px"); $('#infoBox').css("left",levo+"px"); $("#infoBox").load("includes/getActorsBirthday.php?id="+id+"&myid="+myid, function(data){ $(namek).html(data); $('#popuup_div').hide(500); }); } function findMyWallpapers() { } function updateActorIMDB() { var id = $("#imdb_id").val(); var mybackcolor = $("#mbutton1").css("background"); var mycolor = $("#mbutton1").css("color"); $("#mbutton1").css("background","#f00"); $("#mbutton1").css("color","#fff"); $("#mbutton1").val("Updating... "); //getting height and width of the message box var height = $('#popuup_div').height(); var width = $('#popuup_div').width(); //calculating offset for displaying popup message leftVal = $(document).width()/2 - (width / 2) + "px"; topVal = $(window).height()/2 - (height / 2) + "px"; //show the popup message and hide with fading effect $('#popuup_div').html("

Updating Aactors Details


Please wait...

"); $('#popuup_div').css({ left: leftVal, top: topVal }).show(); $.ajax({type: "GET", url: "includes/getActorsDetails.php?id="+id, dataType: "xml", success: function(xml) { $(xml).find('actor_data').each(function() { document.forma.name.value = $(this).find('name').text(); document.forma.birth_date.value = $(this).find('birthdate').text(); document.forma.born_city.value = $(this).find('birthplace').text(); document.forma.death_date.value = $(this).find('deathdate').text(); document.forma.death_city.value = $(this).find('deathplace').text(); document.forma.nickname.value = $(this).find('nickname').text(); document.forma.birthname.value = $(this).find('birthname').text(); document.forma.height_inch.value = $(this).find('height_inch').text(); document.forma.height_cm.value = $(this).find('height_cm').text(); document.forma.salary.value = $(this).find('salary').text(); document.forma.trade_mark.value = $(this).find('trade_mark').text(); document.forma.biography.value = $(this).find('mini_biography').text(); document.forma.spouse.value = $(this).find('spouse').text(); }); $("#mbutton1").val("Check IMDB"); $("#mbutton1").css("background",mybackcolor); $("#mbutton1").css("color",mycolor); $('#popuup_div').css({ left: leftVal, top: topVal }).hide(); } }); }