// stripe/funcs.js
var imgsPath = (document.location.href.split("testimonials"))[0] + "testimonials/stripe/imgs/";
var imgCnt=0, x_x=0;
var tmbs = {}, imgs = {}; tmbs.abst_x = 2;
function tmbImg(rhm_b, img, img_b, img_h, txt, title){ 
	this.id = "img_"+imgCnt;
	this.b = rhm_b-2;
	this.x = x_x; x_x += tmbs.abst_x + rhm_b;
	this.imgUrl = imgsPath + (typeof img == "string" ? img : imgCnt+".jpg");
	this.imgPrefs = { imgUrl: this.imgUrl, b: img_b, h: img_h, id: this.id, txt: txt ? txt : "", title: title ? title : "" };
	imgs[this.id] = this;
	imgCnt++;
}
var imgsArr = [
	new tmbImg(91, 	0, 386, 480),
	new tmbImg(139,	0, 500, 333),
	new tmbImg(100,	0, 500, 333),
	new tmbImg(117,	0, 500, 333),
	new tmbImg(95,	0, 458, 333)
];
function ret_rhms(){
	var html = '';
	for(var x=0; x<imgsArr.length; x++){
		var on_rhm = ' onMouseOut="on_btn(this.id,0)" onMouseOver="on_btn(this.id,1)" onClick="on_btn(this.id,2)" title="Vergr&ouml;&szlig;erung zeigen ..."';
		html += '<div id="img_'+x+'" class="rhm"'+on_rhm+' style="z-index: '+(100+x)+'; top: 0; left: '+imgsArr[x].x+'px; width: '+imgsArr[x].b+'px;"><\/div>';
	}
	return html;
}
function on_btn(btnID, state){
	var btn = document.getElementById(btnID);
	btn.className = "rhm rhm_"+state;
	if(state==2){ imgView(imgs[btnID].imgPrefs); setTimeout("on_btn('"+btnID+"',1)", 250); }
}
function imgView(imgPrefs){
	if(this!=parent){
		parent.viewIMG(imgPrefs.imgUrl, imgPrefs.b, imgPrefs.h, 1, imgPrefs.txt, imgPrefs.title, 0, imgPrefs.id)
	} else {
		alert("b: "+imgPrefs.b+" | h: "+imgPrefs.h+" | url: "+imgPrefs.imgUrl+"  [imgView via parent frame ... not via top-frame]")
	}
}
