// if (top != self) top.location = location;

function confirmation(returl,pytanie) {
    var answer = confirm(pytanie)
    if (answer){
//	alert("Uwaga!");
	window.location = returl;
    }
//    else{
//	alert("Thanks for sticking around!")
//    }
}

function alert_info(tresc) {
	alert(tresc);
}


function confirmationdelfile(fpath,file,pytanie) {
    if (file){
        var answer = confirm(pytanie);
        if (answer){
//alert(returl);
//	    returl;
            deleteimageclick(fpath,file);
        }
    }
//else{
//        alert("Wybierz plik! / No selected file!")
//    }
}

function launchdzial(newdz){
    var remote = 'mod.php?dz=' + newdz;
    window.location = remote;
}


function showSWF(imageName, imagesFolder, imageWidth, imageHeight) {
//if(do_dw_var){
document.writeln('<OBJECT  id=top align=middle classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\""+imageWidth+"\" HEIGHT=\""+imageHeight+"\" classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000>');
document.writeln('<PARAM NAME="_cx" VALUE="20373"> ');
document.writeln('<PARAM NAME="_cy" VALUE="2117"> ');

document.writeln('<param name=\"WMode\" value=\"Opaque\">');
document.writeln('<PARAM NAME=\"Play\" VALUE=\"yes\">');

document.writeln('<param name=\"menu\" value=\"false\">');
document.writeln('<PARAM NAME=\"movie\" VALUE=\""+imagesFolder+"/" + imageName + "\"> ');
document.writeln('<PARAM NAME=\"quality\" VALUE=best> ');
document.writeln('<PARAM NAME=\"scale\" VALUE=ShowAll> ');
document.writeln('<PARAM NAME=\"bgcolor\" VALUE=#000000> ');
document.writeln('<EMBED src=\""+imagesFolder+"/" + imageName + "\" Play=\"yes\" menu=false wmode=opaque quality=best scale=ShowAll bgcolor=#000000 WIDTH=\""+imageWidth+"\" HEIGHT=\""+imageHeight+"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED></OBJECT>');

}

function obiect_showhide(namex){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;
    if(ie)	adDiv=eval('document.all.'+namex+'.style');
    else if(ns)	adDiv=eval('document.layers['+namex+']');
    else if(w3)	adDiv=eval('document.getElementById('+namex+').style');

    if (ie||w3){
        if (adDiv.visibility=="visible"){
            adDiv.visibility="hidden";
            adDiv.display="none";
        }else{
            adDiv.visibility="visible";
            adDiv.display="block";
        }
    }else{
        if (adDiv.visibility=="show"){
            adDiv.visibility ="none";
            adDiv.display="none";
        }else{
            adDiv.visibility ="show";
            adDiv.display="block";
        }
    }
} 

function obiect_show(namex){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;
    if(ie)	adDiv=eval('document.all.'+namex+'.style');
    else if(ns)	adDiv=eval('document.layers['+namex+']');
    else if(w3)	adDiv=eval('document.getElementById('+namex+').style');

    if (ie||w3){
        adDiv.visibility="visible";
    }else{
        adDiv.visibility ="show";
    }
}

function obiect_hide(namex){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;
    if(ie)	adDiv=eval('document.all.'+namex+'.style');
    else if(ns)	adDiv=eval('document.layers['+namex+']');
    else if(w3)	adDiv=eval('document.getElementById('+namex+').style');

    if (ie||w3){
        adDiv.visibility="visible";
    }else{
        adDiv.visibility ="none";
    }
}

function obiect_show2(namex){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;
    if(ie)	adDiv=eval('document.all.'+namex+'.style');
    else if(ns)	adDiv=eval('document.layers['+namex+']');
    else if(w3)	adDiv=eval('document.getElementById('+namex+').style');

    if (ie||w3){
        adDiv.display="";
    }else{
        adDiv.display ="";
    }
}

function obiect_show2img(namex){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;
    if(ie)	adDiv=eval('document.all.'+namex+'.style');
    else if(ns)	adDiv=eval('document.layers['+namex+']');
    else if(w3)	adDiv=eval('document.getElementById('+namex+').style');

    if (ie||w3){
        adDiv.backgroundImage = "url(\"ico/TABS/tab_bg.gif\")";
    }else{
        adDiv.style.backgroundImage = "url(\"ico/TABS/tab_bg.gif\")";
    }
}

function obiect_hide2(namex){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;
    if(ie)	adDiv=eval('document.all.'+namex+'.style');
    else if(ns)	adDiv=eval('document.layers['+namex+']');
    else if(w3)	adDiv=eval('document.getElementById('+namex+').style');

    if (ie||w3){
        adDiv.display="none";
    }else{
        adDiv.display ="none";
    }

}


function obiect_hide2_all(namex,max){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;

    for(var i = 0; i < max; i++){
        if(ie)	adDiv=eval('document.all.'+namex+i+'.style');
        else if(ns)	adDiv=eval('document.layers['+namex+i+']');
        else if(w3)	adDiv=eval('document.getElementById('+namex+i+').style');

        if (ie||w3){
            adDiv.display="none";
        }else{
            adDiv.display ="none";
        }
    }
}

function obiect_hide2_allimg(namex,max){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;

    for(var i = 0; i < max; i++){
        if(ie)	adDiv=eval('document.all.'+namex+i+'.style');
        else if(ns)	adDiv=eval('document.layers['+namex+i+']');
        else if(w3)	adDiv=eval('document.getElementById('+namex+i+').style');

        if (ie||w3){
            adDiv.backgroundImage = "url(\"ico/TABS/tab_bgoff.gif\")";
        }else{
            adDiv.style.backgroundImage = "url(\"ico/TABS/tab_bgoff.gif\")";
        }
    }
}

function obiect_noitalic2_all(namex,max){
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    if(!ns && !ie && !w3) return;

    for(var i = 0; i < max; i++){
        if(ie)	adDiv=eval('document.all.'+namex+i+'.style');
        else if(ns)	adDiv=eval('document.layers['+namex+i+']');
        else if(w3)	adDiv=eval('document.getElementById('+namex+i+').style');
        adDiv.fontStyle='normal';
        adDiv.fontWeight='normal';
    
    }
}



function getSWF(imageName, imagesFolder, imageWidth, imageHeight) {
    imgText="<OBJECT  classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\""+imageWidth+"\" HEIGHT=\""+imageHeight+"\"><param name=\"wmode\" value=\"opaque\"><param name=\"menu\" value=\"false\"><PARAM NAME=movie VALUE=\""+imagesFolder+"/" + imageName + "\"> <PARAM NAME=quality VALUE=best> <PARAM NAME=scale VALUE=exactfit> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src=\""+imagesFolder+"/" + imageName + "\" menu=false wmode=opaque quality=best scale=exactfit bgcolor=#000000 WIDTH=\""+imageWidth+"\" HEIGHT=\""+imageHeight+"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED></OBJECT>";
    document.write(imgText);
} 



//------------------enter wyslanie formularzajak formulaz nazywa sie form
//var hotkey=13
//if (document.layers){
//    document.captureEvents(Event.KEYPRESS)
//}
//function backhome(e){
//    if (document.layers){
//	if (e.which==hotkey){
//	    document.form.submit();	    	    
//	}
//    }else if (document.all){
//        if (event.keyCode==hotkey){
//            document.form.submit();	    	    
//        }
//    }
//}
//document.onkeypress=backhome

function show_kolory(xname,winname) {
//488px;dialogHeight:323,   dialogWidth:488px;dialogHeight:323px;help:no;center:yes;status:no;
    var vWinCal = window.open(xname, winname+"Kolory", "width=488,height=323,status=no,center=yes,resizable=yes,top=200,left=200,scrollbars=0,resizable=0,menubar=0,help=0,menu=0");
    vWinCal.opener = self;
}

function show_imageselect(xname,winname) {
    var vWinCal = window.open(xname, winname+"Image", "width=488,height=500,status=no,center=yes,resizable=yes,top=200,left=200,scrollbars=0,resizable=0,menubar=0,help=0,menu=0");
    var orgopener=vWinCal.opener;
    vWinCal.opener = self;

}

function show_imageedit(xname,winname) {
    var vWinCal = window.open(xname, winname+"Kolory", "width=588,height=423,status=no,center=yes,resizable=yes,top=200,left=200,scrollbars=yes,resizable=1,menubar=0,help=0,menu=0");
    vWinCal.opener = self;
}

function show_kat(xname) {
    var vWinCal = window.open(""+xname, "Kat_lista", "width=550,height=250,status=no,resizable=yes,top=200,left=200,scrollbars=1");
    vWinCal.opener = self;
}  

function show_pagelist(xname) {
    var vWinCal = window.open(xname, "page_list", "width=650,height=550,status=no,resizable=yes,top=200,left=200,scrollbars=1");
    vWinCal.opener = self;
}

function show_koloryww(xname) {
    var vWinCal = window.open("colors/"+xname, "Kolory", "width=300,height=450,status=no,resizable=yes,top=200,left=200,scrollbars=1");
    vWinCol.opener = self;    
} 

function show_kolory22(xname) {
    var vWinCal = window.open("color/"+xname, "Kolory", "width=300,height=450,status=no,resizable=yes,top=200,left=200,scrollbars=1");
    vWinCal.opener = self;
} 
 
var n=navigator.appName;
 function onColor(blah){
 blah.style.backgroundColor='#003399';
 }

 function offColor(blah){
 blah.style.backgroundColor='#5294ef';
 }

 function Enter(){
 if (event.keyCode == 13)
 document.login.submit();
 }

 function openWindow(theURL,winName,features) {
    if (winName=="edit_page"){
	win2=window.open(theURL,winName,features+", left=15,top=15");
    }else if (winName=="edit_block"){
	win2=window.open(theURL,winName,features+", left=30,top=30");
    }else{
        win2=window.open(theURL,winName,features+", left=2,top=2");
    }

    win2.creator=self;
    if(win2.focus){win2.focus();}
 }

 function openWindow0(theURL,winName,features) {
    win2=window.open(theURL,winName,features+", left=5,top=5");
    win2.creator=self;
    if(win2.focus){win2.focus();}
 }



 function launch(newURL, newName, newFeatures, orgName){
 var remote = open(newURL, newName, newFeatures);
 if (remote.opener == null)
 remote.opener = window;
 remote.opener.name = orgName;
 return remote;
 }

 function launchEmail(url) {
 myEmail = launch(url, "myRemote", "height=520,width=730,left=0,top=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=1,menubar=1,resizable=1,scrollbars=1,status=0,toolbar=1", "myWindow");
 }

 function openEmail(url) {
 window.open(url, "myRemote", "height=520,width=730,left=0,top=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=1,menubar=1,resizable=1,scrollbars=1,status=0,toolbar=1");
 }

 function emailBlah(form){
 form = document.login;
 var blah = location.href;
 var newWin = window.open("", "myRemote", "width=730,height=520,left=0,top=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=1,menubar=1,resizable=1,scrollbars=1,status=0,toolbar=1", "myWindow");
 newWin.document.write("<html><body><form method=\"POST\" action=\"http://mail.yep.com/websidestory1/login/loginaction.asp\" name=\"login\" target=\"_top\">");
 newWin.document.write("<input type=\"hidden\" name=\"company\" value=\"Yepmail\">");
 newWin.document.write("<input type=\"hidden\" value=\"0\" name=\"Interface\">");
 newWin.document.write("<input type=\"hidden\" value name=\"RedirURL\">");
 newWin.document.write("<input type=\"hidden\" name=\"java\" value=\"1\">");
 newWin.document.write("<input type=\"hidden\" name=\"loginname\" value=\""+form.loginname.value+"\">");
 newWin.document.write("<input type=\"hidden\" name=\"loginpassword\" value=\""+form.loginpassword.value+"\">");
 newWin.document.write("</form>");
 newWin.document.login.submit();
 location.href = blah;
 newWin.focus();
 }

 function validateFormHiJinx(form){
 if( form.email.value == ""){
 alert("Please enter your email address.");
 form.email.focus();
 return false;
 }
 var str = form.email.value
 var isEmail = ((str.indexOf("@") != -1) && (str.indexOf(".") != -1))

 if (!isEmail){
 alert("" + str + " is an invalid email address!")
 form.email.select()
 form.email.focus()
 return false;
 }
 blah(form);
 return true;
 }

 function blah(form){
 var newWin = window.open("", "thanks", "width=300,height=300");
 newWin.document.write("<html><body><form action=\"http://tools.hitbox.com/cgi-bin/news/cgi/list.cgi\" method=\"get\" name=\"traffic\">");
 newWin.document.write("<input type=\"hidden\" name=\"email\" value=\"" + form.email.value + "\">");
 newWin.document.write("<input type=\"hidden\" value=\"Subscribe\" name=\"action\">");
 newWin.document.write("<input type=\"hidden\" value=\"yep\" name=\"list\">");
 newWin.document.write("<input type=\"hidden\" name=\"r\" value=\"yep\">");
 newWin.document.write("<div style=\"position:absolute; top:-10px; left:-10px; width:1px; height:1px; visibility:hidden; overflow:hidden;\"><input type=\"checkbox\" name=\"format\" value=\"html\"");
 
 if(form.format.checked == true){
 newWin.document.write(" CHECKED><\/div>");
 }else{
 newWin.document.write("><\/div>");
 }
 newWin.document.write("</form>");
 newWin.document.traffic.submit();
 newWin.focus();
 }

function jakeplaysbingo(which) {
 if (which.options[which.selectedIndex].value != "!!") {
 var blahWin = window.open( "http://yep.com/content/newsletter/nl_" + which.options[which.selectedIndex].value + ".html", "yep", "width=575,height=460,location=no,scrollbars=yes,resizable=yes");
 blahWin.focus();
 }
}


var myRand = 1; 
var img = new Array(); // name of images w/o extension or path
var txt = new Array();
var url = new Array();

function setRand(){
 d = new Date;
 myRand = d.getSeconds();
 myRand = myRand % 6;
}

function setValues(){
 img[0] = "feat_ecards"; 
 img[1] = "feat_freestuff";
 img[2] = "feat_graphics";
 img[3] = "feat_games";
 img[4] = "jokes";
 img[5] = "feat_translation";

 txt[0] = "<b>E-cards</b></a><br>A great way to say hello to family and friends.<br>";
 txt[1] = "<b>Free Stuff</b></A><br>Who says you can't get things for free anymore?<br>";
 txt[2] = "<b>Graphics</b></A><br>Search for graphics the fast, easy way.<br>";
 txt[3] = "<b>Games</b></A><br>Busy day? Why not take a break and play?<br>";
 txt[4] = "<b>Jokes</b></A><br>Laugh for hours until your belly hurts!<br>";
 txt[5] = "<b>Translation</b></a><br>How many ways can you find to say 'hello'?<br>";

 url[0] = "http://yep.sugar3.com";
 url[1] = "http://www.yep.com/cgi-bin/displayRank_yep.cgi?free_stuff/subpage";
 url[2] = "http://yep.gograph.com";
 url[3] = "http://yep.gamehouse.com";
 url[4] = "http://yep.funnymail.com";
 url[5] = "http://yep.com/translate.shtml";
}

function getRand(){
 setRand();
 setValues();
}
function getImage(){
 document.write('');
}

function getText(){
 document.write(txt[myRand]);
}

function getUrl(){
 document.write('<a href="' + url[myRand] + '" class="catLink">');
}

function Pcertify() { 
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=8112000055415', 'Participant', 'location=yes,scrollbars=yes,width=450,height=300');
window.name = 'opener'; 
}


ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false; 
var winWidth = (ns4)? window.innerWidth-8 : screen.availWidth-10;
var tmpH = screen.availHeight * 0.85;
var winHeight = tmpH; 
var srodek_x = winWidth / 2;
var srodek_y = winHeight /2;
function dispWindow (url,width,height) {
 var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',left=0,resizeble=yes,scrollbars=no,menubar=no,location=no');
}
function dispWindow2(name,url, width, height) {
 var Win2 = window.open(url,name,'width=' + width + ',height=' + height + ',resizeble=0,scrollbars=auto,menubar=no,location=no');
}
function dispWindow3(name,url, width, height) {
 var Win2 = window.open(url,name,'width=' + width + ',height=' + height + ',resizeble=0,scrollbars=no,menubar=no,location=no');
}

function okno(name,url, width, height) {
 var Win2 = window.open(url,name,'width=' + width + ',height=' + height + ',location=no,directories=no,status=yes,menubar=no,scrollbars=yes,toolbar=no,resizable=yes,scrolling=yes');
}



var win=null;
function Windowxx(mypage,myname,w,h,scroll,pos){
LeftPosition=0;
TopPosition=0;
settings='width='+(screen.width-10)+',height='+(screen.height-10)+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,scrollbars=no,toolbar=no,resisable=yes,scrolling=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}


var win=null;
function Window(mypage,myname,w,h,scroll,pos){
w=770;
h=520;
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
LeftPosition=0;
TopPosition=0;
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,scrollbars=no,toolbar=no,resizable=yes,scrolling=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}

var win=null;
function WindowMap(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
LeftPosition=0;
TopPosition=0;
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,scrollbars=no,toolbar=no,resizable=yes,scrolling=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}



var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,scrollbars=no,toolbar=no,resisable=no,scrolling=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}


function okno(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes,scrolling=auto';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}



function oknoopis(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,scrollbars=no,toolbar=no,resisable=no,scrolling=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}

function OknoScroll(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,scrollbars=yes,toolbar=no,resisable=no,scrolling=yes';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}



function scrollText() {
status = "GWPE (c) 2001-2006, Copyright by www.Grafnet.pl";
}



// Add options to list
function addOptions(){
  var sel = document.searchForm.whichEngine;
    for(var i = 0; i < arr.length; i++){
	sel.options[i] = new Option(arr[i][0], i); 
  }
}

// Get url for search engine
    function startSearch() {
      searchString = document.searchForm.searchText.value; 
      if(searchString != ""){
        var searchEngine = document.searchForm.whichEngine.selectedIndex;
        var finalSearchString = arr[searchEngine][1] + searchString + '&query=' + searchString ;
        location.href = finalSearchString;
      }
      return false;
    }



// Check if key pressed == enter
function checkKeyx()
{
  if(window.event.keyCode == '13'){
    return startSearch();
  }
  else return true;
}


function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}



function expandDiv(tlll) {
                what  = eval(tlll + "_menu");
                if (what.style.display == "none") {

                        what.style.display = "";

                } 

else

 what.style.display = "none";

        }



	var oldc = new Array;

	function cCell(r,m){

	 if(!document.all) return;

	 if(m){

	  for(i=0;i<r.cells.length;i++){

	  oldc[i]=r.cells[i].bgColor;

	  r.cells[i].bgColor='D3D3D3';

	  }

	 }else{

	  for(i=0;i<r.cells.length;i++){

	  r.cells[i].bgColor=oldc[i];

	  }

	 }

	}

	//

	// Jump to a page

	//

	function jump() {

		parent.location = document.links.url.options[document.links.url.selectedIndex].value;

	}

	//


function WinResize(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
LeftPosition=0;
TopPosition=0;
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes,scrolling=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}


//-------zegar sesji start
var up,down;var min1,sec1;var cmin1,csec1,cmin2,csec2;
function Minutes(data) {
    for(var i=0;i<data.length;i++)
    if(data.substring(i,i+1)==":")
    break;
    return(data.substring(0,i));
}
function Seconds(data) {
    for(var i=0;i<data.length;i++)
    if(data.substring(i,i+1)==":")
    break;
    return(data.substring(i+1,data.length));
}
function Display(min,sec) {
    var disp;
    if(min<=9) disp=" 0";
    else disp=" ";
    disp+=min+":";
    if(sec<=9) disp+="0"+sec;
    else disp+=sec;
    return(disp);
}

function Down() {
    var ile="24:00";
    cmin2=1*Minutes(ile);
    csec2=0+Seconds(ile);
    DownRepeat();
}

function DownRepeat() {
    csec2--;
    if(csec2==-1) {
        csec2=59; cmin2--;
    }
    document.sw.disp2.value=Display(cmin2,csec2);
    if((cmin2==0)&&(csec2==0)){
//        document.cookie="sessionid=0";
        document.location="mod.php?action=logout";
        alert("Uwaga koniec sesji !!!\n\nMusisz ponownie się zalogować!\n\n");
    }else down=setTimeout("DownRepeat()",1000);
}
//-------zegar sesji end

