<!-- Developed by Zalog Catalin, http://portfolio.webworks.ro
/******************************************************** Daca rezolutie mai mica de 1024 pun alta poza */
var __popupWin = null;

function popup2(url) 
{ 
    var width = arguments[1] ? arguments[1] : 950;
    var height = arguments[2] ? arguments[2] : 750;
    var scrollbars = arguments[3] ? arguments[3] : 'no';
    var resizable = arguments[4] ? arguments[4] : 'no';
    var targetName = arguments[5] ? arguments[5] : 'info';
    var modal = arguments[6] ? arguments[6] : 'no';

    var LeftPosition = 0;
    var TopPosition = 0;

    if (__popupWin != null && !__popupWin.closed) {
        __popupWin.close(); 
    }

    try {
        if(window.opener){
            LeftPosition =(window.opener.innerWidth-width) / 2;
            TopPosition =((window.opener.innerHeight-height)/2) + 60;
        } else if(window.innerWidth) {
            LeftPosition =(window.innerWidth-width) / 2;
            TopPosition =((window.innerHeight-height)/2) + 60;
        } else {
            LeftPosition =(parseInt(window.screen.width) - width)/2;
            TopPosition=((parseInt(window.screen.height) - height)/2) + 60;
        }
    } catch(e) {}

    __popupWin = window.open(url,targetName,'scrollbars='+scrollbars+',width='+width+
        ',height='+height+',resizable='+resizable+',left=' + LeftPosition + 
        ',top=' + TopPosition+',modal='+modal);

    if (window.focus) {
        __popupWin.focus();
    }
    return __popupWin;
}

window.onload = function() {
	if(document.body.offsetWidth<=1024){
		document.getElementById('bgLeftTop').style.backgroundImage = "url(imgs/bg-left-top-1024.png)";
	}
	if(document.body.offsetWidth>1024){
		document.getElementById('bgLeftTop').style.backgroundImage = "url(imgs/bg-left-top.png)";
	}
}
window.onresize = function() {
	if(document.body.offsetWidth<=1024){
		document.getElementById('bgLeftTop').style.backgroundImage = "url(imgs/bg-left-top-1024.png)";
	}
	if(document.body.offsetWidth>1024){
		document.getElementById('bgLeftTop').style.backgroundImage = "url(imgs/bg-left-top.png)";
	}
}

/******************************************************** popup-uri */
function showBox(box) {
	if (box == 'boxListen') {
		popup2('http://www.vibefm.ro/live.php');
	}else {
	    body_height = document.getElementById("bgLeftTop").offsetHeight;
	    document.getElementById(box).style.display = "block";
	    document.getElementById("cover").style.display = "block";
	    if (body_height < 768) {
	        document.getElementById("cover").style.height = "1024px";
	    } else {
	        document.getElementById("cover").style.height = body_height + "px";
	    }
	}
}
function hideBox() {
	document.getElementById("boxFormularInscrisi").style.display = "none";  
	document.getElementById("boxListen").style.display = "none";
	document.getElementById("boxPodcast").style.display = "none";
	document.getElementById("boxAccount").style.display = "none";
	document.getElementById("boxLogin").style.display = "none";
	document.getElementById("boxSendToFriend").style.display = "none";
	document.getElementById("boxComment").style.display = "none";
	document.getElementById("boxProfil").style.display = "none";
  document.getElementById("cover").style.display = "none";
  document.getElementById("boxVibetine").style.display = "none";
}

/******************************************************** Arata DIV-ul de la am uitat parola */
function loginForget() {
	if ( document.getElementById('login').style.display == "block" ) {
		document.getElementById('loginForget').className = 'content forget';
		document.getElementById('login').style.display = "none";
		document.getElementById('forgetPass').style.display = "block";
	} else {
		document.getElementById('loginForget').className = 'content login';
		document.getElementById('login').style.display = "block";
		document.getElementById('forgetPass').style.display = "none";
	}
}

/******************************************************** Poll */
function showPollResults() {
	document.getElementById('poll').style.display = "none";
	document.getElementById('pollResults').style.display = "block";
}
/****************************************************** Pop up */
function openNewWindow(url,name,windowWidth,windowHeight){
	myleft=(screen.width)?(screen.width-windowWidth)/2:100;
	mytop=(screen.height)?(screen.height-windowHeight)/2:100;
	properties = "width="+windowWidth+",height="+windowHeight+",noresize,scrollbars=no,top="+mytop+",left="+myleft;
	focusWindow = window.open(url,name,properties);
	focusWindow.focus();
}

/**************************************************** Bookmark */
/* tree facut */

///// ******* VibeTINE

function isInteger(s)
{
        var i;
        for (i = 0; i < s.length; i++) {
                // Check that current character is number.
                var c = s.charAt(i);
                if (((c < "0") || (c > "9"))) return false;
        }

        // All characters are numbers.
        return true;
}
function checkEmail(e) {
        ok = '1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM';

        for(i = 0; i < e.length; i++){
                if(ok.indexOf(e.charAt(i)) < 0)
                        return (false);
        }

        if (document.images) {
                re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
                re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
                if (!e.match(re) && e.match(re_two))
                        return (-1);
        }
}



function checkVibetine() {
  var nume = document.getElementById('vt-your-name').value;
  var email = document.getElementById('vt-your-email').value;
  var varsta = document.getElementById('vt-varsta').value;
  var telefon = document.getElementById('vt-telefon').value;
  var melodia = document.getElementById('vt-melodia').value; 
  var mesaj = document.getElementById('vt-message').value;
  var alert_msg = '';
  
  if (nume.length < 3 || nume == 'numele tau...') {
    alert_msg += 'Nume invalid!\n'; 
  }
  if (!checkEmail(email)) {
    alert_msg += 'Email invalid!\n'; 
  }
  if (!isInteger(varsta)) {
    alert_msg += 'Varsta incorecta!\n'; 
  }
  if (telefon.length < 3 || telefon == 'telefon...') {
    alert_msg += 'Telefon invalid!\n'; 
  }
  if (melodia.length < 3) {
    alert_msg += 'Melodia e invalida!\n'; 
  }
  if (mesaj.length < 3 || mesaj == 'dedicatie...') {
    alert_msg += 'Mesajul e invalid!\n'; 
  }

  if (alert_msg.length > 0) {
    alert(alert_msg);
    return false;
  }else {
	  return true;
  }

  
} 
function clickText(el, text) {
  if (el.value == text) {
    el.value = '';
  }  
}
function blurText(el, text) {
  if (el.value == '') {
    el.value = text;
  }  
}




-->



