// copyright : Bernd Reinhard Rickert 
// This script is copyright protected for commercial use. All rights reserved.
// If you want to use, copy or change content of the script or parts of the content
// for commercial purpose, contact the author at www.fincy.com

// Feel allowed to use or change the script for non-commercial use
 
var img_ar=Array();
var i=0;var tmp_obj=new Object();
var containerHeight=0;
var scrollini=true;
var cache=Math.random();
var error=Array(false,false,false,false);
var open_dir=new String();
var stop_marquee=true;
var cp=0;
var free_call=true;
var ss=0;

if(!window.innerHeight){
	var zoomfaktor=(screen.deviceXDPI/screen.logicalXDPI);
setTimeout(checkzoom,1000);}
else{
	var zoomfaktor=1;
}
	
function checkzoom(){
if(zoomfaktor!=(screen.deviceXDPI/screen.logicalXDPI)){
zoomfaktor=(screen.deviceXDPI/screen.logicalXDPI);
if(document.getElementById("popimg")){
	document.getElementById("popdiv").style.width=(zoomfaktor*100)+"%";
//var elLeft=-(parseInt(((document.body.clientWidth/2))*zoomfaktor)-310);
//document.getElementById("popimg").style.width=(620*zoomfaktor)+"px";
//document.getElementById("text_info").style.fontSize=(100*zoomfaktor)+"%";
}


}setTimeout(checkzoom,1000);	


}

if(window.innerHeight){windowonResize = function(){
if(document.getElementById("popimg")){
	document.getElementById("popdiv").style.width=(parseInt(window.innerWidth))+"px";

document.getElementById("popimg").style.left=(parseInt(window.innerWidth/2)-310)+"px";

}
}}


function show_line(s,lan){
var str=new String();
var obj=document.getElementById("linkline1");	
if(s==0){
if(obj.lastChild)obj.innerHTML="&nbsp;";
	
}else if(s==1){
if(!document.getElementById("linkfotografen")){
if(obj.lastChild)obj.removeChild(obj.lastChild);
obj=set_line(obj,"linkfotografen");

var abc=Array

('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9','0');
str="<a href='../../fotographen.php?m=rec&lan="+lan+"'>recent</a>";
str+="<a href='../../fotographen.php?m=pop&lan="+lan+"'>popular</a>";
for(M=0;M<36;M++){	
str+="<a href='../../fotographen.php?m="+abc[M]+"&lan="+lan+"'>"+abc[M]+"</a>";
}
obj.innerHTML=str;
}}else if(s==2){
	
	
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if(lan=='de'){
var abc=Array('beliebteste','neueste','best bewertete','liebliche','spassige','grossartige','böse','verrückte','weiss nicht');
}else{
var abc=Array('popular','recent','best voted','love','fun','great','angry','weird','donno');
}
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
	
	
if(!document.getElementById("linkfotos")){
if(obj.lastChild)obj.removeChild(obj.lastChild);
obj=set_line(obj,"linkfotos");
obj.style.marginRight="5em";

for(M=0;M<8;M++){	
obj.appendChild(document.createElement("A"));
obj.lastChild.setAttribute("href","../../fotos.php?m="+M+"&lan="+lan);
obj.lastChild.appendChild(document.createTextNode(abc[M]));
}
}}else if(s==3){
	
	// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if(lan=='de'){
var abc=Array

('älteste','neueste','Mitglieder','Fotos','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
	
}else{
var abc=Array

('eldest','newest','members','photos','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
}
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

if(!document.getElementById("linkgruppen")){
if(obj.lastChild)obj.removeChild(obj.lastChild);
obj=set_line(obj,"linkgruppen");
for(M=0;M<30;M++){	
str+="<a href='../../gruppen.php?m="+M+"&lan="+lan+"'>";
if(M==2 || M==3)str+='>> ';
str+=abc[M]+"</a>";
}
obj.innerHTML=str;
}}else if(s==4){
	
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if(lan=='de'){
var abc=Array('beliebteste','Tassen','Shirts','Prints','Grusskarten','Downlaods','Happy Cap','Shopping Card');
		
}else{
var abc=Array('popular','Cups','Shirts','Prints','Greeting Cards','Downloads','Happy Cap','Shopping Card');
}
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

	
if(!document.getElementById("linkshop")){
if(obj.lastChild)obj.removeChild(obj.lastChild);
obj=set_line(obj,"linkshop");
for(M=0;M<7;M++){	
str+="<a href='../../shop.php?m="+abc[M]+"&lan="+lan+"'>"+abc[M]+"</a>";
}
obj.innerHTML=str;
}}else if(s==5){
	
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if(lan=='de'){
var abc=Array

('Kunst','Tiere','Gebäude','Wissenschaft','Essen','Natur','Sport','Luftfahrt','Fahrzeuge','Arbeit','Welt','Leute');
}else{
var abc=Array

('Arts','Animals','Buildings','Science','Food','Nature','Sports','Space','Vehicles','Work','World','People');
}
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
	
if(!document.getElementById("linkkats")){
if(obj.lastChild)obj.removeChild(obj.lastChild);
obj=set_line(obj,"linkkats");
obj.style.marginRight="1em";
for(M=0;M<12;M++){
str+="<a href='../../kats.php?m="+M+"&lan="+lan+"'>"+abc[M]+"</a>";
}
obj.innerHTML=str;
}}else if(s==6){

// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if(lan=='de'){
var abc=Array('Memory','Mitglied werden','Blogs');
	
}else{
var abc=Array('Memory','Become a Member','Blogs');
}
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
	
	
if(!document.getElementById("linkstart")){
if(obj.lastChild)obj.removeChild(obj.lastChild);
obj=set_line(obj,"linkstart");
obj.style.marginRight="26em";
str="<a href='../../memory.php?lan="+lan+"'>"+abc[0]+"</a><a href='../../new_account.php?lan="+lan+"'>"+abc[1]

+"</a><a href='../../foto_blog?lan="+lan+"&g=0'>"+abc[2]+"</a>";
obj.innerHTML=str;
}}
}

function set_line(obj,id){
obj.appendChild(document.createElement("SPAN"));
obj.lastChild.setAttribute("id",id);
obj.lastChild.onmouseover=function(){ss=1;}
obj.lastChild.onmouseout=function(){ss=2;remove_linkline(this);};
return obj.lastChild;
}

function remove_linkline(obj){
if(ss==3){
	if(obj.parentNode){var el=obj.parentNode;
	el.removeChild(obj);
	el.innerHTML="&nbsp;";
	}
}else if(ss==2){
ss=3;
setTimeout(function(){remove_linkline(obj);},4000);	
}
}


function reset_error(obj,v){
	if(error[v]){obj.style.backgroundColor="white";error[v]=false;}
}

function change_log(obj,lg,str){
if(lg==1){
obj.title='logout';
obj.href=str+'&log=2';	
}else{
obj.title='login';
obj.href=str+'&log=2';	
	
}}

function change_butt(obj){
obj.className="butthover";	

}
function change_butthover(obj){
obj.className="butt";	
}

function show_pass_req(text,text1,lan){
if(!document.getElementById('divpass')){
obj=document.getElementById('tdpass');
el=document.createElement("DIV");
el.setAttribute('id','divpass');
el.style.paddingTop="1em";
obj.appendChild(el);
el=document.createElement("SPAN");
el.setAttribute('id','spanpass');
obj.lastChild.appendChild(el);
el=document.createTextNode(text);
obj.lastChild.lastChild.appendChild(el);
el=document.createElement("INPUT");
el.setAttribute("type","button");
el.setAttribute("value",text1);
el.className="butt";
el.style.marginLeft="5em";
el.onclick=function(){send_pass(lan);};
el.onmouseover=function(){change_butt(this);};
el.onmouseout=function(){change_butthover(this);};
el.setAttribute("size","3");
obj.lastChild.appendChild(el);
var el=document.createElement("BR");
obj.lastChild.appendChild(el);
el=document.createElement("INPUT");
el.setAttribute("type","text");
el.setAttribute('id','inputpass');
el.setAttribute("size","40");
obj.lastChild.appendChild(el);
}}

function send_pass(lan){
var obj=document.getElementById('inputpass');
if(obj.value.indexOf('@')!=-1 && obj.value.indexOf('.')!=-1 && obj.value.length>8){
call("../../functions/send_pass.php?lan="+lan+"&email="+obj.value);
}else{
document.getElementById('divpass').style.color="red";
}}

function zeig_logform(lan,sid,user_id){
	
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if(lan=='de'){
var abc=Array('Name','Passwort','Mit der Emailadresse anfordern:','Passwort vergessen ?','abschicken');
	
}else{
var abc=Array('Name','Password','request by email:','forgotten your password ?','send');
}
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
	
	
document.getElementById("subhaeder").innerHTML='login';
tmp_obj=document.getElementById("sc");
if(tmp_obj.lastChild)tmp_obj.removeChild(tmp_obj.lastChild);

tmp_obj.appendChild(document.createElement("FORM"));
tmp_obj.lastChild.onsubmit=function(){return check_pass(lan,sid,user_id);};

tmp_obj.lastChild.appendChild(document.createElement("TABLE"));
tmp_obj.lastChild.lastChild.appendChild(document.createElement("TBODY"));

var obj=tmp_obj.lastChild.lastChild.lastChild;

obj.appendChild(document.createElement("TR"));

obj.lastChild.appendChild(document.createElement("TD"));
var el=document.createElement("SPAN");
el.appendChild(document.createTextNode(abc[0]));
obj.lastChild.lastChild.appendChild(el);

obj.lastChild.appendChild(document.createElement("TD"));

var el=document.createElement("SPAN");
el.appendChild(document.createTextNode(abc[1]));
obj.lastChild.lastChild.appendChild(el);

obj.appendChild(document.createElement("TR"));
obj.lastChild.appendChild(document.createElement("TD"));
el=document.createElement("INPUT");
el.setAttribute("type","text");
el.setAttribute("size","20");
el.setAttribute("maxLength","20");

el.setAttribute("id","member");
obj.lastChild.lastChild.appendChild(el);

obj.lastChild.appendChild(document.createElement("TD"));
el=document.createElement("INPUT");
el.setAttribute("type","password");
el.setAttribute("size","20");
el.setAttribute("maxLength","20");
el.setAttribute("id","memberpass");
obj.lastChild.lastChild.appendChild(el);

obj.appendChild(document.createElement("TR"));
obj.lastChild.appendChild(document.createElement("TD"));
obj.lastChild.lastChild.style.borderBottom="solid 1px gray";
obj.lastChild.lastChild.style.paddingBottom="1em";
obj.lastChild.lastChild.setAttribute("colSpan","2");

el=document.createElement("INPUT");
el.setAttribute("type","submit");
el.className="butt";
el.style.width="100%";
el.value="login";
el.onmouseover=function(){change_butt(this);};
el.onmouseout=function(){change_butthover(this);};
obj.lastChild.lastChild.appendChild(el);

obj.appendChild(document.createElement("TR"));
obj.lastChild.appendChild(document.createElement("TD"));
obj.lastChild.lastChild.style.borderTop="solid 1px gray";
obj.lastChild.lastChild.style.paddingTop="1em";
obj.lastChild.lastChild.setAttribute("colSpan","2");
obj.lastChild.lastChild.setAttribute("id","tdpass");


el=document.createElement("A");
el.className="pass";
el.setAttribute("href","javascript:show_pass_req('"+abc[2]+"','"+abc[4]+"','"+lan+"')");
el.appendChild(document.createTextNode(abc[3]));
obj.lastChild.lastChild.appendChild(el);

check_scrollbuttons();
}

function check_pass(lan,sid,user_id){
var str=new String();var str1=new String();

var obj=document.getElementById("member");
var send=true;
if(obj.value.length<3){	
obj.style.backgroundColor="red";
send=false;
}else{
str1=obj.value;	
for(t=0;t<str1.length;t++){
if(str1.charCodeAt(t)<48 
|| (str1.charCodeAt(t)>57 && str1.charCodeAt(t)<65) 
|| (str1.charCodeAt(t)>90 && str1.charCodeAt(t)<97)){
	send=false;	obj.style.backgroundColor="red";break;
}}
}
obj=document.getElementById("memberpass");

if(obj.value.length<3){
obj.style.backgroundColor="red";
send=false;
}else{
str=obj.value;	
for(t=0;t<str.length;t++){
if(str.charCodeAt(t)<48 
|| (str.charCodeAt(t)>57 && str.charCodeAt(t)<65) 
|| (str.charCodeAt(t)>90 && str.charCodeAt(t)<97)){
	send=false;	obj.style.backgroundColor="red";break;
}}}
if(send)call('../../scripts/login.php?sid='+sid+'&lan='+lan+'&id='+user_id+'&pw='+str+'&mn='+str1);
return false;
}



function set_freund_query(user_name,user_id,sid,akt_id,lan){
if(freund!=4 && freund!=5)call('../../scripts/set_freund.php?user_name='+user_name+'&user_id='+user_id+'&sid='+sid+'&akt_id='+akt_id+'&freund='+freund+'&lan='+lan,1);
}

function set_fit_query(query){
query+='&v='+fit;
call(query,1);
}

// funktion zur Kontrolle der emailadresse beim Emailversand
//===========================================================
function check_inputs(obj1,lan,sid,user_id){
	var send=true;
	var query=new String('../../scripts/save_email.php?sid='+sid+'&lan='+lan+'&id='+user_id);
	var obj=document.getElementById("vorname");
	
	if (obj.value == "") {
	error[0]=true;
	obj.style.backgroundColor="red";
	obj.select();
	obj.focus();
	send=false;
	}else{
	query+='&vn='+replace_str(obj.value);
	}
	
	var obj=document.getElementById("name");
	if (obj.value == "") {
	error[1]=true;
	obj.style.backgroundColor="red";
	obj.select();
	obj.focus();
	send=false;
	}else{
	query+='&n='+replace_str(obj.value);
	}
	
	var obj=document.getElementById("message");
	if (obj.value == "") {
	error[2]=true;
	obj.style.backgroundColor="red";
	obj.select();
	obj.focus();
	send=false;
	}else{
	query+='&m='+replace_str(obj.value);
	}
	
	var obj=document.getElementById("email");
	if (obj.value == ""){
	error[3]=true;
	obj.style.backgroundColor="red";
	obj.select();
	obj.focus();
	send=false;
	}	
	else if (obj.value.indexOf ('@',0) == -1 ||
	obj.value.indexOf ('.',0) == -1) {
	error[3]=true;
	obj.style.backgroundColor="red";
	obj.select();
	obj.focus();
	send=false;
	}else{
	query+='&e='+replace_str(obj.value);
	}

if(send){
marquee_stop=true;
tmp_obj=document.getElementById("sc");

if(tmp_obj.lastChild)tmp_obj.removeChild(tmp_obj.lastChild);
	
call(query);}
}
//===========================================================



function show_texte(ini_name,lan,sid,user_id,username,fits,akt_id){
var send=true;

if(ini_name==0 && document.getElementById("spancritics")){send=false;}
else if((ini_name==1 || ini_name==2 || ini_name==3) && document.getElementById("spancritics")){
var obj= document.getElementById("spancritics");
obj.parentNode.removeChild(obj);	
}
stop_marquee=true;
tmp_obj=document.getElementById("sc");

if(send){
if(tmp_obj.lastChild)tmp_obj.removeChild(tmp_obj.lastChild);


if(ini_name==2)
call('../../scripts/public_ausstellungen.php?lan='+lan+'&ini_name='+ini_name+'&sid='+sid+'&user_id='+user_id+'&user_name='+username);	
else if(ini_name==3)
call('../../scripts/zeig_stats.php?lan='+lan+'&ini_name='+ini_name+'&sid='+sid+'&user_id='+user_id+'&user_name='+username+'&fits='+fits+'&freund='+freund+'&akt_id='+akt_id);
else
call('../../scripts/show_critics.php?lan='+lan+'&ini_name='+ini_name+'&sid='+sid+'&user_id='+user_id+'&user_name='+username);	
}}

function show_email(vorname, nachname, email,subject,sid,user_id,lan){
var obj=new Object();
var el=new Object();

obj=document.getElementById("sc");		

if(obj.lastChild){

	if(obj.lastChild.id=='form'){return;}
	
	else {obj.removeChild(obj.lastChild);}
	
}



if(document.getElementById("spancritics")){
var obj1= document.getElementById("spancritics");
obj1.parentNode.removeChild(obj1);
}

document.getElementById("subhaeder").innerHTML=email;
obj.appendChild(document.createElement("FORM"));
obj.lastChild.setAttribute("id",'form');

obj.lastChild.style.padding="0";
obj.lastChild.style.margin="0";
obj.lastChild.onsubmit=function(){check_inputs(this,lan,sid,user_id);return false};
obj.lastChild.appendChild(document.createElement("TABLE"));
obj.lastChild.lastChild.appendChild(document.createElement("TBODY"));
obj=obj.lastChild.lastChild.lastChild;

obj.appendChild(document.createElement("TR"));
obj.lastChild.appendChild(document.createElement("TD"));
create_input(el,obj,vorname,'vorname','text',10,50,'',-1,0,0,1);
obj.lastChild.lastChild.lastChild.onkeyup=function(){reset_error(this,0);};
obj.lastChild.lastChild.lastChild.setAttribute("id","vorname");

obj.lastChild.appendChild(document.createElement("TD"));
create_input(el,obj,nachname,'name','text',10,50,'',-1,0,0,1);
obj.lastChild.lastChild.lastChild.setAttribute("id","name");
obj.lastChild.lastChild.lastChild.onkeyup=function(){reset_error(this,1);};


obj.appendChild(document.createElement("TR"));
obj.lastChild.appendChild(document.createElement("TD"));
obj.lastChild.lastChild.setAttribute("colSpan",2);

create_input(el,obj,email+' :','email','text',15,100,'',-1,0,0,1);
obj.lastChild.lastChild.lastChild.setAttribute("id","email");
obj.lastChild.lastChild.lastChild.onkeyup=function(){reset_error(this,3);};

create_input(el,obj,'','','submit',7,10,'',-1,1,0,0);
obj.lastChild.lastChild.lastChild.setAttribute("value",'abschicken');
obj.lastChild.lastChild.lastChild.className="butt";

obj.appendChild(document.createElement("TR"));
obj.lastChild.appendChild(document.createElement("TD"));
obj.lastChild.lastChild.setAttribute("colSpan",2);
obj.lastChild.lastChild.appendChild(document.createTextNode(subject));
obj.lastChild.lastChild.appendChild(document.createElement("BR"));

obj.lastChild.lastChild.appendChild(document.createElement("TEXTAREA"));
obj.lastChild.lastChild.lastChild.setAttribute("cols",38);
obj.lastChild.lastChild.lastChild.setAttribute("rows",3);
obj.lastChild.lastChild.lastChild.setAttribute("name",'message');
obj.lastChild.lastChild.lastChild.setAttribute("id","message");

obj.lastChild.lastChild.lastChild.onkeyup=function(){reset_error(this,2);};
check_scrollbuttons();
}

//===========================================================
// die Hauptfuntkion zum Setzen der Lightbox
//===========================================================
function popwindow(p,lan,set,sizeX,sizeY,filename,folder,user_id,sid,user_name){
if(open_dir!=folder && folder){reset_marquee(folder,lan,1,p,user_id,sid,user_name);}
else{
window.scrollTo(0,0);

i=p;
var obj=document.body;
var el=new Object();

// Die Lightbox ist bereits geschrieben
if(document.getElementById("popdiv")){
	set_img(2,set,lan,user_id,sid);
}else{
// Die Lightbox wird jetzt geschrieben
var el1=document.createElement("DIV");
el1.className="layer";

el1.style.paddingBottom=(document.body.offsetHeight+30)+"px";
el1.setAttribute("id","popdiv");
el1.style.width=(100*screen.deviceXDPI/screen.logicalXDPI)+"%";
el1.onclick=function(){removeDiv(this.parentNode);};
obj.appendChild(el1);



el1=document.createElement("DIV");
el1.setAttribute("id","popimg");
el1.className="zoom";

if(set==1){
el=document.createElement("DIV");
el.setAttribute("id","text_info");
el.className="infobox";
el.style.zoom=(100*screen.deviceXDPI/screen.logicalXDPI)+"%";

el1.appendChild(el);

el=document.createElement("DIV");
el.style.width=zoomfaktor*100+"%";
el1.lastChild.appendChild(el);
write_textinfo(el,i,lan);
}

el=document.createElement("DIV");
el.style.textAlign="center";
el.style.paddingBottom=zoomfaktor+"em";

el1.appendChild(el);
el=document.createElement("IMG");

if(set<3){
	el.src=img_ar[i][0];
	el.style.width=(zoomfaktor*img_ar[i][1])+"px";
	el.style.height=(zoomfaktor*img_ar[i][2])+"px";
	
//_________________________________________

}else{ 
	el.src='personal_settings/'+filename;
	if(sizeY=='')sizeY=300;
	el.style.height=sizeY+"px";
	el.style.width="180px";}
//_________________________________________

el.setAttribute("id","img_preview");
if(set!=2)el.className="zoom";

if (window.innerHeight){
	//firefox trash_can:
	myHeight=window.innerHeight;
	myWidth=window.innerWidth;
	el1.style.left=(parseInt(myWidth/2)-330)+"px";
	el1.style.marginTop=30+"px";
}else{
	el1.style.marginLeft=(-330*zoomfaktor)+"px";
	el1.style.marginTop=(zoomfaktor*60)+"px";
}
el1.lastChild.appendChild(el);

el=document.createElement("DIV");
el.style.paddingBottom="0.5em";
el1.appendChild(el);


// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if(lan=='de'){
var abc=Array('in die Ablage kopieren \r\n Internet Explorer','auf die Shopping Card','noch nicht bewertet','na ja','okay','Super','Mega','Top',' von 10','Liebe','Spass','Super','Böse','Verrückt','weiss nicht','Favorit');
	
}else{
var abc=Array('copy to clipboard \r\n(internet explorer)','onto the Shopping Card','not quoted yet','better than nothing','okay','super','super geil','Top',' of 10','Love','Fun','Great','Agressiv','Crazy','donno','Favorite');
}
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999


// clipboard function
el=document.createElement("IMG");
el.style.marginRight="0.5em";
el.setAttribute("title",abc[0]);
el.setAttribute("src","../../bilder/copy.gif");
el.onclick=function(){clipboardData.setData("Text",this.parentNode.childNodes[1].value,true);};
el1.lastChild.appendChild(el);

el=document.createElement("INPUT");
el.setAttribute("id","url_link");
el.style.width="60%";
el.setAttribute("value",'http://www.fincy.com/foto/ben/'+user_name+'/'+img_ar[i][0]);

el.onmouseover=function(){sel(this);};
el1.lastChild.appendChild(el);


// Warenkorb
el=document.createElement("IMG");
el.style.marginLeft="5em";
el.setAttribute("title",abc[1]);
el.setAttribute("id","shoppingcard");

el.setAttribute("src","../../bilder/ware/fill_me.png");
el.onclick=function(){call('../../scripts/fill_basket.php?user_id='+user_id+'&sid='+sid+'&call=m&img='+img_ar[i][11]);};
el1.lastChild.appendChild(el);

// member bereich
//==========================================
if(set>1){
	
	el=document.createElement("DIV");
	el.setAttribute("id","text_info");
	el.className="infobox";
	el.style.width="100%";
	el1.appendChild(el);
	el=document.createElement("DIV");
	
	if(set==2){
		el.style.width="100%";
		el1.lastChild.appendChild(el);
	set_bild(sid,el,i,0,lan);
	}else if(set==3){
		el.style.paddingTop="30%";
		el1.lastChild.appendChild(el);
	set_titelbild(el,lan);
//=============================================
}

}else if(set==1){
	
//Bewertung Beschreibung + Posts	
set_stars_line(el1,p,sid,user_id,lan,abc);
create_bilder_prev(el1,lan,user_id,sid);

	el1.appendChild(document.createElement("DIV"));
	el1.lastChild.setAttribute("id","bildbeschreibung");
tmp_obj=el1.lastChild;

call('../../scripts/set_posts.php?img_index='+img_ar[p][11]+'&lan='+lan+'&call=m&user_id='+user_id+'&sid='+sid+'&user_name='+user_name+'&ordner='+folder+'&path='+img_ar[i][0]);

}

// navigation
if(set<3){
el=document.createElement("DIV");
el.className="corner";
el1.appendChild(el);
el=document.createElement("IMG");
el.src="../../bilder/arr_white_back.jpg";
el.onmouseover=function(){change_icon(this,2);};
el.onmouseout=function(){change_icon(this,3);};
el.onclick=function(){set_img(0,set,lan,user_id,sid);}
el1.lastChild.appendChild(el);
el=document.createElement("IMG");
el.src="../../bilder/x_white.gif";
el.onclick=function(){removeDiv(this.parentNode.parentNode.parentNode);};
el1.lastChild.appendChild(el);
el=document.createElement("IMG");
el.src="../../bilder/arr_white.gif";
el.onmouseover=function(){change_icon(this,0);};
el.onmouseout=function(){change_icon(this,1);};
el.onclick=function(){set_img(1,set,lan,user_id,sid);}
el1.lastChild.appendChild(el);
}
obj.appendChild(el1);
}}}
//===========================================================

function sel(obj){obj.focus();obj.select();}
//===========================================================
// emotionbar in der lightbox
//===========================================================

//===========================================================
// Hauptfunktion zum Schreiben der Emotionbar 
//===========================================================
function set_stars_line(obj,ar_index,sid,user_id,lan,abc){
	var eval_stimmen;
	if(img_ar[ar_index][12][8]>0)eval_stimmen=parseInt(img_ar[ar_index][12][0]/img_ar[ar_index][12][8]*10)/10;
	else eval_stimmen='noch nicht bewertet';
	
	var el=document.createElement('DIV');
	el.className='bar';
		el.style.height="50px";
	
	var el1=document.createElement('DIV');
	el1.setAttribute('id','evalbar');
	el1.className="fright";
	
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if(lan=='de'){
var abc=Array('in die Ablage kopieren \r\n Internet Explorer','auf die Shopping Card','noch nicht bewertet','na ja','okay','Super','Mega','Top',' von 10','Liebe','Spass','Super','Böse','Verrückt','weiss nicht','Favorit');
	
}else{
var abc=Array('copy to clipboard \r\n(internet explorer)','onto the Shopping Card','not quoted yet','better than nothing','okay','super','super geil','Top',' of 10','Love','Fun','Great','Agressiv','Crazy','donno','Favorite');
}
// SPRACHE
//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
	
	
if(eval_stimmen>0){eval_img='../../bilder/star.gif';
}else eval_img='../../bilder/star_out.gif';			
el1.appendChild(create_stars_bar(lan,abc[3],eval_img,1,2,5,ar_index,0,sid,user_id));

if(eval_stimmen>2)eval_img='../../bilder/star.gif';
else eval_img='../../bilder/star_out.gif';
el1.appendChild(create_stars_bar(lan,abc[4],eval_img,1,4,5,ar_index,0,sid,user_id));

if(eval_stimmen>4)eval_img='../../bilder/star.gif';
else eval_img='../../bilder/star_out.gif';
el1.appendChild(create_stars_bar(lan,abc[5],eval_img,1,6,5,ar_index,0,sid,user_id));

if(eval_stimmen>6)eval_img='../../bilder/star.gif';
else eval_img='../../bilder/star_out.gif';	
el1.appendChild(create_stars_bar(lan,abc[6],eval_img,1,8,5,ar_index,0,sid,user_id));

if(eval_stimmen>8)eval_img='../../bilder/star.gif';
else eval_img='../../bilder/star_out.gif';	

el1.appendChild(create_stars_bar(lan,abc[7],eval_img,1,10,5,ar_index,0,sid,user_id));	

		// wegen dem Float in ff muss ein zeilenumbruch geschrieben werden
		if(navigator.userAgent.indexOf('MSIE')==-1){el1.appendChild(document.createElement('BR'));}
		
		el1.appendChild(document.createElement('DIV'));
		el1.lastChild.style.textAlign='center';

		el1.lastChild.appendChild(document.createElement('SPAN'));
		el1.lastChild.lastChild.setAttribute('id','eval_value');
		el1.lastChild.lastChild.appendChild(document.createTextNode(eval_stimmen));

		el1.lastChild.appendChild(document.createElement('SPAN'));
		el1.lastChild.lastChild.setAttribute('id','eval_text');
		
		if(eval_stimmen>0)
		el1.lastChild.lastChild.appendChild(document.createTextNode(abc[8]));
		
		el.appendChild(el1);

	el1=document.createElement('DIV');
	el1.setAttribute('id','emotionbar');
		el1.appendChild(create_stars_bar(lan,abc[9],'../../bilder/s_love.gif',2,1,10,ar_index,img_ar[ar_index][12][1],sid,user_id));		
		el1.appendChild(create_stars_bar(lan,abc[10],'../../bilder/s_fun.gif',2,2,10,ar_index,img_ar[ar_index][12][2],sid,user_id));		
		el1.appendChild(create_stars_bar(lan,abc[11],'../../bilder/s_wow.gif',2,3,10,ar_index,img_ar[ar_index][12][3],sid,user_id));		
		el1.appendChild(create_stars_bar(lan,abc[12],'../../bilder/s_boese.gif',2,4,5,ar_index,img_ar[ar_index][12][4],sid,user_id));		
		el1.appendChild(create_stars_bar(lan,abc[13],'../../bilder/s_weird.gif',2,5,10,ar_index, img_ar[ar_index][12][5],sid,user_id));
		el1.appendChild(create_stars_bar(lan,abc[14],'../../bilder/s_dontknow.gif',2,6,10,ar_index,img_ar[ar_index][12][6],sid,user_id));
		el1.appendChild(create_stars_bar(lan,abc[15],'../../bilder/fav'+img_ar[ar_index][12][9]+'.gif',3,img_ar[ar_index][12][9],10,ar_index,0,sid,user_id));		

	
el.appendChild(el1);					
obj.appendChild(el);
}

//===========================================================
// funktion zum Schreiben der Eval- und Emotionbar in der Lightbox 
//===========================================================
function create_stars_bar(lan,text,img,set,v,margin,ar_index,n,sid,user_id){
	var el2=document.createElement('DIV');
	el2.className='fleft';	
	
	el2.appendChild(document.createElement('A'));
	el2.lastChild.setAttribute('href','javascript:store_eval(\''+v+'\',\''+set+'\',\''+n+'\',\''+sid+'\',\''+user_id+'\',\''+lan+'\')');
	el2.lastChild.style.margin='0 '+margin+'px 0 '+margin+'px';
	el2.lastChild.appendChild(document.createElement('IMG'));
	if(set==3)el2.lastChild.lastChild.setAttribute('id','favorite');
	
 	el2.lastChild.lastChild.style.border='none';
	el2.lastChild.lastChild.src=img;
	el2.lastChild.lastChild.setAttribute("title",text);
	el2.lastChild.lastChild.setAttribute("alt",text);
	
	if(set==2){
	el2.appendChild(document.createElement('BR'));
	el2.appendChild(document.createElement('SPAN'));
	el2.lastChild.appendChild(document.createTextNode(n));
	}
	return el2;
}

// funktion zum Speichern von emotion und Eval und Favorite
//===========================================================
function store_eval(v,set,emotion,sid,user_id,lan){
if(set==3)v=img_ar[i][12][9];
call('../../scripts/emotions.php?val='+v+'&n='+emotion+'&ar_index='+i+'&set='+set+'&img_index='+img_ar[i][11]+'&stimmen='+img_ar[i][12][8]+'&eval='+img_ar[i][12][0]+'&sid='+sid+'&user_id='+user_id+'&lan='+lan);
}
//===========================================================


//===========================================================
// emotionbar ende
//===========================================================



// schreibt die kleinen anklickbaren Previewbilder in der lightbox
//===========================================================================================
function create_bilder_prev(el,lan,user_id,sid){
var obj=document.createElement("DIV");
var x=0;
obj.style.margin="0.5em";

for(ii=0;ii<img_ar.length;ii++){
obj.appendChild(document.createElement("A"));
obj.lastChild.setAttribute('href','javascript:set_img(2,1,\''+lan+'\',\''+user_id+'\',\''+sid+'\','+ii+',1)');
obj.lastChild.appendChild(document.createElement("IMG"));
obj.lastChild.lastChild.style.border="none"

x=img_ar[ii][1]/50;
obj.lastChild.lastChild.style.width=parseInt(zoomfaktor*(img_ar[ii][1]/x))+"px";
obj.lastChild.lastChild.style.height=parseInt(zoomfaktor*(img_ar[ii][2]/x))+"px";
obj.lastChild.lastChild.style.margin=(zoomfaktor*0.5)+"em";
obj.lastChild.lastChild.style.verticalAlign="middle";
obj.lastChild.lastChild.src=img_ar[ii][0];
}el.appendChild(obj);
}
//====================================================================================================
//====================================================================================================

function replace_str(v){
var rExp = /&/gi;
var str=v.replace(rExp,'^^^');rExp = /"/gi;
str=str.replace(rExp,'``');return str;}

function format_data(val){

	var nr1=(Math.round(val*100)/100);

	var nr=Math.floor(nr1);
	var str=new String(nr.toString());
	nr1-=nr;
	if(nr1==0)str+='.00';
	else{nr1=Math.round(nr1*100);
		if(nr1>10){str+='.'+nr1.toString();}
		else{str+='.0'+nr1.toString();}
	}
	return str;
}

function remove_fotos(){
	if(document.getElementById("main_body")){
		var obj=document.getElementById("main_body");obj.parentNode.removeChild(obj);}
}

function write_span(el,el1,txt,padd){
el=document.createElement('SPAN');
el.style.paddingRight=padd+'em';
el1.appendChild(el);
el=document.createTextNode(txt);
el1.lastChild.appendChild(el);	
}

function write_textinfo(el1,i,lan){
			// SPRACHE
		//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999	

	
		if(lan=='de'){var	abc=Array('Orginalgrösse','von 10','noch nicht bewertet','Preis','Kategorie','Lizens')
		}else{var abc=Array('Original Size','of 10','not evaluated','Price','Category','License');}
		// SPRACHE
		//9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
var el=new Object();
write_span(el,el1,img_ar[i][3],2);
write_span(el,el1,img_ar[i][4],2);	
el=document.createElement("A");
el.setAttribute("href","../../scripts/show_orginal.php?img="+img_ar[i][0]);
el.setAttribute("target","orginal");
el1.appendChild(el);
write_span(el,el1.lastChild,abc[0]+": "+img_ar[i][5]+"px * "+img_ar[i][6]+"px",2);	

if(img_ar[i][13]!=-1 && img_ar[i][13]!=''){write_span(el,el1,img_ar[i][13]+":",0.2);}
if(img_ar[i][14]!=-1 && img_ar[i][14]!=''){write_span(el,el1,img_ar[i][14],2);}
if(img_ar[i][10]!=0){write_span(el,el1,abc[5]+":"+img_ar[i][10],2);}
if(img_ar[i][7]>-1 && img_ar[i][8]>1){
	var cur='';
	if(img_ar[i][7]==0)cur='€';
	else if(img_ar[i][7]==1)cur='£';
	else if(img_ar[i][7]==2)cur='$';

	write_span(el,el1,abc[3]+": "+format_data(img_ar[i][8])+" "+cur,2);}
if(img_ar[i][15]!=-1){
el1.appendChild(document.createElement("DIV"));
el1.lastChild.innerHTML=abc[4]+": "+img_ar[i][15];	
	}


if(document.getElementById('emotionbar')){el=document.getElementById('emotionbar');
el.childNodes[0].lastChild.innerHTML=img_ar[i][12][1];
el.childNodes[1].lastChild.innerHTML=img_ar[i][12][2];
el.childNodes[2].lastChild.innerHTML=img_ar[i][12][3];
el.childNodes[3].lastChild.innerHTML=img_ar[i][12][4];
el.childNodes[4].lastChild.innerHTML=img_ar[i][12][5];
el.childNodes[5].lastChild.innerHTML=img_ar[i][12][6];

document.getElementById("favorite").src='../../bilder/fav'+img_ar[i][12][9]+'.gif';
el=document.getElementById('evalbar');
		if(img_ar[i][12][0]>0)eval_img='../../bilder/star.gif';
		else eval_img='../../bilder/star_out.gif';			
		el.childNodes[0].lastChild.lastChild.src=eval_img;

		if(img_ar[i][12][0]>2)eval_img='../../bilder/star.gif';
		else eval_img='../../bilder/star_out.gif';
		el.childNodes[1].lastChild.lastChild.src=eval_img;

		if(img_ar[i][12][0]>4)eval_img='../../bilder/star.gif';
		else eval_img='../../bilder/star_out.gif';
		el.childNodes[2].lastChild.lastChild.src=eval_img;
	
		if(img_ar[i][12][0]>6)eval_img='../../bilder/star.gif';
		else eval_img='../../bilder/star_out.gif';	
		el.childNodes[3].lastChild.lastChild.src=eval_img;

		
		if(img_ar[i][12][0]>8)eval_img='../../bilder/star.gif';
		else eval_img='../../bilder/star_out.gif';	
		el.childNodes[4].lastChild.lastChild.src=eval_img;
	if(img_ar[i][12][8]>0){	
	document.getElementById('eval_value').innerHTML=parseInt(img_ar[i][12][0]/img_ar[i][12][8]*10)/10+' ';
	document.getElementById('eval_text').innerHTML=abc[1];
	
	}else{
	document.getElementById('eval_value').innerHTML=abc[2];
	document.getElementById('eval_text').innerHTML='';
		
	}
}
}



// setzt ein neues bild in der lightbox bei klick auf navigation in der lightbox
//=============================================================
function set_img(v,set,lan,user_id,sid,imageindex,ref){
// set= switch useransicht-membereich
// v= nächstes oder voriges
window.scrollTo(0,0);
if(v==0){if(--i<0){if(!img_ar[(img_ar.length-1)][0]){i=img_ar.length-2;}else {i=img_ar.length-1;}}}
else if(v==1){if(++i==img_ar.length || !img_ar[i][0])i=0;}
else i=imageindex;

var str=document.getElementById("url_link").value.split('/');

document.getElementById("url_link").value='http://www.fincy.com/foto/ben/'+str[5]+'/'+img_ar[i][0];

var obj=document.getElementById("img_preview");
obj.style.height=img_ar[i][2]+"px";
obj.style.width=img_ar[i][1]+"px";
obj.src=img_ar[i][0];

obj=document.getElementById("text_info");
obj.removeChild(obj.lastChild);
var el=document.createElement("DIV");

if(set==1){
	obj.appendChild(el);
	// schreib die titelinfo und setzt emotionbar
	write_textinfo(el,i,lan);
	
	if(document.getElementById("bildbeschreibung")){
	tmp_obj=document.getElementById("bildbeschreibung");
	tmp_obj.innerHTML='';
	var query='../../scripts/set_posts.php?img_index='+img_ar[i][11]+'&lan='+lan+'&user_id='+user_id+'&sid='+sid+'&user_name='+str[5]+'&call=m&ordner=fotos/'+str[7]+'&path='+img_ar[i][0];
	if(ref)query+='&no_prev='+ref;
	call(query);
}
	
}else{
	el.style.width="100%";
obj.appendChild(el);
set_bild(sid,el,i,0,lan);	
}}
//=============================================================

//===========================================================
// funktion zum Schreiben von inputs 
//===========================================================
function create_input(el,obj,text,id,btype,breite,laenge,ar_index,i_in,marginleft,marginright,br){
if(text!=0){
el=document.createTextNode(text);
obj.lastChild.lastChild.appendChild(el);
}
if(br)obj.lastChild.lastChild.appendChild(document.createElement("BR"));

el=document.createElement('INPUT');
if(marginleft>0)el.style.marginLeft=marginleft+"em";
if(marginright>0)el.style.marginRight=marginright+"em";
el.setAttribute("name",id);
if(btype=='file')el.setAttribute("type","file");
else el.setAttribute("type",btype);


if(laenge>0)el.setAttribute("maxLength",laenge);
if(breite>0)el.style.width=breite+"em";

if(br)el.setAttribute("value",ar_index);
else if(i_in>-1 && img_ar[i_in])el.setAttribute("value",img_ar[i_in][ar_index]);

obj.lastChild.lastChild.appendChild(el);
}
//===========================================================



// hover bei Navigation in popwindow
//=============================================================
function change_icon(el,v){
if(v==0)	
el.src="../../bilder/arr_orange.gif";
else if(v==1)	
el.src="../../bilder/arr_white.gif";	
else if(v==2)	
el.src="../../bilder/arr_orange_back.jpg";	
else if(v==3)	
el.src="../../bilder/arr_white_back.jpg";	
}
//=============================================================

function removeDiv(obj,v){
	
if(obj.lastChild.id=='popimg' || obj.lastChild.id=='popdiv' || document.getElementById("popimg")){
obj=document.getElementById("popimg");
obj.parentNode.removeChild(obj);
obj=document.getElementById("popdiv");
obj.parentNode.removeChild(obj);

stop_marquee=false;ini_marquee();
}}

function reset_marquee(img_folder,lan,f,img_index,user_id,sid,user_name,alle,decoded_folder,div_id){
var set_ini=true;
if(f==2)remove_sticker();
if(alle!=1 && img_index>1)window.scrollTo(0,0);
if(f==2 && document.getElementById("main_body") && open_dir ==img_folder ){
remove_fotos();	
}
else if(open_dir !=img_folder || alle==1 || (f==2 && !document.getElementById("main_body"))){
stop_marquee=true;
open_dir=img_folder;
var query=new String("../../functions/set_marquee.php?user_name="+user_name+"&folder="+img_folder+"&f="+f+"&lan="+lan+"&c="+cache+"&user_id="+user_id+"&sid="+sid+'&alle='+alle);
var obj=new Object();

if(f==2){
akt_id=div_id;
	// member function
set_ini=clean_content(img_folder,decoded_folder,div_id,lan);
}

if(img_index>=0)query+="&img_index="+img_index;
else query+="&img_index=undefined";

if(set_ini){call(query);}
}}

function ini_marquee(){
var obj=document.getElementById("messure_length_1");
var marquee_length=obj.clientWidth;

if(marquee_length<700){obj.style.marginLeft='0em';}
else if(document.getElementById("messure_length_2")){

var obj1=document.getElementById("messure_length_2");
obj1.style.visibility='visible';
if(!obj.mLeft){
	obj.mLeft=300;
	obj1.mLeft=0;}
stop_marquee=false;
move_marquee(obj,obj1,(marquee_length*(-1)));	
}}

function move_marquee(obj,obj1,marquee_length){
if(stop_marquee==false){	
if(obj.mLeft>marquee_length){
obj.mLeft-=5;
obj.style.marginLeft=obj.mLeft+'px';
setTimeout(function(){move_marquee(obj,obj1,marquee_length);},70);
}else if(document.getElementById("marquee_space")){
obj.mLeft=Math.abs(marquee_length);
var obj2=new Object(obj);
var obj3=document.getElementById("marquee_space");
obj3.removeChild(obj);
obj3.appendChild(obj2);
obj1.mLeft=0;
setTimeout(function(){move_marquee(obj1,obj2,((-1)*marquee_length));},70);
}}}



function replace_quot(str){
var rExp = /``/gi;
str=str.replace(rExp,'"');
return str;	
}

function jump_to(v){
scrollini=true;	
var obj=document.getElementById("sc");

var tp=parseInt(obj.style.top.replace("px",''));
if(!tp)tp=0;

if(v==2){

	if(Math.abs(tp)<containerHeight){
		
		if(containerHeight-Math.abs(tp)>198)
		 tp-=198;
		else tp+=(Math.abs(tp)-containerHeight);
		obj.style.top=tp+"px";}

}else{ 

	if(tp<=0){if(Math.abs(tp)>=(containerHeight-198) && tp<-198)tp+=198; else tp-=tp;obj.style.top=tp+"px";}

}}


function scroll_to(tp,v,obj){
if(scrollini){
setTimeout(function(){scroll_to(tp,v,obj);},10);
if(v==2){
if(Math.abs(tp)<containerHeight){obj.style.top=tp+"px";
tp-=5;}
}else if(v==3){
if(tp<5){obj.style.top=tp+"px";
tp+=5;}
}}
}

function scroll_stop(){
	scrollini=false;
}

function hide(obj){obj.style.overflowY="hidden";}


function check_scrollbuttons(){
containerHeight=((document.getElementById("sc").offsetHeight)-218);

if(containerHeight>7){
document.getElementById("srcoll_img").style.visibility="visible";
}else document.getElementById("srcoll_img").style.visibility="hidden";
}

function set_scrollimg(){
check_scrollbuttons();	
ini_marquee();
}

function scroll_this(v){

scrollini=true;
var obj=document.getElementById("sc");

var tp=parseInt(obj.style.top.replace("px",''));

if(!tp)tp=0;
if(v==2){

	if(Math.abs(tp)<containerHeight){tp-=5;	scroll_to(tp,v,obj);}

}else{ 
	if(tp<0){tp-=5;scroll_to(tp,v,obj);}
}}


//=========================================================================================================
//=========================================================================================================



function call(query,v){

var call=document.getElementById("call");
if(call.lastChild)call.removeChild(call.lastChild);
if(free_call || v){
document.getElementById("sc").style.top="0px";
//free_call=false;
obj1 =document.createElement("SCRIPT");
obj1.setAttribute("src",query+"&c="+cache);
stop_marquee=true;
cache++;
call.appendChild(obj1);
}else{
stop_marquee=false;	
}}



function set_post(user_id,img_index,sid,lan,img_path){
var obj=document.getElementById("post_entry");

if(obj.value.length>19 && user_id>0){
		str=replace_str(obj.value)
		var str1=new String();
		
		for(t=0;t<str.length;t++){if(str.charCodeAt(t)==10){
			if(str.charCodeAt(t-1)==10){str1+=' ';
			}else{
			str1+='¤';}
			}else{str1+=str.charAt(t);}}

			call('../../scripts/insert_new_post.php?user_id='+user_id+'&sid='+sid+'&img_index='+img_index+'&v='+str1+'&cp='+cp+'&lan='+lan+'&path='+img_path);

}else if(obj.value.length<15){
// SPRACHE	
	if(lan=='de')var abc="Dein Post is echt zu kurz, \r\ndann topp mal besser ein Sticker !";
	else var abc="Your post is definatly too short, you better topp a sticker then.";
// SPRACHE	
	alert(abc);

}else if(!user_id){
// SPRACHE
		if(lan=='de')var abc="Dein login ist nicht mehr gültig. Bitte log dich nochmal ein";
		else var abc="Your login is not valid anymore, please login again";
// SPRACHE
	alert(abc);
}
}



function set_sticker(user_id,sid,lan){
var str=document.getElementById("tsticker").value;
if(!user_id){
// SPRACHE
		if(lan=='de')var abc="Dein login ist nicht mehr gültig. Bitte log dich nochmal ein";
		else var abc="Your login is not valid anymore, please login again";
// SPRACHE
	alert(abc);
	
	
}

else if(str.length<20){
// SPRACHE
		if(lan=='de')var abc="zu kurz";
		else var abc="too short";
// SPRACHE
	alert(abc);
}else{
	tmp_obj=document.getElementById("fincy_sticker_roll");
	stop_marquee=true;
	call('../../scripts/save_sticker.php?lan='+lan+'&user_id='+user_id+'&sid='+sid+'&sticker='+replace_str

(str));
}}

function roll_it(s){
var obj=document.getElementById("sticks");
var obj1=document.getElementById("fincy_sticker_roll");

if(s==0){
	obj.style.backgroundImage="url('../../bilder/roll_down_1.gif')";
	scrollini=false;stop_marquee=false;ini_marquee();

}else{
	
	if(!obj1.topvalue)obj1.topvalue=0;

	if(s==1){
	if((obj1.topvalue*(-1))<(obj1.clientHeight)){	
	obj.style.backgroundImage="url('../../bilder/roll_down.gif')";

	scrollini=true;
	scroll_sticker(obj1,obj,s);
	}

	}else if(s==2 && obj1.topvalue<0){
	scrollini=true;
	obj.style.backgroundImage="url('../../bilder/roll_down.gif')";
	scroll_sticker(obj1,obj,s);
	}
}}

function scroll_sticker(obj1,obj,s){
stop_marquee=true;

if(scrollini && (obj1.topvalue*(-1))<(obj1.clientHeight) && s==1){
	obj1.topvalue-=10;
	obj1.style.top=(obj1.topvalue)+'px';
	setTimeout(function(){scroll_sticker(obj1,obj,s);},100);
	
}else if(scrollini && s==2 && obj1.topvalue<0){
	obj1.topvalue+=10;
	obj1.style.top=(obj1.topvalue)+'px';

	setTimeout(function(){scroll_sticker(obj1,obj,s);},100);
	
}else{scrollini=false;obj.style.backgroundImage="url('../../bilder/roll_down_1.gif')";stop_marquee=false;ini_marquee();}

}

function call_personals(user_id,sid,set,text,publisher,login,lan){
	
if(document.getElementById("spancritics")){
var obj=document.getElementById("spancritics");
obj.parentNode.removeChild(obj);	
}
	
var query=new String('../../scripts/get_personals.php?user_id='+user_id+'&sid='+sid+'&publisher='+publisher+'&log='+login+'&lan='+lan);
stop_marquee=true;

if(set==1){
	query+='&set=1';
}else if(set==2){
	query+='&set=2';
}else if(set==3){
	query+='&set=3';
}
document.getElementById("subhaeder").innerHTML=text;
tmp_obj=document.getElementById("sc");
tmp_obj.innerHTML='';
call(query);
}


function zoom(obj,set,titel,datum){
if(set>0){
	
	var setleft=150;
	var setini=150;
	var mouseleft=90;

	if(set==1){
	var mouseX =  obj.parentNode.parentNode.offsetLeft;
	if (!window.innerHeight){if(mouseX<0){mouseX+=250;setleft+=30;}}
	var mouseY =  (obj.parentNode.parentNode.parentNode.parentNode.offsetTop*-1)+10;

	}else if(set==2){
	var mouseX =  obj.parentNode.parentNode.offsetLeft;
	var mouseY =  obj.parentNode.parentNode.offsetTop;
	setleft+=30;
	setini-=50;
	mouseleft-=50;
	}else if(set==3){
	var mouseX =  obj.parentNode.parentNode.offsetLeft;
	var mouseY = (obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.offsetTop*-1)+10;
	}

var el=document.createElement("DIV");
el.setAttribute("id","imgZoom");
el.style.top=(mouseY)+'px';

if(mouseX >= setini){mouseX-=setleft;}
else mouseX+=mouseleft;

el.style.left=mouseX+'px';



el.style.backgroundColor="white";
el.style.position="absolute";
el.style.font="normal 1em/1 calibri";
el.style.border='solid 5px gray';
el.style.padding='0.5em';
el.style.zIndex=100;
el.appendChild(document.createElement("IMG"));
el.lastChild.style.verticalAlign="top";
el.lastChild.src=obj.src;

el.appendChild(document.createElement("BR"));
el.appendChild(document.createTextNode(titel));
el.appendChild(document.createElement("BR"));
el.appendChild(document.createTextNode(datum));

	if(set==1){	
	obj.parentNode.parentNode.parentNode.parentNode.appendChild(el);
	}else{
	obj.parentNode.parentNode.parentNode.style.zIndex=100;
	obj.parentNode.parentNode.parentNode.appendChild(el);
	}
}else{

if(set==0 && document.getElementById("imgZoom")){
	
obj.parentNode.parentNode.parentNode.parentNode.removeChild(document.getElementById("imgZoom"));
}else{
obj.parentNode.parentNode.parentNode.removeChild(document.getElementById("imgZoom"));
	
}}}

