//Lic//SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
//END.SWFObject

//potwierdzenie
function confirmSubmit(infotext){
  var agree=confirm(infotext);
  if (agree){
    return true ;
  } else {
    return false ;
  }
}

var arVersion = navigator.appVersion.split("MSIE");
var version = parseFloat(arVersion[1]);
function fixPNG(myImage) 
{
if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
{

var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""

var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""

var imgTitle = (myImage.title) ? 

"title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "

var imgStyle = "display:inline-block;" + myImage.style.cssText

var strNewHTML = "<span " + imgID + imgClass + imgTitle

+ " style=\"" + "width:" + myImage.width 

+ "px; height:" + myImage.height 

+ "px;" + imgStyle + ";"

+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"

+ "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"

myImage.outerHTML = strNewHTML	  

}

}


/* BO jQuery sie wywala
function $(id)
{
	return document.getElementById(id);
}
function $$(id)
{
	return document.getElementById(id).value;
}
*/






function submitForm(_formName, _actionName, _actionValue)
{
  	var actionName = document.getElementById(_actionName) ;
//  	alert(_formName);
  	
  	if(actionName == null)
  	{
  		alert("Error: you have to define hidden action variable") ;
  		return ;
	}
  	actionName.value = _actionValue ;
  	document.forms[_formName].submit() ;
}
var flaga=true;
function parserecord(result){
alert(result);
}
function loginremember()
{
var formlog=$('loginremember');
if(flaga)
{
	formlog.innerHTML='';
	flaga = false;
	formlog.innerHTML='<div id="login"><div class="loginHaslo"><div class="prawy" ><div style="float:left; padding-top: 7px" class="email">email: </div><div style="float:right;" class="inputColor"><input class="styl1" id="loginnameremember" name="loginnameremember" type="text" value="" style="width:127px" /></div></div></div></div><div  class="zaloguj" style="text-align:right"><a href="javascript:dorequest(\'POST\',\'changepassword.php\',\'tekst\',\'parserecord\',\'action=passwordremember&email=\'+$$(\'loginnameremember\'))" class="zaloguj">wyślij<div style="clear:both"></div></a></div><a class="przypomnijHaslo2" href="javascript:loginremember()">powrót do logowania</a>';
}
else
{
	formlog.innerHTML='';
	flaga = true;
//	formlog.innerHTML='aaaa'
	formlog.innerHTML='<div id="login"><div class="loginHaslo"><div class="prawy" ><div style="float:left; padding-top: 7px" class="email">email: </div><div style="float:right;" class="inputColor"><input class="styl1" name="loginName" type="text" value="" style="width:127px" /></div><div style="clear : both"></div><div style="float:left; padding-top: 7px" class="email">hasło: </div><div style="float:right;" class="inputColor1"><input class="styl1" name="loginPasswd" type="password" value="" style="width:127px" /></div></div></div></div><div  class="zaloguj" style="text-align:right"><a href="javascript: submitForm(\'loginForm\', \'actionId\', \'login\')" class="zaloguj">zaloguj</a></div><a class="zalozKonto" href="zalozKonto.php">rejestracja</a><a class="przypomnijHaslo" href="javascript:loginremember()">przypomnij hasło</a>';




}

}


// function changes images on product site
function changeImg(imgObj, imgHref, imgToChange,width,height)
{
  	var mediumPath = "images/products/medium/" ;
  	var normalnPath = "images/products/" ;
  	var img = document.getElementById(imgObj) ;
  	img.src = mediumPath + imgToChange ;
  	// link passed in 'alt' field for popup javascript
  	img.alt = imgToChange ;
  	img.onclick=new Function("autoResizeWindow(this,'" + width + "+20','" + height + "+20')");
  	var hrefObj = document.getElementById(imgHref) ;
  	//hrefObj.href = normalnPath + imgToChange ;
}


function autoResizeWindow(imageObj,imgWidth,imgHeight)
{
  	var imagePath = "images/products/" + imageObj.alt ;
//	alert(imageObj.alt);
   	var tempImg = new Image() ;
//	alert(imagePath);
	tempImg.src = imagePath ;
  //	alert(tempImg.src);
  	

  	var openedWindow = window.open(imagePath, "" ,"width="+imgWidth+",height="+imgHeight+", menubar=no, toolbar=no, location=no, scrollbars=no, resizable=yes, status=no'") ;
  	
  	// get image size

 // 	openedWindow.resizeTo(imgWidth, imgHeight) ;
  /*	
  	openedWindow.width = imgWidth ;
 	openedWindow.height = imgHeight ;*/
}

// ***************** Rozwijana lista do pliku... gdzieś do zaplecza po prostu :E - POCZATEK

function tree(id)
{
  this.id = id;

  this.click = function ()
  {
    for (var i = 0, el_node; i < this.parentNode.childNodes.length; i++)
    {
      el_node = this.parentNode.childNodes.item(i)
      if (el_node.nodeName.toLowerCase() == 'ul')
      {
        el_node.style.display = el_node.style.display == 'none' ? 'block' : 'none';
        this.parentNode.style.backgroundImage = 'url("' + (el_node.style.display == 'none' ? 'closed' : 'opened') + '.gif")';
        return;
      }
    }
  }

  this.start = function (el)
  {
    for (var i = 0, el_node; i < el.childNodes.length; i++)
    {
      el_node = el.childNodes.item(i);
      if (el_node.nodeName.toLowerCase() == 'a')
      {
        el_node.onclick = this.click;
        for (var j = 0; j < el_node.parentNode.childNodes.length; j++)
        {
          if (el_node.parentNode.childNodes.item(j).nodeName.toLowerCase() == 'ul')
          {
            el_node.parentNode.style.backgroundImage = 'url("closed.gif")';
            el_node.className = (el_node.className ? el_node.className + ' ' : '') + 'folder';
            break;
          }
          if (el_node.parentNode.childNodes.item(j).nodeName.toLowerCase() == 'li') break;
        }
        if (el_node.href && unescape(el_node.href) == unescape(window.location.href))
        {
          el_node.className = 'menuTreeNodeActive';
          var el_parentNode = el_node;
          do
          {
            el_parentNode = el_parentNode.parentNode;
            if (el_parentNode.nodeName.toLowerCase() == 'ul')
            {
              el_parentNode.style.display = 'block';
              if (document.getElementById(this.id) != el_parentNode) el_parentNode.parentNode.style.backgroundImage = 'url("opened.gif")';
            }
          }
          while (document.getElementById(this.id) != el_parentNode)
        }
      }
      else if (el_node.nodeName.toLowerCase() == 'ul') el_node.style.display = 'none';
      this.start(el_node);
    }
  }

  if (document.getElementById && document.childNodes)
  {
    if (document.images)
    {
      new Image().src = 'pik.gif';
      new Image().src = 'pik.gif';
    }
    this.start(document.getElementById(this.id));
  }
}

////////////////////////////////////////////////////////////////////////////////

// general submit form function
function submitForm(_formName, _actionName, _actionValue)
{ 	
  	var actionName = document.getElementById(_actionName) ;
  	
  	if(actionName == null)
  	{
  		alert("Error: you have to define hidden action variable") ;
  		return ;
	}
  	actionName.value = _actionValue ;
  	document.forms[_formName].submit();

}

// show/hide div coresponding to checkBox
function showHideCheckBox(divId, checkBoxId)
{
  	
  	var hideDiv = document.getElementById(divId) ;
  	var checkBox = document.getElementById(checkBoxId) ;
  	
  	if(checkBox == null)
  		alert('checkBoxId incorrect') ;
	if(hideDiv == null)
  		alert('divId incorrect') ;
  	
  	if(checkBox.checked)
     		hideDiv.style.display = "block" ;
   	else
   		hideDiv.style.display = "none" ;
}
function ClickShowHideMenu(id) {
    this.box1Hover = true;
    this.box2Hover = true;

    this.init = function() {
        if (!document.getElementById(this.id)) {
            alert("Element '"+this.id+"' does not exist in this document. ClickShowHideMenu cannot be initialized");
            return;
        }
        this.parse(document.getElementById(this.id).childNodes, this.tree, this.id);
        this.load();
        if (window.attachEvent) {
            window.attachEvent("onunload", function(e) { self.save(); });
        } else if (window.addEventListener) {
            window.addEventListener("unload", function(e) { self.save(); }, false);
        }
    }

    this.parse = function(nodes, tree, id) {
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].nodeType != 1) {
                continue;
            }
            if (nodes[i].className) {
                if ("box1" == nodes[i].className.substr(0, 4)) {
                    nodes[i].id = id + "-" + tree.length;
                    tree[tree.length] = new Array();
                    eval('nodes[i].onmouseover = function() { self.box1over("'+nodes[i].id+'"); }');
                    eval('nodes[i].onmouseout = function() { self.box1out("'+nodes[i].id+'"); }');
                    eval('nodes[i].onclick = function() { self.box1click("'+nodes[i].id+'"); }');
                }
                if ("section" == nodes[i].className) {
                    id = id + "-" + (tree.length - 1);
                    nodes[i].id = id + "-section";
                    tree = tree[tree.length - 1];
                }
                if ("box2" == nodes[i].className.substr(0, 4)) {
                    nodes[i].id = id + "-" + tree.length;
                    tree[tree.length] = new Array();
                    eval('nodes[i].onmouseover = function() { self.box2over("'+nodes[i].id+'", "'+nodes[i].className+'"); }');
                    eval('nodes[i].onmouseout = function() { self.box2out("'+nodes[i].id+'", "'+nodes[i].className+'"); }');
                }
            }
            if (nodes[i].childNodes) {
                this.parse(nodes[i].childNodes, tree, id);
            }
        }
    }

    this.box1over = function(id) {
        if (!this.box1Hover) return;
        if (!document.getElementById(id)) return;
        document.getElementById(id).className = (this.id_openbox == id ? "box1-open-hover" : "box1-hover");
    }

    this.box1out = function(id) {
        if (!this.box1Hover) return;
        if (!document.getElementById(id)) return;
        document.getElementById(id).className = (this.id_openbox == id ? "box1-open" : "box1");
    }

    this.box1click = function(id) {
        if (!document.getElementById(id)) {
            return;
        }
        var id_openbox = this.id_openbox;
        if (this.id_openbox) {
            if (!document.getElementById(id + "-section")) {
                return;
            }
            this.hide();
            if (id_openbox == id) {
                if (this.box1hover) {
                    document.getElementById(id_openbox).className = "box1-hover";
                } else {
                    document.getElementById(id_openbox).className = "box1";
                }
            } else {
                document.getElementById(id_openbox).className = "box1";
            }
        }
        if (id_openbox != id) {
            this.show(id);
            var className = document.getElementById(id).className;
            if ("box1-hover" == className) {
                document.getElementById(id).className = "box1-open-hover";
            }
            if ("box1" == className) {
                document.getElementById(id).className = "box1-open";
            }
        }
    }

    this.box2over = function(id, className) {
        if (!this.box2Hover) return;
        if (!document.getElementById(id)) return;
        document.getElementById(id).className = className + "-hover";
    }

    this.box2out = function(id, className) {
        if (!this.box2Hover) return;
        if (!document.getElementById(id)) return;
        document.getElementById(id).className = className;
    }

    this.show = function(id) {
        if (document.getElementById(id + "-section")) {
            document.getElementById(id + "-section").style.display = "block";
            this.id_openbox = id;
        }
    }

    this.hide = function() {
        document.getElementById(this.id_openbox + "-section").style.display = "none";
        this.id_openbox = "";
    }

    this.save = function() {
        if (this.id_openbox) {
            this.cookie.set(this.id, this.id_openbox);
        } else {
            this.cookie.del(this.id);
        }
    }

    this.load = function() {
        var id_openbox = this.cookie.get(this.id);
        if (id_openbox) {
            this.show(id_openbox);
            document.getElementById(id_openbox).className = "box1-open";
        }
    }

    function Cookie() {
        this.get = function(name) {
            var cookies = document.cookie.split(";");
            for (var i = 0; i < cookies.length; i++) {
                var a = cookies[i].split("=");
                if (a.length == 2) {
                    a[0] = a[0].trim();
                    a[1] = a[1].trim();
                    if (a[0] == name) {
                        return unescape(a[1]);
                    }
                }
            }
            return "";
        }
        this.set = function(name, value) {
            document.cookie = name + "=" + escape(value);
        }
        this.del = function(name) {
            document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT";
        }
    }

    var self = this;
    this.id = id;
    this.tree = new Array();
    this.cookie = new Cookie();
    this.id_openbox = "";
    this.init();
}
if (typeof String.prototype.trim == "undefined") {
    String.prototype.trim = function() {
    var s = this.replace(/^\s*/, "");
	    return s.replace(/\s*$/, "");
    }
}

function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   myfield.form.submit();
   return false;
   }
else
   return true;
}
function fixH(one,two) {
if (document.getElementById(one)) {
var lh=$(one).offsetHeight;
var rh=$(two).offsetHeight;
//var nh = Math.max(lh, rh);
var nh = lh;
//$(one).style.height=nh+"px";
$(two).style.height=nh+"px";
}
}

function review() {
if($('rew').style.display=='none')
{

$('rewcontent').innerHTML='';
$('rew').style.display='block';
$('text').style.display='none';
$('textfont').innerHTML='edycja &raquo;';
$('textfont1').style.display='none';
$('rewcontent').innerHTML=tinyMCE.getInstanceById('p_content').getContent();
}
else
{
$('rew').style.display='none';
$('textfont').innerHTML='podgląd odpowiedzi &raquo;';
$('textfont1').style.display='block';
$('text').style.display='block';
}
fixH('forum','forumright');
}

function showlogin(){
$('search').style.display='none';
$('login').style.display='block';
$('newsletter').style.display='none';
}
function showsearch(){
$('search').style.display='block';
$('login').style.display='none';
$('newsletter').style.display='none';

}
function shownewsletter(){
$('search').style.display='none';
$('login').style.display='none';
$('newsletter').style.display='block';

}

function showhide(id) {
if(document.getElementById(id).style.display=='none')
{
document.getElementById(id).style.display='block';
}
else
document.getElementById(id).style.display='none';
}



function openpopup(url)
{
	window.open(url,'popUpWindow','height=1000,width=1200,left=0,top=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}



function addtofavorite(adres,opis){
if (window.sidebar) { // Mozilla Firefox Bookmark
	window.sidebar.addPanel(opis, adres,"");
} else if( window.external ) { // IE Favorite
	window.external.AddFavorite( adres, opis); }
else if(window.opera && window.print) { // Opera Hotlist
	return true; }
}



function overmenu(obj){
obj.style.background='#d90008';
obj.firstChild.firstChild.src="/images/picka2.jpg";
obj.firstChild.style.color='#FFFFFF';
}

function outmenu(obj){
obj.style.background='#FFFFFF';
obj.firstChild.firstChild.src="/images/picka1.jpg";
obj.firstChild.style.color='#585858';
}

function delproduct(id)
{
	if($('productdiv'+id))
	{
		if($('productdiv'+id).disabled)
		{
			$('productdiv'+id).disabled=false;
			$('product'+id).style.border='1px solid red';
		}
		else
		{
			$('productdiv'+id).disabled=true;
			$('product'+id).style.border='0px';
		}
	}
}





function delproduct2(id)
{
	if(!$('productdiv'+id).disabled)
	{
		$('productdiv'+id).disabled=false;
		$('product'+id).style.border='0px';
	}
}

function button(obj){
obj.style.cursor='pointer';
}


function brief1(step1, step2, step3) 
{
$(step1).style.display='block';
$(step2).style.display='none';
$(step3).style.display='none';
}

function brief2(step1, step2, step3) 
{

$(step1).style.display='none';
$(step2).style.display='block';
$(step3).style.display='none';
}

function brief3(step1, step2, step3) 
{
$(step1).style.display='none';
$(step2).style.display='none';
$(step3).style.display='block';
}

function moveUP(jump)
{
	var Tslide = document.getElementById('all').offsetTop;
	var Height = (-1) * document.getElementById('all').offsetHeight;

	if(Tslide + jump <= 0)
	{
		var Tmove = Tslide + jump;
		document.getElementById('all').style.marginTop = Tmove+"px";
	}else{
		document.getElementById('all').style.marginTop = (Height + jump)+"px";
	}
	
	clearTimeout ( SlideID )
	StartSlide();
}

function moveDOWN(jump, state)
{
var parentHeight = document.getElementById('all').parentNode.offsetHeight;
var height = document.getElementById('all').offsetHeight;
var Tslide = document.getElementById('all').offsetTop;

	if(Tslide - jump >= parentHeight - height)
	{
		var Tmove = Tslide - jump;
		document.getElementById('all').style.marginTop = Tmove+"px";
	}else{
		document.getElementById('all').style.marginTop = "0px";
	}
		
	if(state == true)
	{
		StartSlide()
	}else{
		clearTimeout ( SlideID )
		StartSlide();
	}

}

function StartSlide()
{
	SlideID = setTimeout( "moveDOWN(240,true)", 6000 );
}


function lalala()
{
	alert('koniec');
}

function moveUPG(jump)
{
var Tslide = document.getElementById('GALERIA').offsetTop;

	if(Tslide + jump <= 0)
	{
		var Tmove = Tslide + jump;
		document.getElementById('GALERIA').style.marginTop = Tmove+"px";
	}
}


function moveDOWNG(jump)
{
var parentHeight = document.getElementById('GALERIA').parentNode.offsetHeight;
var height = document.getElementById('GALERIA').offsetHeight;
var Tslide = document.getElementById('GALERIA').offsetTop;

	if(Tslide - jump >= parentHeight - height - jump + 50)
	{
		var Tmove = Tslide - jump;
		document.getElementById('GALERIA').style.marginTop = Tmove+"px";
	}
}

function getName(s) 
{
	var d = s.lastIndexOf('.');
	return s.substring(s.lastIndexOf('/') + 1, d < 0 ? s.length : d);
}

function menuOver(obj)
{
	HideMenuItems();
	switch (obj.id)
	{
		case 'menu_1_out' :
			document.getElementById('menu_1_over').style.marginTop = '0px';
		break;
		case 'menu_2_out' :
			document.getElementById('menu_2_over').style.marginTop = '27px';
		break;
		case 'menu_3_out' :
			document.getElementById('menu_3_over').style.marginTop = '54px';
		break;
		case 'menu_4_out' :
			document.getElementById('menu_4_over').style.marginTop = '81px';
		break;
		case 'menu_5_out' :
			document.getElementById('menu_5_over').style.marginTop = '108px';
		break;
		case 'menu_6_out' :
			document.getElementById('menu_6_over').style.marginTop = '135px';
		break;
		case 'menu_7_out' :
			document.getElementById('menu_7_over').style.marginTop = '162px';
		break;
		case 'menu_8_out' :
			document.getElementById('menu_8_over').style.marginTop = '189px';
		break;
		case 'menu_9_out' :
			document.getElementById('menu_9_over').style.marginTop = '216px';
		break;
	}
}

function menuOut(obj)
{
	HideMenuItems();
}

function HideMenuItems()
{
	document.getElementById('menu_1_over').style.marginTop = '243px';
	document.getElementById('menu_2_over').style.marginTop = '243px';
	document.getElementById('menu_3_over').style.marginTop = '243px';
	document.getElementById('menu_4_over').style.marginTop = '243px';
	document.getElementById('menu_5_over').style.marginTop = '243px';
	document.getElementById('menu_6_over').style.marginTop = '243px';
	document.getElementById('menu_7_over').style.marginTop = '243px';
	document.getElementById('menu_8_over').style.marginTop = '243px';
	//document.getElementById('menu_9_over').style.marginTop = '243px';
}

function CloseCard()
{
	document.getElementById('kartka').style.display = 'none';
}


function moveupcategory(id){
	$('categorymove').value=id;
	$('moveaction').value='moveup';
	document.forms.formmovecategory.submit();
}

function movedowncategory(id){
	$('categorymove').value=id;	
	$('moveaction').value='movedown';
	document.forms.formmovecategory.submit();	
}

function showIdHideClass(idToShow, classToHide)
{
	if(classToHide != '')
	{
		jQuery("." + classToHide).css("display", "none");
	}
	jQuery("#" + idToShow).css("display", "block");
}

function searchDataCorrect()
{
	if(document.forms['search'].search.value.length < 3)
	{
		alert('Szukana fraza musi składać się z wiecej niż 2 znaków.');
	}
	else if(document.forms['search'].search.value.length > 100)
	{
		alert('Szukana fraza musi składać się z mniej niż 100 znaków.');
	}
	else
		document.forms.search.submit();
}

function getInternetExplorerVersion()
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion()
{
  var msg ='Aby móc poprawnie korzystać z serwisu sugerujemy uaktualnić przeglądarkę Internet Explorer do nowszej wersji';
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver >= 7.0 ) 
    ;
    else
    {
    	if(!Get_Cookie('ie'))
    	{
    	Set_Cookie('ie',1,4);
      alert(msg);
      var url="http://www.microsoft.com/downloadS/details.aspx?familyid=341C2AD5-8C3D-4347-8C03-08CDECD8852B&displaylang=pl"
      var newWindow = window.open(url, '_blank');
      newWindow.focus();
      }
    }
  }
}

function Set_Cookie( name, value, expires, path, domain, secure )
{

var today = new Date();
today.setTime( today.getTime() );

if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function Get_Cookie( check_name ) {

	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; 

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		a_temp_cookie = a_all_cookies[i].split( '=' );

		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		if ( cookie_name == check_name )
		{
			b_cookie_found = true;

			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}

function showHideCatMenu(val)
{
	if(val == 'g')
	{
		jQuery('#cat').show();
	}
	else
	{
		jQuery('#defaultSelect').attr('selected', 'selected');
		jQuery('#cat').hide();
	}
}

checkVersion();