// >>>>> js funktion ob array existiert (gleich wie php: is_array()) <<<<< 
function is_array(obj)
{
	return(typeof(obj.length)=="undefined")?false:true;
}

// >>>>> js funktion für überprüfung ob wert in array (gleich wie php: in_array()) <<<<< 
function in_array(stringToSearch, arrayToSearch) {
	for (s = 0; s < arrayToSearch.length; s++) {
		thisEntry = arrayToSearch[s].toString();
		if (thisEntry == stringToSearch) {
			return true;
		}
	}
	return false;
}

// >>>>> js funktion für überprüfung ob wert in multiple array <<<<< 
function in_multi_array($needle, $haystack)
{
    $in_multi_array = false;
    if(in_array($needle, $haystack))
    {
        $in_multi_array = true;
    }
    else
    {   
        for($i = 0; $i < sizeof($haystack); $i++)
        {
            if(is_array($haystack[$i]))
            {
                if(in_multi_array($needle, $haystack[$i]))
                {
                    $in_multi_array = true;
                    break;
                }
            }
        }
    }
    return $in_multi_array;
}

// >>>>> js funktion für zeichenaustausch in einem string (gleich wie php: str_replace()) <<<<< 
function str_replace(search, replace, subject, count) {
    // Replaces all occurrences of search in haystack with replace  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/str_replace
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Gabriel Paderni
    // +   improved by: Philip Peterson
    // +   improved by: Simon Willison (http://simonwillison.net)
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   bugfixed by: Anton Ongson
    // +      input by: Onno Marsman
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    tweaked by: Onno Marsman
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   input by: Oleg Eremeev
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Oleg Eremeev
    // %          note 1: The count parameter must be passed as a string in order
    // %          note 1:  to find a global variable in which the result will be given
    // *     example 1: str_replace(' ', '.', 'Kevin van Zonneveld');
    // *     returns 1: 'Kevin.van.Zonneveld'
    // *     example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars');
    // *     returns 2: 'hemmo, mars'
    var i = 0, j = 0, temp = '', repl = '', sl = 0, fl = 0,
            f = [].concat(search),
            r = [].concat(replace),
            s = subject,
            ra = r instanceof Array, sa = s instanceof Array;
    s = [].concat(s);
    if (count) {
        this.window[count] = 0;
    }

    for (i=0, sl=s.length; i < sl; i++) {
        if (s[i] === '') {
            continue;
        }
        for (j=0, fl=f.length; j < fl; j++) {
            temp = s[i]+'';
            repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];
            s[i] = (temp).split(f[j]).join(repl);
            if (count && s[i] !== temp) {
                this.window[count] += (temp.length-s[i].length)/f[j].length;}
        }
    }
    return sa ? s : s[0];
}

// blättern bei gallerys
function f_gallery_page(c_id, show_page, pages) {

	var hide_id, show_id;

	for (i=1; i<=pages; i++)
	{
		if (i != show_page)
		{
			hide_id = 'gallery_' + c_id + '_' + i;
			//alert('Hide: ' + hide_id);
			document.getElementById(hide_id).style.display = 'none';
		}
	}

	show_id = 'gallery_' + c_id + '_' + show_page;
	//alert('Show: ' + show_id);
	document.getElementById(show_id).style.display = 'block';
	document.forms['gal_form'].elements['show_page_print'].value = show_page;

}
//grosses bild onclick
function do_big_gal_pic(g_img, g_width, g_height) {
	//alert("???");
	document.big01.src = "/_img/_lrg/" + g_img;
	document.big01.width = g_width;
	document.big01.height = g_height;
}


//grosses bild onclick
function do_pic_systeme01(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.nachher.src = "/_pix/systeme/" + x + ".jpg";
	} else {
		document.nachher.src = "/_pix/systeme/" + x + ".jpg";
	}
}

//grosses bild onclick
function do_pic_systemevorher01(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.vorher.src = "/_pix/systeme/" + x + ".jpg";
	} else {
		document.vorher.src = "/_pix/systeme/" + x + ".jpg";
	}
}


//grosses bild onclick
function do_pic_looks(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.nachher.src = "/_pix/looks2008/" + x + ".jpg";
	} else {
		document.nachher.src = "/_pix/looks2008/" + x + ".jpg";
	}
}

//grosses bild onclick
function do_pic_looksvorher(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.vorher.src = "/_pix/looks2008/" + x + ".jpg";
	} else {
		document.vorher.src = "/_pix/looks2008/" + x + ".jpg";
	}
}



//grosses bild onclick
function do_pic_vienna05(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big01.src = "/_pix/vienna/city/" + x + ".jpg";
	} else {
		document.big01.src = "/_pix/vienna/city/" + x + ".jpg";
	}
}
function do_pic_vienna06(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big01.src = "/_pix/vienna/ankunft/" + x + ".jpg";
	} else {
		document.big01.src = "/_pix/vienna/ankunft/" + x + ".jpg";
	}
}
function do_pic_vienna04(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big01.src = "/_pix/vienna/empfang/" + x + ".jpg";
	} else {
		document.big01.src = "/_pix/vienna/empfang/" + x + ".jpg";
	}
}
function do_pic_vienna03(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big01.src = "/_pix/vienna/gala/" + x + ".jpg";
	} else {
		document.big01.src = "/_pix/vienna/gala/" + x + ".jpg";
	}
}
function do_pic_vienna02(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big01.src = "/_pix/vienna/airpressure/" + x + ".jpg";
	} else {
		document.big01.src = "/_pix/vienna/airpressure/" + x + ".jpg";
	}
}
function do_pic_vienna01(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big01.src = "/_pix/vienna/falco/" + x + ".jpg";
	} else {
		document.big01.src = "/_pix/vienna/falco/" + x + ".jpg";
	}
}
function do_pic_vienna(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big01.src = "/_pix/vienna/modelle/" + x + ".jpg";
	} else {
		document.big01.src = "/_pix/vienna/modelle/" + x + ".jpg";
	}
}


//grosses bild onclick
function do_pic_tomorrows(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big01.src = "/_pix/tomorrows/" + x + ".jpg";
	} else {
		document.big01.src = "/_pix/tomorrows/" + x + ".jpg";
	}
}

//grosses bild onclick
function do_pic_tomorrowsvorher(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.bigvorher.src = "/_pix/tomorrows/" + x + ".jpg";
	} else {
		document.bigvorher.src = "/_pix/tomorrows/" + x + ".jpg";
	}
}

//grosses bild onclick
function do_pic_ueberuns(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big.src = "/_pix/ueberuns/" + x + ".jpg";
	} else {
		document.big.src = "/_pix/ueberuns/" + x + ".jpg";
	}
}

//grosses bild onclick
function do_pic_haar(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big.src = "/_pix/haar/" + x + ".jpg";
	} else {
		document.big.src = "/_pix/haar/" + x + ".jpg";
	}
}

function do_pic_systeme(x) {
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
		document.layerbg.document.gross.document.big.src = "/_pix/systeme/" + x + ".jpg";
	} else {
		document.big.src = "/_pix/systeme/" + x + ".jpg";
	}
}

// js funktion ob array existiert (gleich wie php: is_array())
function is_array(obj)
{
	return(typeof(obj.length)=="undefined")?false:true;
}




