var tabs = new Array('tab1', 'tab2', 'tab3');

function buttons(tab)
{
for (i = 0; i < tabs.length; i++)
{
if (document.getElementById(tabs[i]))
{
document.getElementById(tabs[i]).style.display = 'none';
}
}
document.getElementById(tab).style.display = 'block';
	
	if(tab == 'tab1') {
        document.butt1.src = 'images/website/gfx_button_search_light.png';
        }
        
        if(tab == 'tab2') {
        document.butt2.src = 'images/website/gfx_button_profile_light.png';
        }
        
        if(tab == 'tab3') {
        document.butt3.src = 'images/website/gfx_button_message_light.png';
        }
        
}
var pole = new Array('form1', 'form2');
function polecam(form) {
	for (i = 0; i < pole.length; i++) {
		if (document.getElementById(pole[i])) {
		document.getElementById(pole[i]).style.display = 'none';
		}
	}
document.getElementById(form).style.display = 'block';
}
var pol = new Array('favourite1', 'favourite2');
function ulubione(form) {
	for (i = 0; i < pol.length; i++) {
		if (document.getElementById(pol[i])) {
		document.getElementById(pol[i]).style.display = 'none';
		}
	}
document.getElementById(form).style.display = 'block';
}
mb = new Array();
mb[1] = 'menu_config';
mb[2] = 'menu_blog';
mb[3] = 'menu_friends';
mb[4] = 'menu_mail';

function menu_bottom_a(a){
	document.getElementById(mb[a]).style.display='block';
	for (i = 1; i < 4; i++) {
		if(i==a){
		document.getElementById(mb[a]).style.display='block';
		} else {
		setTimeout("menu_bottom_ba("+i+")", 11500);
		}
	}
}
function menu_bottom_b(a){
setTimeout("menu_bottom_ba("+a+")", 1500);
}
function menu_bottom_ba(a){
document.getElementById(mb[a]).style.display='none';
}
function faq_IDS(id){
var div = document.getElementById(id);
if(div.style.display=='none'){
div.style.display='block';
} else {
div.style.display='none';
}
}
var fadeimages=new Array()
fadeimages[0]=["http://www.isims.de/wp-content/news_images/image/buttons/isims.png", "http://www.isims.de", "_new"]
fadeimages[1]=["/images/banners/sims2slo.jpg", "http://sims2slo.com", "_new"]
fadeimages[2]=["/images/banners/simway.jpg", "http://www.simway.net", "_new"]
fadeimages[3]=["http://www.e-nfs.eu/buttons/eNFSeu_88x31_03.png", "http://www.e-nfs.eu", "_new"]
fadeimages[4]=["/images/banners/stl.gif", "http://www.simowie.info", "_new"]
fadeimages[5]=["/images/banners/sims3cz.jpg", "http://www.sims3.cz", "_new"]
fadeimages[6]=["/images/banners/whitesims.gif", "http://www.simyadka.pl", "_new"]
fadeimages[7]=["/images/banners/simsexchangede.gif", "http://simsexchange.de", "_new"]
fadeimages[8]=["/images/banners/simsdominationcom.gif", "http://www.simsdomination.com", "_new"]
fadeimages[9]=["/images/banners/simfans.jpg", "http://simfans.de", "_new"]
var fadeimages2=new Array()
fadeimages2[0]=["http://img148.imageshack.us/img148/9548/wielkieprojekty.jpg", "http://www.simpress.pl/forum/index.php?board=60.0", ""]
fadeimages2[1]=["/images/advert2.png", "/community/register", ""]
fadeimages2[2]=["/images/advert.png", "", ""]
var fadebgcolor="#55a4c5"

var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 			var html = '<div id="zglos" style="display:block"><b>Zglo&para;:</b><br /><div style="width:410px;margin-bottom:8px"><div style="float:left"><div style="width:200px;background-color: #175f79;border: 1px solid #378a9a;color: #55b8d6;font-size:9pt;font-family: Verdana;height:19px;margin-top:2px;margin-bottom:5px;padding-left:2px;"><b>Nick:</b><input type="text" maxlength="20" style="background-color: #175f79;border: 1px solid #175f79;color: #55b8d6;font-size:9pt;font-family: Verdana;width:160px" name="nick"></div></div><div style="float:right"><div style="width:200px;background-color: #175f79;border: 1px solid #378a9a;color: #55b8d6;font-size:9pt;font-family: Verdana;height:19px;margin-top:2px;margin-bottom:5px;padding-left:2px;"><b>E-mail:</b><input type="text"  style="background-color: #175f79;border: 1px solid #175f79;color: #55b8d6;font-size:9pt;font-family: Verdana;width:149px" name="email"></div></div><br /></div><div style="width:406px;background-color: #175f79;border: 1px solid #378a9a;color: #55b8d6;font-size:9pt;font-family: Verdana;height:19px;margin-top:2px;padding-left:2px;"><b>Temat:</b><input type="text"  style="background-color: #175f79;border: 1px solid #175f79;color: #55b8d6;font-size:9pt;font-family: Verdana;width:350px" name="temat"></div><span style="font-size:9pt; font-weight: bold;text-align:left;float:left">Tre&para;c zgloszenia:</span><br /><textarea style="width:410px;height:78px;background-color: #175f79;border: 1px solid #378a9a;color: #55b8d6;font-size:9pt;font-family: Verdana;" name="tresc"></textarea><br /><img src="http://www.simpress.pl/images/buttons/gfx_button_send.png"></div><div id="box" style="display:block" onclick="FadeOut()"></div>';
			function zglos() {
			document.getElementById("box_zglos").innerHTML = html;
			document.getElementById("box_zglos").style.display="block";
			}

			function FadeOut() {
			document.getElementById("box_zglos").style.display="none";
			document.getElementById("box_zglos").innerHTML = '';
			}
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function answer(id){
var nick = document.getElementById('answer_nick_'+id).value;
var value = document.getElementById('answer_value_'+id).value;
document.getElementById('nick_odp').innerHTML=nick;
document.getElementById('answer_odp').innerHTML=value;
document.getElementById('id_post').value=id;
document.getElementById('comment_form_answer').style.display="block";
}
function answer_delete(id){
document.getElementById('comment_form_answer').style.display="none";
document.getElementById('id_post').value='';
}
wysiwyg_info = new Array();
wysiwyg_info[1] = '<b>Informacja:</b> Wybierz i dodaj emotke.';
wysiwyg_info[2] = '<b>Informacja:</b> Zaznacz i wytłuszcz tekst: [b]tekst[/b]';
wysiwyg_info[3] = '<b>Informacja:</b> Zaznacz i pochyl tekst: [i]tekst[/i]';
wysiwyg_info[4] = '<b>Informacja:</b> Zaznacz i podkreśl tekst: [u]tekst[/u]';
function insertext(open, close, area){

	var msgfield = document.getElementById(area);

	if (document.selection && document.selection.createRange){
		msgfield.focus();
		sel = document.selection.createRange();
		sel.text = open + sel.text + close;
		msgfield.focus();
	}
	else if (msgfield.selectionStart || msgfield.selectionStart == "0"){
		var startPos = msgfield.selectionStart;
		var endPos = msgfield.selectionEnd;

		msgfield.value = msgfield.value.substring(0, startPos) + open + msgfield.value.substring(startPos, endPos) + close + msgfield.value.substring(endPos, msgfield.value.length);
		msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + close.length;
		msgfield.focus();
	}
	else {
		msgfield.value += open + close;
		msgfield.focus();
	}

	return;
}


function wysiwyg_comment(id){
document.getElementById('info_wysiwyg_comment').innerHTML=wysiwyg_info[id];
}
function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

