<!--
function widok_3(pole)
	{
		var activeTab;
                activeTab = document.getElementById('actTab').value;

               // return alert(pole);

                document.getElementById(activeTab).style.display = 'none';
                document.getElementById(pole).style.display='block';

                document.getElementById('P' + activeTab).className = 'unactiveTab';
                document.getElementById('P' + pole).className = 'activeTab';
                document.getElementById('actTab').value = pole;


	 }

 function replacePrice()
	{
            var str=document.getElementById("cprd_cena").value;
            str.replace(/Microsoft/, "W3Schools")

		if (str.search(/,/)!=-1)
		{
			document.getElementById("cprd_cena").value=str.replace(/,/, ".");
	 	}else if (str.indexOf(".")==-1)
		{
			document.getElementById("cprd_cena").value=str.concat('.00');                        
	 	}
	 }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}



function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}

function displayWindow3(url, width, height) {
        var Win = window.open(url,"displayWindow3",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no' );
}

function displayWindow2(url, width, height) {
        var Win2 = window.open(url,"displayWindow2",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no' );
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function Img(div,img){

                document.getElementById(div).src='system/application/views/site/img/' + img;
}

 function widok (pole,id)
	{
		if (pole == '1')
		{
			document.getElementById(id).style.borderColor='#dd7307';
	 	}
	 	else
	 	{
	 		document.getElementById(id).style.borderColor='#caae7c';
		}
	 }

function increaseBasket(id,ord){
			var itemCount = $(':text[rel='+id+']').val();
			itemCount = itemCount*1;
			if(ord > 0){
				var newCount = (itemCount+1)*1;
			} else {
				var newCount = (itemCount-1)*1;
			}
			if(newCount > 0 && newCount < 100){
				InsertInbascet(id,newCount);
				$(':text[rel='+id+']').val(newCount);
			}
		}

   function InsertInbascet(ItemID,count){

			if(count != '' || count > 0){
				if(count > 0 && count < 100){


                                /*   $.get("index.php/cart/calc/"+ItemID+"/"+count,
                                    {},
                                      function(returned_data)
                                    {
                                            $("#Basket").html(+returned_data);
                                    });*/


                                     $("#Basket").load("index.php/cart/calc/"+ItemID+"/"+count, function()
                                    {
                                        $("#Basket").find('a');

                                    });


                                /*    $.get("index.php/cart/calc_total/",
                                    {},

                                    function(returned_data)
                                    {
                                            $("#cartTotall ").html("Total: &pound;"+returned_data);
                                    });*/






					/*var data = jQuery.ajax({type: "POST",async: false,url: "/ajax.php",data: "ResetShop="+ItemID+"&count="+count+"&varData="+varData}).responseText;
					if(data != 'err'){
						expData = data.split('-');
						$(".basketWrap strong").html("EUR "+expData[1]+" ("+expData[0]+")");
						if(varData == 1){
							$("#total"+ItemID).html(expData[2]+" EUR ");
							$("#cartTotall span").html(expData[1]);
						}
						LoadPopup();
						//alert('Prece pievienota grozam');
					}*/
				} else {
					alert('We are sorry to inform you that the entered quantity of products is not available. Please indicate a smaller amount of products. In case of difficulties please contact the Stenders team (shop@stenders.lv)');
				}
			}
		}

            function increaseBasket2(ItemID){
			var itemCount = $(':text[rel='+ItemID+']').val();
			itemCount = itemCount*1;
			var newCount = (itemCount)*1;

			if(newCount > 0 && newCount < 100){

                                if(newCount != '' || newCount > 0){
				if(newCount > 0 && newCount < 100){


                                 $("#Basket").load("index.php/cart/calc/"+ItemID+"/"+newCount, function()
                                    {
                                        $("#Basket").find('a');

                                    });


                             /*      $.get("index.php/cart/calc/"+ItemID+"/"+newCount,
                                    {},
                                      function(returned_data)
                                    {
                                            $("#total"+ItemID).html("&pound;"+returned_data);
                                    });

                                    $.get("index.php/cart/calc_total/",
                                    {},

                                    function(returned_data)
                                    {
                                            $("#cartTotall ").html("Total: &pound;"+returned_data);
                                    });*/

				//$(':text[rel='+id+']').val(newCount);
			}
		}
                        }
            }



           function DeleFromCart(ItemID){
                                    $.get("index.php/cart/delete/"+ItemID,
                                    {},
                                    function(returned_data)
                                    {
                                            $("#Basket").html(returned_data);
                                    });

                                   

		}

        function DeleFromCart2(ItemID){
                                    $.get("index.php/cart/delete2/"+ItemID,
                                    {},
                                    function(returned_data)
                                    {
                                            $("#Basket").html(returned_data);
                                    });



		}

        function widok_2 (pole,pole2)
	{
		if (document.getElementById(pole2).checked)
		{
			document.getElementById(pole).style.display='block';
	 	}
	 	else
	 	{
	 		document.getElementById(pole).style.display='none';
		}
	 }
-->
