function chartObjShow(obj) { vz = (obj.vz.checked)?obj.vz.value:0; v = (obj.v.checked)?obj.v.value:0; a = (obj.a.checked)?obj.a.value:0; if (!a) $('#legenda').hide(); else $('#legenda').show(); if (!v) $('#legendv').hide(); else $('#legendv').show(); if (!vz) $('#legendvz').hide(); else $('#legendvz').show(); var chart = new FusionCharts("/charts/ScrollLine2D.swf", "gCID", $('#gCID').attr('width'), $('#gCID').attr('height'), "0", "0"); chart.setDataURL("/xml/xml.php?args=chart=ScrollLine2D|noanimation=1|vz="+vz+"|a="+a+"|v="+v); chart.render("chartdiv"); } function datePickerCompare() { if ($("#datePickerTo").datepicker("getDate") >= $("#datePickerFrom").datepicker("getDate")) { alert("Intervalul ales este invalid"); return false; } return true; } $.convertMenu = function(){ if ($('#menu')) { $('#menu li').each(function(i,obj) { $(obj).html("
"+$(obj).html()+"
"); $(obj).click(function() {location.href = this.getElementsByTagName('a')[0].href}); $(obj).mouseover(function() {this.className = 'on';}) $(obj).mouseout(function() {this.className = '';}) } ); tb_init('a.menubox'); } } $.convertSelect = function() { if (!$('#categories')) return; $('#catselect').html('in categoria'); $('#catselect').append('
'); k=1; $('#categories *').each(function(i, obj) { if (obj.tagName == 'OPTGROUP') { if (i!=0) $('#categori').append(NODE); if (k++<4) h = "180px" else h="130px"; if (k == $('#categories *').size()) h=0; if (k == 8) h=""; NODE = $('').css('height',h).append('
  • '+obj.label+'
  • '); } if (obj.tagName == 'OPTION') { LI = $('
  • ') .append('') .append(''+obj.text+'') $(NODE).append(LI); } } ); $('#categori').append(NODE); $('#categori').append(''); $('#categori').hide(); $('#catselect').click(function() { showCat(this); }); } $.inputs = function() { if ($('div.inputcontainer')) $('div.inputcontainer').each(function(i, INPUTOBJ) { INPUTOBJINPUT = $(INPUTOBJ).children('input')[0]; INPUTOBJSPAN = $(INPUTOBJ).children('span')[0]; INPUTREQUIREDIMAGE = $(''); INPUTDIV = $('
    '); INPUTHINT = $(''); $(INPUTHINT).tipsy({fallback: INPUTOBJSPAN.innerHTML,gravity:'w',html: true }); $(INPUTDIV).append(INPUTOBJINPUT); $(INPUTDIV).append(INPUTHINT); $(INPUTOBJ).empty(); $(INPUTOBJ).append(INPUTDIV); $(INPUTOBJ).append(INPUTREQUIREDIMAGE); } ); registerForm(); } $.webselect = function() { webselectTimeout = ''; // WEBSELECT if ($('#webselect ul')) if ($('#webselect ul')[0] && $('#webselect').attr('class') != 'select none') { jQuery('#webselect span').click(function() { POS = jQuery('#webselect span').position(); if ($.browser.msie) jQuery('#webselect ul').css("left", (POS.left-7)+"px"); else jQuery('#webselect ul').css("left", (POS.left-7)+"px"); jQuery('#webselect ul').css("top", (POS.top+14)+"px"); if (webselectTimeout) clearTimeout(webselectTimeout); if (jQuery('#webselect ul').css("display") != 'none') jQuery('#webselect ul').show(); else { jQuery('#webselect ul').show(); webselectTimeout = setTimeout(function() { jQuery('#webselect ul').hide(); }, 1000 ); } }); jQuery('#webselect ul').mouseover(function() { if (webselectTimeout) clearTimeout(webselectTimeout); }); jQuery('#webselect').mouseout(function() { if (webselectTimeout) clearTimeout(webselectTimeout); webselectTimeout = setTimeout(function() { jQuery('#webselect ul').hide(); }, 1000); }); } } jQuery(document).ready(function() { $.convertMenu(); $.convertSelect(); $.inputs(); $.webselect(); // OTHER STUFF if (jQuery('.pickadate').length > 0) { $('.pickadate').mouseover(function() {$(this).css('border', '1px solid #ccc')}); $('.pickadate').mouseout(function() {$(this).css('border', '1px solid #eee')}); $('.pickadate').toggle( function() { $('.calendars').show(); $(this).css('background', 'url(/img/site/goup.gif) right no-repeat'); }, function() { $('.calendars').hide(); $(this).css('background', 'url(/img/site/godown.gif) right no-repeat'); } ); } } ); function register(sinField) { var regForm = $('#regform')[0]; formFields = new Array( "email|email|Introdu o adresa de email valida.", "pass|minlen=6|Introdu o parola de minim 6 caractere|Parola", "comfirmpass|equal="+regForm.pass.value+"|Confirma Parola|Cele 2 parole nu se potrivesc", "comfirmpass|minlen=6|Confirma Parola|Confirma Parola", "name|minlen=2|Introdu numele tau|Numele tau", "website|url|Adresa url valida. EX: http://www.gtop.ro" ); if (sinField == 'init') { formFields.each(function(s, index) { var F = s.split("|"); eval("inpObj = regForm."+F[0]); eval("inpObj.onkeyup = function(){register('"+inpObj.name+"');};"); eval("inpObj.onblur = function(){if (this.value == '') {this.value = '"+inpObj.value+"';}register('"+inpObj.name+"');};"); eval("inpObj.onclick = function(){if (this.value == '"+inpObj.value+"') this.value = '';};"); eval("inpObj.onfocus = function(){if (this.value == '"+inpObj.value+"') this.value = '';};"); }); return; } CHECK = true; formFields.each(function(s, index) { var F = s.split("|"); C = 1; if (sinField && sinField != F[0]) C = 0 ; if (C) { // CREATE HINT FIRST eval("inpObj = regForm."+F[0]); if (!$('hintbox'+inpObj.name)) { NODE = Builder.node('div', {className:"hint", style:"display:none", id:('hintbox'+inpObj.name)}); document.body.appendChild(NODE); } hintObj = $('hintbox'+inpObj.name); hintObj.setStyle({display:"none"}); if (F[3] == inpObj.value && F[3]) ret = 0; else ret = validateInput(F[1], inpObj); spanObj = inpObj.parentNode.getElementsByTagName('span')[0]; if (ret) { if (F[0] == 'email') { ajaxCheck(inpObj, 'email', 'Adresa de e-mail este deja folosita'); spanObj.innerHTML = ""; } else if (F[0] == 'website') { ajaxCheck(inpObj, 'website', 'Website-ul este deja inregistrat in baza de date'); spanObj.innerHTML = ""; } else spanObj.innerHTML = ""; } else { spanObj.innerHTML = ""; POS = findInputPos(inpObj); hintObj.setStyle({top:(POS[1]-10)+"px", left:(POS[0]+parseInt(inpObj.offsetWidth)+50)+"px", display:""}); hintObj.innerHTML = F[2]+" "; CHECK = false; } } }) if (!sinField && CHECK) { if (regForm.terms.checked != true) alert('Trebuie sa fi de acord cu regulile si conditile impuse de siteul GTop.ro'); else { tb_showloading(); new Ajax.Request('/remote/forms.php', { method:'post', parameters: { cmd: "register", email: regForm.email.value, pass: regForm.pass.value, name: regForm.name.value, website: regForm.website.value }, onSuccess: function(transport) { var response = transport.responseText; eval(response); }, onFailure: function(){ alert('Something went wrong...') } }); } } return false; } function checkRegForm() { SET = { email: 'email|checkIfEmailExists(obj)', pass:'minlen=6', comfirmpass:'minlen=6|matchPass(obj)', name:'minlen=5', website:'url|checkIfUrlExists(obj)' }; $('#validreg').attr("value",1); if ($('form.registerForm')) { $('form.registerForm input').each(function(i, obj) { if (SET[$(obj).attr('name')]) { if (obj.value == obj.initialValue) { $(this).parent().parent().children('img').attr('src','/img/site/inputerror.gif'); $(this).parent().parent().children('img').attr('width','42'); $(this).parent().parent().children('img').attr('height','31'); $('#validreg').attr("value",0); return false; } else { ret = checkFieldV2(obj, SET[$(obj).attr('name')]); if (!ret) { $(this).parent().parent().children('img').attr('src','/img/site/inputerror.gif'); $(this).parent().parent().children('img').attr('width','42'); $(this).parent().parent().children('img').attr('height','31'); $('#validreg').attr("value",0); return false; } else $(this).parent().parent().children('img').attr('src','/img/site/inputok.gif'); } } }); } if ($('#validreg').attr('value') != 1) return false; if ($('input.terms').attr('checked') != true) { alert('Trebuie sa fi de acord cu regulile si conditile impuse de siteul GTop.ro'); return false; } else { $('#validreg').attr("value",0); regForm = $('form.registerForm')[0]; tb_showloading(); $.ajax({ url:'/remote/forms.php', type:'post', data: { cmd: "register", email: regForm.email.value, pass: regForm.pass.value, name: regForm.name.value, website: regForm.website.value }, success: function(response) { eval(response); }}); } return false; } function registerForm() { SET = { email: 'email|checkIfEmailExists(obj)', pass:'minlen=6', comfirmpass:'minlen=6|matchPass(obj)', name:'minlen=5', website:'url|checkIfUrlExists(obj)' }; if ($('form.registerForm')) { $('form.registerForm input').each(function(i, obj) { eval("obj.initialValue = '"+obj.value+"'"); if (SET[$(obj).attr('name')]) { $(obj).keyup(function() { ret = checkFieldV2(this, SET[this.name]); if (ret == 2) return; if (!ret) { $(this).parent().parent().children('img').attr('src','/img/site/inputerror.gif'); $(this).parent().parent().children('img').attr('width','42'); $(this).parent().parent().children('img').attr('height','31'); } else $(this).parent().parent().children('img').attr('src','/img/site/inputok.gif'); }); $(obj).focus(function() { if (this.value == this.initialValue) this.value = ''; }); $(obj).blur(function() { if (this.value == '') this.value = this.initialValue; }); } } ); } } function matchPass(obj) { if (obj.value != $('#opass').attr('value')) return false; return true; } function checkIfEmailExists(obj) { $(obj).parent().parent().children('img').attr('src', '/img/site/inputloading.gif'); obj.id = 'checkIfEmailExists'; $.ajax( { type:'post', url:'/remote/forms.php', data: {check: 'email', value: obj.value}, success: function(response) { if (response == 1) { obj = $('#checkIfEmailExists'); $(obj).parent().parent().children('img').attr('src', '/img/site/inputerror.gif'); $(obj).parent().parent().children('img').attr('width', '42'); $(obj).parent().parent().children('img').attr('height', '31'); } else { obj = $('#checkIfEmailExists'); $(obj).parent().parent().children('img').attr('src', '/img/site/inputok.gif'); } } }); return 2; } function checkIfUrlExists(obj) { $(obj).parent().parent().children('img').attr('src', '/img/site/inputloading.gif'); obj.id = 'checkIfUrlExists'; $.ajax( { type:'post', url:'/remote/forms.php', data: {check: 'website', value: obj.value}, success: function(response) { if (response == 1) { obj = $('#checkIfUrlExists'); $(obj).parent().parent().children('img').attr('src', '/img/site/inputerror.gif'); $(obj).parent().parent().children('img').attr('width', '42'); $(obj).parent().parent().children('img').attr('height', '31'); } else { obj = $('#checkIfUrlExists'); $(obj).parent().parent().children('img').attr('src', '/img/site/inputok.gif'); } }}); return 2; } function checkFieldV2(obj, args) { checks = args.split("|"); for (j=0;j document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer if(document.documentElement.clientWidth){ windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = xScroll; } else { pageWidth = windowWidth; } return [pageWidth,pageHeight]; } function expand(object) { parObj = object.parentNode.parentNode; if ((parObj.className == 'row expand') || (parObj.className == 'expand')) { object.innerHTML = 'expandare detalii expandare detalii'; elem = parObj.getElementsByTagName('div'); for (i=0;i max) { text = text.substr(0, max); obj.value = text; len = max; } jQuery('#'+id).html(max-len); } function checkField(obj, args, errorspanid) { ret = validateInput(args, obj); if (!ret) { jQuery('#'+errorspanid).html(''); return false; } else { jQuery('#'+errorspanid).html(''); return true; } } function showLangMenu(obj) { if (obj.getElementsByTagName('ul')[0].style.display == '') { obj.getElementsByTagName('ul')[0].style.display = 'none'; } else { obj.getElementsByTagName('ul')[0].style.display = ''; } return false; } var fastSelectTimeout; function fastSelect() { if ($('#fastselect').css("display") == 'block') { $('#fastselect').hide(); clearTimeout(fastSelectTimeout); return false; } POS = findInputPos($('#selb')[0]); $('#fastselect').css("display",'block'); off = ($('#fastselect').attr('offsetWidth')-8); $('#fastselect').css("left",(POS[0]-off)+'px'); jQuery('#fastselect ul').mouseover(function() { if (fastSelectTimeout) clearTimeout(fastSelectTimeout); }); jQuery('#fastselect ul').mouseout(function() { if (fastSelectTimeout) clearTimeout(fastSelectTimeout); fastSelectTimeout = setTimeout(function() { jQuery('#fastselect').hide(); }, 2000); }); $('#fastselect').click(function() { $('#fastselect').hide(); }); fastSelectTimeout = setTimeout(function() { $('#fastselect').hide(); }, 2000 ); return false; } function slideFeedback() { if (!jQuery('#feedbackform')) return; jQuery('#feedbackform').css("width", document.body.offsetWidth+'px'); if ($.browser.msie && $.browser.version.substr(0,1)<7) jQuery('#feedback').css('left', '-500px'); if ($('#feedbackform').css("top") == '0px') { if ($.browser.msie && $.browser.version.substr(0,1)<7) jQuery('#feedbackform').animate({top: -363},300); else jQuery('#feedbackform').animate({top: -360},300); jQuery('embed').css("visibility", "hidden"); jQuery('object').css("visibility", "hidden"); } else { jQuery('#feedbackform').animate({top: 0},400,'linear'); jQuery('embed').css("visibility", "visible"); jQuery('object').css("visibility", "visible"); } return false; } function sendFeedback(formobj) { if (!checkField(formobj.email,'email','emailicon')) { alert('Introdu o adresa de email valida'); return false; } if (!checkField(formobj.text,'minlen=20','descicon')) { alert('Introdu mesajul tau de minimum 20 de caractere'); return false; } vaca = $('#topicar').attr('value'); $.ajax({ type: "POST", url:'/remote/forms.php', data: { cmd: "feedback", email: formobj.email.value, pass: formobj.text.value, domain: formobj.domain.value, topic:vaca, browser:$('feedBackInfo').innerHTML }, success: function(result) { } }); $('#feedmsg').html('

    FeedBack:


    Va multumim!

    Mesajul a fost trimis cu succes
    Veti fi contactat in cel mai scurt timp'); $('#feedBackInfo').hide(); return false; } jQuery(window).resize(function() { if (jQuery('#feedbackform')) { jQuery('#feedbackform').css("width", document.body.offsetWidth+'px'); if (document.body.offsetWidth<1000) jQuery('#feedbackform').css("width", '1000px'); if (document.body.offsetWidth > 1000) jQuery('#feedback').css('left', (document.body.offsetWidth-1000)/2+'px'); if ($.browser.msie && $.browser.version.substr(0,1)<7) { $('#feedbackform').css("top", "-363px"); jQuery('#feedback').css('left', '-250px'); } } }); jQuery(document).ready(function() { if (document.body.offsetWidth > 1000) jQuery('#feedback').css('left', (document.body.offsetWidth-1000)/2+'px'); if ($.browser.msie && $.browser.version.substr(0,1)<7) { $('#feedbackform').css("top", "-363px"); jQuery('#feedback').css('left', '-250px'); jQuery('#feedback').css('top', '-1px'); } if (jQuery('#uptimeStats').length > 0) { $('#uptimeStats').tipsy({fallback: "Website Uptime",gravity:'w' }); $('#placeStats').tipsy({fallback: "Loc in clasament",gravity:'w' }); $('#twentyStats').tipsy({fallback: "Vizite in ultimele 24 de ore",gravity:'w' }); } }); function removeNotif() { jQuery.ajax({ type: "POST", url: "/remote/forms.php", data: {cmd:"removenotice"}, success: function(result) { } }); jQuery('.notice').fadeOut(); return false; } function deleteWebsite(key) { if (confirm("Sunteti sigur ca doriti sa stergeti acest site?")) if (confirm("Inregistrarile si setarile acestui site vor fi sterse permanent. Continuati ?")) location.href='/forms/delete?site='+key; return false; } function regScreen(key) { jQuery.ajax({ type: "POST", url: "/remote/forms.php", data: {cmd:"regenerateThumb",key:key}, success: function(result) { alert("Screenshotul website-ului tau este trimis catre regenerare."); } }); return false; } function addAlias(obj, site) { if (!isDomain(obj.alias, 0)) { alert("Introdu un domeniu valid"); return false; } jQuery.ajax({ type: "POST", url: "/remote/forms.php", data: {cmd:"addAlias",domain:obj.alias.value,site:site}, success: function(result) { if (result == 'e') alert("Alias-ul deja exista"); if (result == 'www') alert("Alias-ul deja exista"); if (result == 'code') alert("Nu am putut verifica autenticitatea cererii. Va rugam verificati codul html al site-ului principal, sa fie inclus in site."); else if (is_numeric(result)) { jQuery('#nowebsitealias').parent().remove(); jQuery('#aliaslist').append(''+obj.alias.value+'pending Sterge Alias') } } }); return false; } function deleteAlias(id, site, obj) { if (!confirm('Esti sigur ca doresti sa stergi acest alias?')) return; jQuery.ajax({ type: "POST", url: "/remote/forms.php", data: {cmd:"delAlias",id:id, site:site}, success: function(result) { jQuery(obj).parent().parent().fadeOut( 'slow', function() { if (jQuery(obj).parent().parent().parent().children('tr').size() == 1) { jQuery('#aliaslist').append('Nu exista alias adaugat'); } jQuery(obj).parent().parent().remove(); } ); } }); return false; } function is_numeric (mixed_var) { return (typeof(mixed_var) === 'number' || typeof(mixed_var) === 'string') && mixed_var !== '' && !isNaN(mixed_var); } jQuery(document).ready(function() { if (location.hash) { HASH = location.hash; ID = location.hash.replace("#", ""); jQuery('#'+ID).css("background", "#D0E8F9"); location.hash = HASH; } }); var SITEID; function updateLastVisits(id) { SITEID = id; jQuery.ajax({ type: "POST", url: "/remote/forms.php", dataType: 'json', data: {cmd:"updateLastVisits",site:id}, success: function(result) { showLastVisitsLine(result); } }); } function showLastVisitsLine(result) { left = 0; jQuery.each(result, function(index, value) { left = 1; insert = ""; insert += ""; insert += ""+value.date+""; insert += ""+value.ip+""; insert += ""+value.country+""; insert += ""+value.referer+""; insert += ""+value.os+""; insert += ""+value.browser+""; insert += ""; delete result[index]; if (!jQuery('#last'+value.id).html()) { if (jQuery('#lastVisitsInsert tr').size() > 10) jQuery('#lastVisitsInsert tr:last').remove(); jQuery('#lastVisitsInsert').prepend(jQuery(insert).hide().fadeIn('slow', function() { showLastVisitsLine(result); })); jQuery('#last'+value.id).css("display", ""); return false; } else left = 0; }); if (left == 0) { setTimeout(function() {updateLastVisits(SITEID);}, 2000) } } function deactivateAccount() { if (!confirm('Sunteti sigur ca vreti sa dezactivati contul?')) return false; jQuery.ajax({ type: "POST", url: "/remote/forms.php", data: {cmd:"deactivateAccount"}, success: function(result) { } }); alert('Pentru dezactivare deschide linkul din e-mail'); return false; } function exportDoc(type) { jQuery('#exporttype').attr('value', type); jQuery('#exporthtml').attr('value', ''); jQuery('#exporthtml').attr('value', jQuery('#sortable').html()); jQuery('#exporthtml').parent().submit(); return false; } var win=null; function NewWindow(mypage,myname,w,h,scroll,pos){ if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;} else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20} settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings);}