//COOKIES function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } //ART UTILS var ttFontSize=12; function increaseFontSize(elema,elemb) { if(ttFontSize <= 16) { ttFontSize++; elema.style.fontSize = ttFontSize+'px'; if(elemb) elemb.style.fontSize = ttFontSize+'px'; createCookie('ttFontSize',ttFontSize,14); } } function decreaseFontSize(elema,elemb) { if(ttFontSize >= 10) { ttFontSize--; elema.style.fontSize = ttFontSize+'px'; if(elemb) elemb.style.fontSize = ttFontSize+'px'; createCookie('ttFontSize',ttFontSize,14); } } function updateRecomandari(vArticleID,nr){ //change link $('recomandaArticol').href="javascript:void(0);"; if($('recomandaArticol01')) $('recomandaArticol01').href="javascript:void(0);"; $('recomandaArticol').innerHTML="+"+(nr+1); if($('recomandaArticol01')) $('recomandaArticol01').innerHTML="+"+(nr+1); new Ajax.Request(pathWWW+'/getajax|recommendArticle', { method:'post', parameters: {articleID: vArticleID }, onSuccess: function(){ //set cookie createCookie('rec_'+vArticleID,'true',14); }, onFailure: function(){ } }); } function printerFriendly(urlToOpen) { var x = (screen.width-650)/2, y = (screen.height-450)/2; OpenWin = this.open(urlToOpen, "CtrlWindow", "width=650,height=450,toolbars=0,menubar=no,location=no,scrollbars=yes,resizable=no,screenX="+x+",screenY="+y+",left="+x+",top="+y); } //COMMENTS function displayCommentForm() { Effect.toggle($('posteaza'),'slide'); new Effect.ScrollTo($('posteazaC')); } function postComment(articleID) { Effect.toggle($('posteaza'),'slide'); new Ajax.Request(pathWWW+'/getajax|handleComments', { method:'post', parameters: {cArticleID: articleID,cUser: ($('cUser') ? $('cUser').value : "") , cText: $('cText').value, postComment: '1' }, onSuccess: function(transport){ if($('cUser')) $('cUser').value = ''; if($('cText')) $('cText').value =''; $('comentarii').style.display = "block"; //set cookie createCookie('lastPost','true',(1/24/60/2)); var response = transport.responseXML; writeComments(response); }, onFailure: function(){ } }); } function writeComments(rXML) { if(document.all) { var detalii = rXML.childNodes[1].childNodes[0]; var comments = rXML.childNodes[1].childNodes[1]; } else { var detalii = rXML.childNodes[0].childNodes[0]; var comments = rXML.childNodes[0].childNodes[1]; } //build pages var page = detalii.childNodes[0].firstChild.nodeValue; var totalPages = detalii.childNodes[1].firstChild.nodeValue; var totalcomentarii = detalii.childNodes[2].firstChild.nodeValue; var path= detalii.childNodes[3].firstChild.nodeValue; var articleID = detalii.childNodes[4].firstChild.nodeValue; var pager='Pagina '; for(j=0; j < totalPages; j++) { if((j+1)==page) { pager+=" "+(j+1)+" "; } else { pager+=" "+(j+1)+" "; } } var content = ""; if(totalPages > 1) content+='
'+cUser+' Adaugat acum
'+cDiff+'
'+cText+'
'; content+='| ');
else
var cell = document.createElement('td');
cell.setAttribute('colspan','3');
//create img
var nimg = document.createElement('img');
if(document.all)
nimg.src="images/pop-up/sageata_sus.gif";
else
nimg.src="images/pop-up/sageata_sus.png";
nimg.className="tooltipUpArrow";
nimg.id = "toolArrowU";
cell.appendChild(nimg);
row.appendChild(cell);
tbb.appendChild(row);
//end create up arrow td
//create top tooltip
var row = document.createElement('tr');
var cell = document.createElement('td');
cell.className="tooltipCorner_ul";
row.appendChild(cell);
var cell = document.createElement('td');
cell.className="tooltipBar_u";
row.appendChild(cell);
var cell = document.createElement('td');
cell.className="tooltipCorner_ur";
row.appendChild(cell);
tbb.appendChild(row);
//end create top tooltip
if(doNotCloseAfter) {
var imgClose = " | ');
else
var cell = document.createElement('td');
cell.setAttribute('colspan','3');
//create img
var nimg = document.createElement('img');
if(document.all)
nimg.src="images/pop-up/sageata_jos.gif";
else
nimg.src="images/pop-up/sageata_jos.png";
nimg.className="tooltipDownArrow";
nimg.id = "toolArrowD";
cell.appendChild(nimg);
row.appendChild(cell);
tbb.appendChild(row);
//end create down arrow td
tbl.appendChild(tbb);
newdiv.appendChild(tbl);
newdiv.className ="tooltipDiv";
//add tooltip to document
document.body.appendChild(newdiv);
//position tooltip
setPopupPosition(obj,newdiv);
Effect.Appear(newdiv.id,{duration:.2});
//set fade out
if(!doNotCloseAfter)
globalTimeout = window.setTimeout('Effect.Fade(\'tooltipX\', {duration:.3,from:1.0, to:0.0})',2500);
//========================================
}
function setRespondPosition(el, x) {
var direction = "up";
var position = Position.cumulativeOffset(el);
var scrollY = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
var viewHeight = (navigator.userAgent.toLowerCase().indexOf("safari") != -1 && window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight;
x.style.left = position[0]-10 + "px";
var popupTop = position[1] + Element.getHeight(el);
if((popupTop + x.offsetHeight > scrollY + viewHeight) && (position[1] - x.offsetHeight > scrollY))
popupTop = position[1] - x.offsetHeight ;
if(popupTop > (scrollY + Element.getHeight(x) + 40 + Element.getHeight(el)))
direction="down";
if(direction == "up")
x.style.top = (popupTop+5) + "px";
else
x.style.top = (popupTop - Element.getHeight(x) - (document.all ? 5 : 5) - Element.getHeight(el)) + "px";
}
function setPopupPosition(el, x) {
var direction = "up";
var position = Position.cumulativeOffset(el);
var scrollY = document.body.scrollTop ?
document.body.scrollTop : document.documentElement.scrollTop;
var viewHeight = (navigator.userAgent.toLowerCase().indexOf("safari") != -1 &&
window.innerHeight) ? window.innerHeight :
document.documentElement.clientHeight;
x.style.left = position[0]-40 + "px";
var popupTop = position[1] + Element.getHeight(el);
if((popupTop + x.offsetHeight > scrollY + viewHeight) &&
(position[1] - x.offsetHeight > scrollY))
{
popupTop = position[1] - x.offsetHeight ;
}
if(popupTop > (scrollY + Element.getHeight(x) + 40 + Element.getHeight(el))) {
direction="down";
$('toolArrowD').style.visibility = "visible";
} else {
$('toolArrowU').style.visibility = "visible";
}
if(direction == "up")
x.style.top = (popupTop+30) + "px";
else
x.style.top = (popupTop - Element.getHeight(x) - (document.all ? 20 : 30) - Element.getHeight(el)) + "px";
}
function hidePopup() {
if($('tooltipX')) {
document.body.removeChild($('tooltipX'));
window.clearTimeout(globalTimeout);
}
}
function validateComment() {
if($('cUser'))
var cUser = $('cUser');
var cText = $('cText');
if(cUser) {
if(Validation.get('required').test(cUser.value)) {
} else {
showToolTipFader('Completati numele dumneavostra.',cUser);
cUser.focus();
return false;
}
}
if(Validation.get('required').test(cText.value)) {
} else {
showToolTipFader('Adaugati comentariul',cText);
cText.focus();
return false;
}
return true;
}
function initPage(){
if(readCookie('ttFontSize')) {
ttFontSize = readCookie('ttFontSize');
if($('teaserArticol'))
$('teaserArticol').style.fontSize = ttFontSize+'px';
if($('textArticol'))
$('textArticol').style.fontSize = ttFontSize+'px';
} else {
ttFontSize = 12;
}
}
function initHomeSlider() {
$('TTslider').innerHTML =' Imagini Pretul locuintelor in Capitala va mai creste cu...';
$('TTslider').innerHTML+=' Video Pretul locuintelor in Capitala va mai creste cu...';
$('TTslider').innerHTML+=' Imagini Pretul locuintelor in Capitala va mai creste cu...';
}
var previousOnload = window.onload;
window.onload = function() {
//setTimeout('initHomeSlider()',2000);
if(previousOnload)
previousOnload();
addReflections();
}
var sliderTTMargin = 0;
var sliderMultiple = 232;
var sliderCurrentMove = 0;
var sliderMotion = '';
var sliderOnTheMove = false;
var sliderMoveBy = 10;
function rollLeft() {
if(!sliderOnTheMove && sliderTTMargin < 0) {
clearTimeout(sliderMotion);
currentMove = 0;
moveSlider('l');
$('fwImg').style.display = "block";
}
}
function moveSlider(dir) {
var move = sliderTTMargin;
var acc = Math.round(sliderMoveBy*((sliderMultiple-sliderCurrentMove)/118));
sliderOnTheMove = true;
switch(dir) {
case 'l': move = sliderTTMargin + acc;
break;
case 'r': move = sliderTTMargin - acc;
break;
}
$('sliderTT').style.left = move+"px";
sliderCurrentMove = sliderCurrentMove+10;
sliderTTMargin = move;
if(sliderCurrentMove >= sliderMultiple) {
sliderCurrentMove = 0;
clearTimeout(sliderMotion);
sliderOnTheMove = false;
} else {
sliderMotion = setTimeout(function() { moveSlider(dir); },10);
}
if(sliderTTMargin < -700) {
$('fwImg').style.display = "none";
}
if(sliderTTMargin > -2) {
$('bcImg').style.display = "none";
}
}
function rollRight() {
if(!sliderOnTheMove && sliderTTMargin > -702) {
clearTimeout(sliderMotion);
currentMove = 0;
moveSlider('r');
$('bcImg').style.display = "block";
}
}
function scrollAnchor(idz) {
new Effect.ScrollTo(idz);
}
function validateSearch() {
if($('micaCautare').value == 'cauta in site') {
showToolTipFader('Defineste cautarea.',$('micaCautare'));
$('micaCautare').focus();
return false;
}
if($('micaCautare').value == '') {
showToolTipFader('Defineste cautarea.',$('micaCautare'));
$('micaCautare').focus();
return false;
}
return true;
}
function validatePlay() {
var field = $('playField');
if(Validation.get('validate-alphatwo').test(field.value) && field.value.length > 2) {
return true;
} else {
showToolTipFader('Cuvantul trebuie sa fie format exclusiv din litere',field);
field.focus();
return false;
}
}
function validateNlEmail() {
var field = $('nlEmail');
var mess = "Adresa de email este invalida \nExemplu: popesecu@example.ro";
if(Validation.get('validate-email').test(field.value) && field.value.length > 1) {
} else {
showToolTipFader(mess,field);
field.focus();
return false;
}
return true;
}
|