/*
** ** # "Yet Another Mobile Entertainment Portal" (c) by net-m #
** **
** Basis JavaScript functions
*/
function sendFormOnSelect(id){
if (id.options[id.selectedIndex].value !="none"){
id.form.submit();
}
}
function callUrlOnSelect(id){
if (id.options[id.selectedIndex].value !="none"){
window.location.href=id.options[id.selectedIndex].value;
}
}
function isNumeric(sText) {
var ValidChars = "0123456789";
var Char;
for (i = 0; i < sText.length; i++) {
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1) {
return false;
}
}
return true;
}
/* check msisdn */
function msisdnCheckSingle(vorwahl, rufnummer){
if (vorwahl.substring(0,1) == '0' && vorwahl.length >= 4 && rufnummer.length >= 6 && isNumeric(rufnummer))
return true;
else{
return false;
}
}
/* check tan */
function tanCheck(tannum){
if (tannum.length >= 4 && tannum.length <= 32 && tannum != "Gutscheincode")
return true;
else
return false;
}
/* check form for TAN payment */
function PayTAN(){
if (msisdnCheckSingle(document.getElementById("vorwahl").value, document.getElementById("rufnummer").value) ){
//if (document.getElementById("tanagb").checked==true) {
if (tanCheck(document.getElementById("tantan").value)) {
document.getElementById("tanmsisdn").value="0049"+document.getElementById("vorwahl").value.substring(1)+document.getElementById("rufnummer").value;
document.getElementById("sendtan").value="";
return true;
}
else {
alert("Gib bitte Deinen Gutscheincode ein.");
document.getElementById("tantan").focus();
return false;
}
//}
//else {
// alert("Bitte akzeptiere die AGB!");
// return false;
//}
}
else{
alert("Gib bitte Deine Rufnummer korrekt ein. Z.B. Vorwahl 0178 und Rufnummer 1234567");
document.getElementById("vorwahl").focus();
return false;
}
return false;
}
function doFlashNew2(ctype,id,divid){
var divstate = $("state"+divid); // getElementById
var imgid = $("play"+divid); // getElementById
// if actual state == img - pressed play button
if(divstate.value=='img'){
// so - include flash-player and swap image to stop
incText = '';
divstate.value = 'flash';
imgid.src = './img/icon_small_prelisten_stop.gif';
}
// else actual state == flash - pressed stop button
else{
// so - include "nothing" and swap image to play
incText = "";
divstate.value = 'img';
imgid.src = './img/icon_small_prelisten_play.gif';
}
// set all states to 'img'
// except the pressed button
ctypes = new Array ('ringt', 'rrringt', 'pringtx', 'msound', 'fulltrack');
for (var j = 0; j < ctypes.length; j++) {
for (var i = 0; i <= 20; i++) {
wanted = 'prlstn2' + ctypes[j] + i;
if (divid != wanted) {
var wanted_divstate = $("state"+wanted);
var wanted_imgid = $("play"+wanted); // getElementById
if(wanted_divstate != null){
wanted_divstate.value = 'img';
if(wanted_imgid != null){
wanted_imgid.src = './img/icon_small_prelisten_play.gif';
}
}
}
}
}
// *#'
var jse1 = document.createElement('SCRIPT');
jse1.type = 'text/javascript';
jse1.text = "div = document.getElementById('streamplayer');\ndiv.innerHTML = '" + incText + "';";
document.body.appendChild (jse1);
return true;
}
function doFlashNew3(ctype,id,divid){
var divstate = $("state"+divid); // getElementById
var imgid = $("play"+divid); // getElementById
// if actual state == img - pressed play button
if(divstate.value=='img'){
// so - include flash-player and swap image to stop
incText = '';
divstate.value = 'flash';
imgid.src = './img/icon_small_prelisten_stop.gif';
}
// else actual state == flash - pressed stop button
else{
// so - include "nothing" and swap image to play
incText = "";
divstate.value = 'img';
imgid.src = './img/icon_small_prelisten_play.gif';
}
// set all states to 'img'
// except the pressed button
ctypes = new Array ('ringt', 'rrringt', 'pringtx', 'msound', 'fulltrack');
for (var j = 0; j < ctypes.length; j++) {
for (var i = 0; i <= 20; i++) {
wanted = 'prlstn3' + ctypes[j] + i;
if (divid != wanted) {
var wanted_divstate = $("state"+wanted);
var wanted_imgid = $("play"+wanted); // getElementById
if(wanted_divstate != null){
wanted_divstate.value = 'img';
if(wanted_imgid != null){
wanted_imgid.src = './img/icon_small_prelisten_play.gif';
}
}
}
}
}
// *#'
var jse1 = document.createElement('SCRIPT');
jse1.type = 'text/javascript';
jse1.text = "div = document.getElementById('streamplayer');\ndiv.innerHTML = '" + incText + "';";
document.body.appendChild (jse1);
return true;
}
/* adjust iframe */
document.domain = "eplus-unlimited.de";
var b=0
var first=false;
function gAP()
{
if (document.getElementById)
{
if (!first)
{
first=true;
hochscrollen();
}
setTimeout("dgAP()",1000)
dgAP()
}
}
function hochscrollen()
{
parent.scrollTo(100,0)
}
function dgAP(i)
{
a=document.ende;
y=a.offsetTop;
while((a = a.offsetParent) != null)
{
y += a.offsetTop;
}
parent.adjustFrame(y);
}