var	indexid='2';
var	deshid=-40;
var	deszy=-7;
var ty=40;
var moveupinfo=new Array();
var fadeinfo=new Array();
var hdvvideoobjs=null;
if (window.location.hostname.indexOf('sexysway')==-1){var thisdomain='susanwayland';}else{var thisdomain='sexysway';}
if (window.location.hostname.indexOf('.de')==1){var thislang='com';}else{var thislang='de';}
var httptextrequest=false;
function GetXMLHttpRequest(){
if (window.XMLHttpRequest){// Mozilla,Safari,...
var object=new XMLHttpRequest();
if (object.overrideMimeType){
object.overrideMimeType('text/html;charset=ISO-8859-1');
}}else if (window.ActiveXObject){	// IE
try{
object=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
object=new ActiveXObject("Microsoft.XMLHTTP");
}catch(e2){}}
}else{
return false;
}
return object;
}
function addEvent(elmi,evType,fn){
if (elmi.addEventListener){elmi.addEventListener(evType,fn,false);return true;}else 
if (elmi.attachEvent){var r=elmi.attachEvent("on"+evType,fn);return r;}}
function styleopacity(v){
var vx=v;if (vx>1) vx/=100;var op=Math.max(0,Math.min(100,Math.round(vx*100)));
if (window.ActiveXObject){return '-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity='+op+')";filter:Alpha(opacity='+op+');';}else
{return 'opacity:'+vx+';';}}
function javaopacity(ob,v){javaopacityd(document.getElementById(ob),v);}
function javaopacityd(obj,v){
if (v<0.01) v=0.0;if (v>1.0) v/=100;
if (window.ActiveXObject){
var opa=Math.max(0,Math.min(100,Math.round(v*100)));
if (obj.filters.alpha){obj.filters.alpha.opacity=opa;}else 
{obj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+opa+")";}}else
{obj.style.opacity=v;if (obj.style.MozOpacity) obj.style.MozOpacity=v;}}
function showbackground(evt){
if (evt.target){
zw=evt.target.clientWidth+20;
tl=evt.target.offsetLeft-10;
}else{
zw=evt.srcElement.clientWidth+20;
tl=evt.srcElement.offsetLeft-10;
}
tw=zw;
document.getElementById('menubg').style.left=tl+"px";
document.getElementById('menubg').style.width=tw+"px";
zl=tl;zx=0;zy=deszy;ctime=setTimeout("movebackgr()",10);
}
function hidebackground(evt){zx=0;zy=deshid;if (!ctime){movebackgr();}}
function movebackgr(){
if (ctime){clearTimeout(ctime);ctime=null;}
var mb=document.getElementById('menubg');
if (!mb) return;
var oy=ty;var ow=tw;var ol=tl;
ry=Math.round((zy-ty)/2); 
if (Math.abs(ry)<1){if (zy-ty<0){ry=-1;}else{ry=1;}}
ty+=ry;
if (Math.abs(Math.abs(zy)-Math.abs(ty))<=1){if (ctime){clearTimeout(ctime);ctime=null;}mb.style.top=zy+"px";return;}
mb.style.top=ty+"px";
if (!ctime) ctime=setTimeout("movebackgr()",50);
}
function shorttitle(s,c,w){
var w2=s.length*(c*0.7);
if (s==''||w<=1||c<10||w>=w2) return s;
var so=s;var cr=0;
while (s.length*(c*0.7)>w){
var s2=s.substr(0,s.lastIndexOf(' '));
if (s2=='') return so;
s=s2+'...';
cr++;if (cr>10) return so;
}
if (s.length*(c*0.7)<w*0.5){
s=so.substr(0,w*0.9/(c*0.7) )+'...';
}
return s;
}
// Nice H1Titles
function swaptitle(e,s){
for (var i=0;i<e.length;i++){
var txt=' '+e[i].className+' ';
if (txt.indexOf(' tchanged ')==-1&&txt.indexOf(' no-change ')==-1){
txt=e[i].innerHTML;
if (!txt) return;
var w=parseInt(e[i].offsetWidth||e[i].clientWidth||e[i].style.pixelWidth,10);
//alert('w'+w);
var matches=txt.match(/<a(.*?)href="([^"]*)"(.*?)>(.*)<\/a>/i);
if (matches){
var ln=matches[2];txt=matches[4];var txt2=txt.replace(/[<>"']/,' ');
txt2=shorttitle(txt2,parseInt(s.substr(6),10),w);
e[i].innerHTML='<a'+matches[1]+'href="'+matches[2]+'"'+matches[3]+'><img alt="" src="/external/requesttitlebg.php?t='+escape(txt2)+s+'&link=1" /></a>';
}else{
txt=shorttitle(txt,parseInt(s.substr(6),10),w);
with (e[i].style){
textAlign='left';textIndent='-9999px';backgroundImage="url(/external/requesttitlebg.php?t="+escape(txt)+s+")";
}}
e[i].className+=' tchanged';
}}
}
function getChildnodeByClass(classname,obj){
var desz=obj.childNodes;
for (var j=0;j<desz.length;j++){
if (desz[j].className&&desz[j].className.indexOf(classname)!=-1){return desz[j];break;}
var desz2=getChildnodeByClass(classname,desz[j]);
if (desz2) return desz2;
}
return null;
}
function nicetitles(){
var state=document.readyState;
var m=document.getElementById('menu');
if ((state=='complete'||state=='interactive')&&m&&!document.getElementById('menubg')){
if ((window.location.pathname=='/'&&window.location.host.substr(0,3)=='www')||document.getElementById('ginf')){
indexid='';deshid=40;deszy=0;
}else{
indexid='2';deshid=-40;deszy=-7;
}
m.style.overflow="hidden";
if (thisdomain=='sexysway'){var bstr='http://img0.'+thisdomain+'.'+thislang+'/graphics/v9/mainmenu'+indexid+'.png';}
else{var bstr='http://img0.'+thisdomain+'.'+thislang+'/graphics/v9/mainmenu'+indexid+'.png';}
m.innerHTML+='<'+'img id="menubg" alt="'+document.title+'" src="'+bstr+'" style="position:absolute;z-index:8;top:40px;height:40px;width:120px;" /'+'>';
ty=deshid;
var sigtags=m.getElementsByTagName('a');
for (var i=0,len=sigtags.length;i<len;i++){
sigtags[i].style.backgroundColor="transparent";
addEvent(sigtags[i],"mouseover",showbackground);
addEvent(sigtags[i],"mouseout",hidebackground);
}
m.className='trbg';
if (indexid!=''){
if (document.body){
if (thisdomain=='sexysway'){var bstr='#fff url(http://img0.sexysway.'+thislang+'/graphics/v9/menubackground.png) center -40px no-repeat';}
else{var bstr='#000 url(http://cdn0.susanwayland.'+thislang+'/graphics/v9/menubackground.png) center -40px no-repeat';}
document.body.style.background=bstr;
}
var m2=document.getElementById('ginf');if (m2) m2.style.top='300px';
}}
if (navigator.userAgent.indexOf('MSIE 6')==-1&&navigator.userAgent.indexOf('MSIE 5')==-1&&window.location.host.substr(0,3)!='tgp'){
swaptitle(document.getElementsByTagName('h1'),'&size=20');
swaptitle(document.getElementsByTagName('h2'),'&size=16');
swaptitle(document.getElementsByTagName('h3'),'&size=13');
}
if (document.body&&state=='complete'){
var animp=document.body.getElementsByTagName('div');
for (var i=0,len=animp.length;i<len;i++){
var txt=' '+animp[i].className+' ';
if (txt.indexOf(' screvt ')!=-1){
var c=10;var desz=null;
des=getChildnodeByClass('scrobj',animp[i]);
if (!des) continue;
fadeopacity(null,fadeinit(des,animp[i]),0.0 );
addEvent(animp[i],"mouseover",fadeopacity);
addEvent(animp[i],"mouseout",fadeopacity);
}}
}
if (state!='complete') window.setTimeout('nicetitles()',50);
}
function fadeinit(obj,evtobj){
var ipos=fadeinfo.length;
fadeinfo[ipos]=new Object();
fadeinfo[ipos].opacity=1.0;
fadeinfo[ipos].dest=1.0;
fadeinfo[ipos].evtobj=evtobj;
fadeinfo[ipos].obj=obj;
fadeinfo[ipos].active=false;
return ipos;
}
function fadeopacity(evt,objid,dest){
var selid=-1;
var s='';
if (evt!=null){
if (evt.target){var e=evt.target;}else{var e=evt.srcElement;}
var c=10;var des=e;while (des&&(c--)>0){if(des.className&&des.className.indexOf('screvt')!=-1){break;}des=des.parentNode;}
if (!des||des=='undefined'||c<=0) return;
for (var i=0;i<fadeinfo.length;i++){if (fadeinfo[i].evtobj==des){selid=i;break;}}
if (evt.type.toLowerCase()=='mouseover'){dest=1.0}else{dest=0.0}}else if (objid!=null){
selid=objid;
}else return;
if (selid==-1||fadeinfo[selid]==null) return;
if (dest!=fadeinfo[selid].dest){
fadeinfo[selid].dest=dest;
if (fadeinfo[selid].active==false){
fadeinfo[selid].active=true;
//moveupopacity(selid);
if (dest==1.0){moveupopacity(selid);}else{setTimeout("moveupopacity("+selid+")",100);}}
}}
function moveupopacity(i){with (fadeinfo[i]){var dirsp=2;if (dest<opacity) dirsp=4;
var ry=(dest-opacity)/dirsp;
if (Math.abs(ry)<0.05){if (dest-opacity<0){ry=-0.05;}else{ry=0.05;}} 
opacity+=ry;if (opacity>1.0){opacity=1.0;}else if (opacity<0.0){opacity=0.0;}
if (Math.abs(dest-opacity)<0.05){javaopacityd(obj,dest);active=false;return;}else{javaopacityd(obj,opacity);}}
setTimeout("moveupopacity("+i+")",40);
}
nicetitles();
function moveupheight(i,finalFunction){with (moveupinfo[i]){
var ry=Math.round((dest-pos)/2);
if (Math.abs(ry)<1){if (dest-pos<0){ry=-1;}else{ry=1;}} 
pos+=ry;
if (Math.round(pos)==Math.round(dest)){if (dest==0){obj.style.display='none';}obj.style.height=dest+"px";active=false;if (finalFunction!=''){eval(finalFunction);}return;}else{if (obj.style.display=='none'&&pos>0){obj.style.display='block';}obj.style.height=pos+"px";}}
setTimeout("moveupheight("+i+",'"+finalFunction+"')",50);
}
function moveupinit(obj,a,b,dest,pos){
var ipos=moveupinfo.length;
moveupinfo[ipos]=new Object();
moveupinfo[ipos].obj=obj;
moveupinfo[ipos].dest=dest;
moveupinfo[ipos].pos=pos;
moveupinfo[ipos].a=a;
moveupinfo[ipos].b=b;
moveupinfo[ipos].active=true;
return ipos;
}
function getExisitingOst(d){
for (var i=0;i<moveupinfo.length;i++){if (moveupinfo[i].obj==d) return i;}
return -1;
}
function ost(evt,des,finish){
if (!des||typeof(des)=='undefined'){
if (evt.target){var e=evt.target;}else{var e=evt.srcElement;}
var c=10;des=e;while (des.tagName&&des.tagName.toLowerCase()!='div'&&(c--)>0){des=des.parentNode;}
if (!des||c<=0) return;
des=des.parentNode.getElementsByTagName('p')[0];
}else{
des=document.getElementById(des);
}
var objid=getExisitingOst(des);
if (typeof(finish)!='undefined'&&finish){var addFinalFunction=",'"+finish+"'";}else{var addFinalFunction=",''";}
if (objid!=-1){
if (moveupinfo[objid].b=='auto'){
with (des.style){var h=height;var d=display;height='auto';display='block';}
moveupinfo[objid].b=parseInt(des.offsetHeight||des.clientHeight||des.style.pixelHeight,10);
with (des.style){height=h;display=d;}}
if (moveupinfo[objid].pos==moveupinfo[objid].a){moveupinfo[objid].dest=moveupinfo[objid].b;}else 
if (moveupinfo[objid].pos==moveupinfo[objid].b){moveupinfo[objid].dest=moveupinfo[objid].a;}else 
{if (moveupinfo[objid].pos!=moveupinfo[objid].b){moveupinfo[objid].dest=moveupinfo[objid].b;}else 
{moveupinfo[objid].dest=moveupinfo[objid].a;}}
if (!moveupinfo[objid].active){moveupinfo[objid].active=true;setTimeout("moveupheight("+objid+addFinalFunction+")",50);}}else{
var pos=0;var a=0;var b=0;var dest=0;
with (des.style){
if (!position||position=='') position='relative';
if (overflow=='hidden'&&!(height==''||height=='undefined')){
des2=des.childNodes[0];
b=parseInt(des2.offsetHeight||des2.clientHeight||des2.style.pixelHeight,10);dest=b;
}else
if (display==''||display=='none'){
overflow='hidden';
var oz=zIndex;zIndex='-1';display='block';
b=parseInt(des.offsetHeight||des.clientHeight||des.style.pixelHeight,10);
dest=b;zIndex=oz;
}else{
overflow='hidden';
b=parseInt(des.offsetHeight||des.clientHeight||des.style.pixelHeight,10);pos=b;dest=0;
}
if (!height){height='1px';}else if (height.toLowerCase()!='auto'){a=parseInt(height,10);}}
setTimeout("moveupheight("+( moveupinit(des,a,b,dest,pos) )+addFinalFunction+")",50);
}
return false;
}
function hdvvideoanimation(){
if (!hdvvideoobjs||hdvvideoobjs.length==0) return;
var s=hdvvideoobjs[1].src.match(/(http\:\/\/.*?)(_[1-4])?(\.jpg)/);
hdvvideoobjs[0]++;if (hdvvideoobjs[0]>4) hdvvideoobjs[0]=1;
hdvvideoobjs[1].src=s[1]+(hdvvideoobjs[0]>1?'_'+hdvvideoobjs[0]:'')+s[3];
hdvvideoobjs[2]=setTimeout('hdvvideoanimation()',500);
}
function hdvvideoanimationstop(){if (hdvvideoobjs){clearTimeout(hdvvideoobjs[2]);hdvvideoobjs=null;}}
function hdvvideoanimationstart(id){hdvvideoobjs=new Array(1,id);hdvvideoanimation();}
function handleSkeepalive(http,desurl){
if (http&&http.readyState==4&&http.status==200){
var content=http.responseText;if (content=='0'){window.location='http://'+desurl;}}}
function skeepalive(desurl,sid){
httptextrequest=GetXMLHttpRequest();if (!httptextrequest) return false;
httptextrequest.onreadystatechange=function(){handleSkeepalive(httptextrequest,desurl);}
try{var t=new Date();httptextrequest.open('GET','/external/keepalive.php?t='+t.getTime()+'&sid='+sid,true);httptextrequest.send(null);}catch( myError ){}}
function swapmembersbar(evt){
if (evt.target){var e=evt.target;}else{var e=evt.srcElement;}
if (e){if (e.className=='c'){e.className='c2';}else{e.className='c';}}
return ost('','membersareainfo',null);
}
function showdropbox(srcobj){with (document.getElementById(srcobj)){if (!style.display||style.display==''||style.display=='none'){style.display='block';}else{style.display='none';}}return false;}
function gettext(mysrc,req,lang,fs){
var c=10;var des=mysrc;while (des.tagName.toLowerCase()!='p'&&des.tagName.toLowerCase()!='div'&&des.tagName.toLowerCase()!='li'&&(c--)>0) des=des.parentNode;
if (!des) return;
if (des.getElementsByTagName('div').length>0){var sp=des.getElementsByTagName('div')[0];
if (sp.style.display=='none'){sp.style.display='block'}else{sp.style.display='none';}}else{
httptextrequest=GetXMLHttpRequest();
if (!httptextrequest) return false;
var xmltxtname=xmltxtnameo='snagtextxml';var cx=1;
while (document.getElementById(xmltxtname)!=null){xmltxtname=xmltxtnameo+cx;cx++;}
des.innerHTML+='<div id="'+xmltxtname+'" style="font-size:'+fs+'px;display:block;padding:5px 0 10px 10px;text-align:left"></div>';
httptextrequest.onreadystatechange=function(){handleTextUpdate(httptextrequest,xmltxtname);}
try{
var t=new Date();
httptextrequest.open('GET','/external/getexternaltexts.php?l='+lang+'&k='+req+'&t='+t.getTime(),true);
httptextrequest.send(null);
}catch( myError ){}}
return false;
}
function handleTextUpdate(http,dest){
if (http&&http.readyState==4&&http.status==200){
var content=http.responseText;
document.getElementById(dest).innerHTML=content;
}}
