//zjisteni IE prohlizece a dany do globalni promenne
var IE= null, IE8 = null, CHR = null; OPE = null;
var ua = navigator.appName.toLowerCase();
var uv = navigator.appVersion.toLowerCase();
if(ua.indexOf('explorer')>-1 ) {IE=true;}
if(ua.indexOf('opera')>-1 ) {OPE=true;}
if(uv.indexOf('msie 8')>-1 ) {IE8=true;}
if(uv.indexOf('chrome')>-1 ) {CHR=true;}
//----------------------------x = nazev prvku

//------hlidani zmeny---------------
var gnCh = 0;
function RunOnBeforeUnload(){
	if (gnCh == 1){window.event.returnValue = 'Pravděpodobně jste změnili data na této stránce. Aby změny vstoupily v platnost, musíte data uložit. Opačném případě se data neuloží.';}
}
//--------------------------------------
function RunPositionH1(){
	var objH1 = document.getElementsByTagName("h1")[0];
	if(objH1){
		if(document.body.offsetWidth > 980){
			objH1.style.left = (((document.body.offsetWidth-975)/2)+210).toString() + "px";
		}else{
			objH1.style.left = "210px";
		}
		objH1.style.display = 'block';
	}
}
//----search-------
function searchCon(sString){
	if(sString.length < 3){alert(JS07);return false;};
}
//----dym banner-------------------
function dynbann(){
	alert('...');
	var hBann = objGet('bannD').scrollHeight;
	var hBannDp = objGet('bannDp').scrollHeight;
	var x = -(hBann - hBannDp - 162);
	var finx;
	finx = x + 12;
	if(IE){finx = 224;}
	if(IE8){finx = x;}
	if(CHR){finx = x + 5;}
	if(OPE){finx = x + 2;}
	finx = finx.toString() + "px";
	objGet('bannDp').style.marginTop = finx;
	objGet('bannDp').style.visibility = "visible";
}
//--------------------------------------
function NonDiacritic(strText){
	
	var strDiak = "áäčďéěíĺľňóô öŕšťúů üýřžÁÄČĎÉĚÍĹĽŇÓÔ ÖŔŠŤÚŮ ÜÝŘŽ"; 
	var strNonDiak = "aacdeeillnoo orstuu uyrzAACDEEILLNOO ORSTUU UYRZ";
	var strResult = ""; 

	for(var i = 0; i < strText.length; i++){ 
		if (strDiak.indexOf(strText.charAt(i)) != -1){ 
			strResult += strNonDiak.charAt(strDiak.indexOf(strText.charAt(i))); 
		}else{
			strResult += strText.charAt(i); 
		}
	} 
	return strResult; 
} 

function objGet(x) {
	if (Boolean(document.getElementById)) return document.getElementById(x);
	else if (Boolean(document.all)) return eval('document.all.'+x);
	else if (Boolean(document.ids)) return eval('document.ids.'+x);
	else return null;
}
function getPos(e) { 
     var left = 0, top = 0; 
     while(e){ 
         left+=e.offsetLeft; 
         top+=e.offsetTop; 
         e=e.offsetParent; 
     } 
    return [left, top]; 
} 
function PaymentAction(bCard){
	if(bCard == true){
		objGet("CardYesNo").value = "1"
		objGet("TypeCardDiv").style.display = "block";
	}else{
		objGet("CardYesNo").value = "0"
		objGet("TypeCardDiv").style.display = "none";
	}
}
function OpenHref(strURL){
	var objWin = window.open(strURL,"Info","scrollbars=yes,resizable=yes,height=500px,width=650px,left=10px,top=10px");
	return (typeof(objWin)!="object")?true:false;
}
//----detail----
var objLM
function ShowLeftMenu(){
	objLM = objGet('leftMnHid').innerHTML;
	LoadRemote("/Execute/CategoryLeftGetDetail.asp?cat=0", "leftMnHid");
}
function HiddLeftMenu(){
	objGet('leftMnHid').innerHTML = objLM;
}
//bublina---------------
function bubb(intId,e,t,c,i){
	if(!t){t = 1};
    if(intId.length > 10){
        var strText = intId;
    }else{
    	if(t == 1){
        	objGet('bubbDiv').style.width = '200px';
			var strText = LoadRemote('/FilesForExecute/PublishArticle.asp?idArt=' + intId);
        }else if(t == 2){
        	objGet('bubbDiv').style.width = '200px';
        	var strText = LoadRemote('/FilesForExecute/NextItemDetail.asp?dpg=' + intId);
        }else if(t == 3){
        	objGet('bubbDiv').style.width = '400px';
        	var strText = LoadRemote('/FilesForExecute/PublishArticle.asp?idArt=61') + '<br />';
        	strText += LoadRemote('/FilesForExecute/MaterialGet.asp?dpg=' + intId + '&country=' + c);
        }else{
        	objGet('bubbDiv').style.width = '200px';
        	var strText = LoadRemote('/FilesForExecute/NextItemDetail.asp?dpg=' + intId);
        }
    }
	if (!e) var e = window.event; 
	var srcEl = e.srcElement? e.srcElement : e.target;
	
	if(i){srcEl = objGet(i)};

	objGet('bubbDiv').innerHTML = strText;
	objGet('bubbTab').style.display = 'block';
	if(IE){
		var y = getPos(srcEl)[1] - 30 - (objGet('b_6').offsetTop - objGet('b_1').offsetTop);
		var x = getPos(srcEl)[0] - 5;	
	}else{
		var y = srcEl.offsetTop - 30 - (objGet('b_6').offsetTop - objGet('b_1').offsetTop);
		var x = srcEl.offsetLeft - 5;
	}
//	if(t == 3){x = x + 60};
	y = y.toString() + "px"; 
	x = x.toString() + "px";

	objGet('bubbTab').style.top = y; 
	objGet('bubbTab').style.left = x;
}
function bubbOut(){
    objGet('bubbDiv').innerHTML = '';
    objGet('bubbTab').style.display = 'none';
}

//dialog------------------------------------------------------------------------
function DialogPublish(intId,intW){var strText = LoadRemote('/FilesForExecute/PublishArticle.asp?idArt=' + intId);Dialog(strText,intW);}
function Dialog(strText,intW){

	var y = 200 + document.documentElement.scrollTop;
	var x = (document.body.offsetWidth/2) - (intW/2);

	y = y.toString() + "px"
	x = x.toString() + "px"

	strText = '<div>' + strText + '</div><div class="tac"><input onclick="DialogClear();" id="buttFocus" type="button" value="OK" /></div>';

	intW = intW.toString() + 'px';

	objGet('messDiv').style.width = intW;
	objGet('messDiv').innerHTML = strText;
    objGet('messTab').style.top = y;
	objGet('messTab').style.left = x;
	objGet('messTab').style.display = 'block';
	if(objGet('buttFocus')){objGet('buttFocus').focus()};
}
function DialogClear(){
	objGet('messTab').style.display = 'none';
	objGet('messDiv').innerHTML = "";
	objGet('messDiv').style.width = "";
}
//next products-----------------------------------------------------------------
function ShowNextProducts(nId,nPage,sName){
	if(objGet(sName) != null){	
	    objGet(sName).innerHTML = "<div class='wait'><img src='/Img/ajax-loader-big.gif' alt='Waiting' /></div>";
		LoadRemote('/FilesForExecute/NextItemProducts.asp?item='+nId+'&page='+nPage+'', sName);
	}
}
//obrazek-----------------------------------------------------------------------
function ShowImg(strCo,strFl,intId,intType){
		if(!intType){
			LoadRemote('/FilesForExecute/ShowImage.asp?co='+strCo+'&fl='+strFl+'&dpg='+intId, 'messDiv');
		}else if(intType == 1){
			LoadRemote('/FilesForExecute/PresentDetail.asp?present='+intId, 'messDiv');
		}
		var x = (document.body.offsetWidth/2) - 230;
		var y = document.documentElement.scrollTop + 50;

		y = y.toString() + 'px';
		x = x.toString() + 'px';
	
		document.body.offsetWidth/2
		objGet('messTab').style.top = y;
		objGet('messTab').style.left = x;
		objGet('messTab').style.display = 'block';
}
function CloseMess(){
		objGet('messDiv').innerHTML = '';
		objGet('messTab').style.display = 'none';
}
//doprava a platby--------------------------------------------------------------
var ReWaitDel = 0
var ReWaitPay = 0
var intCelkem = 0
var intDarkSek = 0
var boolAura = 0
function Relation(){
	if(intDelActual > 0 && intPayActual > 0){
		var arrRel = strRelation.split("|");
		var arrSub;
		for(var i = 0; i < arrRel.length; i++){
			arrSub = arrRel[i].split(";")
			if(arrSub[1] == intPayActual && arrSub[2] == intDelActual){	
				document.OrderForm.DeliveryPayment.value = arrSub[0]
				objGet("DeliveryPriceCell").innerHTML = JS16 + ": " + arrSub[3] + "";
			}
		}
	}else{
		document.OrderForm.DeliveryPayment.value = "0";
	}
}
function HideBox(intType,intId){
	var strName;
	var strString;
	var arrItem;
	if(intType == 0){
		strName = "DelSub";
		strString = strDelCompl;
		objGet("InfoDelivery").style.display = "none";		
	}else{
		strName = "PaySub";
		strString = strPayCompl;
		objGet("InfoPayment").style.display = "none";		
	}
	arrItem = strString.split("|")
	for(var i = 0; i < arrItem.length; i++){
		if(arrItem[i] != intId){
			objGet(strName + arrItem[i].toString()).checked = false;
		}
	}
	if(objGet(strName + intId.toString()).checked == false){
		if(intType == 1){
			strName = "Del";
			strString = strDelCompl;
			intPayActual = 0;
		}else{
			strName = "Pay";
			strString = strPayCompl;
			intDelActual = 0;
		}
		arrItem = strString.split("|")
		for(var i = 0; i < arrItem.length; i++){
			if(arrItem[i] != intId){
				objGet(strName + arrItem[i].toString()).disabled = false;
				objGet(strName + 'Sub' + arrItem[i].toString()).disabled = false;
			}
		}
	}
}
function ShowPayDel(intId,intTyp,strName,bPaymentCard,bBank){
	var strSub;
	var arrCompl;
	var strTable = "";
	var strClear;
	if(intTyp == 0){
		intDelActual = intId;
		strClear = "DelSub";
	}else{
		intPayActual = intId;
		strClear = "PaySub";
		//objGet('PaySub'+intId).checked = true;
	}

	objGet("CardYesNo").value = "0";
	objGet("DeliveryPriceCell").innerHTML = "";
	if(strName.indexOf('Aura') == -1){
		objGet("TypeCardDiv").style.display = "none";
	}
	//objGet("DeliveryPriceCell").innerHTML = "";
	document.OrderForm.DeliveryPayment.value = "0";
	
	
	HideBox(intTyp,intId);
	if(objGet(strClear + intId.toString()).checked == true){

		//-------------------------
		if(bPaymentCard == 1){
				objGet("TypeCardDiv").style.display = "block";
				objGet("CardYesNo").value = "2";
				ClearCard();
			}else{
				if(boolAura == 0){objGet("TypeCardDiv").style.display = "none";}
				objGet("CardYesNo").value = "1";
			}
		//-------------------------
		if(intTyp == 0){
			arrCompl = strPayCompl.split("|");
			strSub = arrDel[intId];
		}else{
			arrCompl = strDelCompl.split("|");
			strSub = arrPay[intId];
		}
		strSub = '|' + strSub + '|'
		//-------------------------
		for(var i = 0; i < arrCompl.length; i++){
			if(strSub.indexOf('|' + arrCompl[i] + '|') >= 0){
				if(intTyp == 0){
					objGet("Pay" + arrCompl[i]).disabled = false;
					objGet("PaySub" + arrCompl[i]).disabled = false;
				}else{
					objGet("Del" + arrCompl[i]).disabled = false;
					objGet("DelSub" + arrCompl[i]).disabled = false;
				}
			}else{
				if(intTyp == 0){
					objGet("Pay" + arrCompl[i]).disabled = true;
					objGet("PaySub" + arrCompl[i]).disabled = true;
				}else{
					objGet("Del" + arrCompl[i]).disabled = true;
					objGet("DelSub" + arrCompl[i]).disabled = true;
				}
			}
		}
		if(intTyp == 0){
			if(intSpec == 0){
				objGet("InfoDelivery").innerHTML = strDelHead + '<div style="padding:10px;"">' + arrAltDel[intId] + '</div>';
				objGet("InfoDelivery").style.display = "block";
			}
		}else{
			objGet("InfoPayment").innerHTML = strPayHead + '<div style="padding:10px;"">' + arrAltPay[intId] + '</div>';
			objGet("InfoPayment").style.display = "block";			
		}
	}
	Relation();
}
function ClearCard(){
	objGet('SelectCard').innerText = "";
	objGet("idVISA").checked = false;
	objGet("idVisaElectron").checked = false;
	objGet("idMasterCard").checked = false;
	objGet("idMaestro").checked = false;
} 
//----------------------------------------
function Fly(){
	var x = 0;
	//x = returnLeft('topTable');
	//if(!IE){x = x - 285}
	//x = x.toString() + 'px';
	//objGet('BannerFly').style.left = x;
	//objGet('BannerFly').style.display = "";
	x = (document.body.offsetWidth / 2) + 340
	x = x.toString() + 'px';
	objGet('BannerFly').style.left = x;
	objGet('BannerFly').style.display = "";	
}
//---vrati top umisteni---------------------
function returnTop(strId){
	var y = 0;
	if(typeof objGet(strId) == 'object'){
		var objElem = objGet(strId);
		y = parseFloat(objElem.offsetHeight);
		while(typeof objElem == 'object' && objElem.tagName != 'BODY'){
			y += objElem.offsetTop;
			objElem = objElem.offsetParent;
		};
	}
	return y;
}
//---vrati left umisteni---------------------
function returnLeft(strId){
	var x = 0;
	if(typeof objGet(strId) == 'object'){
		var objElem = objGet(strId);
		x = parseFloat(objElem.offsetWidth);
		while(typeof objElem == 'object' && objElem.tagName != 'BODY'){
			x += objElem.offsetLeft;
			objElem = objElem.offsetParent;
		};
	}
	return x;
}
//------------------------------------------------------------------------------
function RegistrationForForum(){
	if(confirm("Přidávat příspěvky je povoleno pouze registrovaným uživatelům.\n-----------------------------------\nChcete se zaregistrovat?")){
		window.location.href="/UserData.asp"
		}
	}
function ShowLoginBox(){
	if(objGet("BoxLogin").className == "DispNo"){
		objGet("BoxLogin").className = "DispYes"
	}else{
		objGet("BoxLogin").className = "DispNo"
	}
}
function BlikFunction() { 
  BlikOk=true; 
  if (BlikCount==0 && BlikOk==true){
    BlikObj.style.visibility="hidden";
	BlikOk=false;
	BlikCount=1;
  } 
  if (BlikCount==1 && BlikOk==true){
    BlikObj.style.visibility="visible";
	BlikOk=false;
	BlikCount=0;
  } 
  setTimeout('BlikFunction()',300); 
}
function ShowDate(strItem) {
     var strReturn = showModalDialog("/SelectDate.htm","","status:no; center:yes; help:no; minimize:no;dialogWidth=250pt;dialogHeight=200pt");
     if (strReturn == undefined){return;}
     strItem.value = strReturn;
}
function onAction(imgName){
       document [imgName].src = eval(imgName + "on.src")
  }

function offAction(imgName){
        if (oldImgName.substring(0,4)!=imgName.substring(0,4)){
              document [imgName].src = eval(imgName + "off.src")
            }
  }

function OpenWnd(strURL,h,w){
	if(!h)h = 500;
	if(!w)w = 650;
	var objWnd = window.open(strURL,"InfoDetail","directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,height="+h+",width="+w+",left=10,top=10");
	objWnd.focus();
}
function AddBuy(strName, intPrice, intDph, strCode) {
        var strData,strReturn
        strData = strName+"&"+intPrice+"&"+intDph+"&"+strCode
        strReturn = showModalDialog("/AddUpdBuy.asp",strData,"status:no; center:yes; help:no; minimize:no;dialogWidth=350pt;dialogHeight=200pt");
        if (strReturn == "1"){ActionCookies('BZbuy')
        }else if (strReturn == "2"){window.location.href="/order.asp"}
}
function AddBuyDetail(strName, intPrice, intDph, strCode) {
        var strData,strReturn
        strData = strName+"&"+intPrice+"&"+intDph+"&"+strCode
        strReturn = showModalDialog("/AddUpdBuy.asp",strData,"status:no; center:yes; help:no; minimize:no;dialogWidth=350pt;dialogHeight=200pt");
        if (strReturn == "1"){
                        window.opener.ActionCookies('BZbuy')
        }else if (strReturn == "2"){
                        window.opener.location.href="/order.asp";
                        window.close();
                }
}
function ActionCookies(strName){
        var strString,strSum1,strSum2,intSuma;
        strSum2 = new Array();
        intSuma = 0;

        strString = ExtractCookies(strName);
        if (strString > ""){
                strSum1 = strString.split("#");
                for (var i=0; i< strSum1.length-1; i++){
                              strSum2[i] = strSum1[i].split("&");
                        intSuma += BarterComma(strSum2[i][1])*BarterComma(strSum2[i][4]);
                }
                document.all.CompletPrice.value =  FormatNumber(intSuma);
        }
}

function DeleteCookies(strName){
        var vyprs=new Date();
        vyprs.setDate(vyprs.getDate() - 365);
        document.cookie=strName+"=; expires="+vyprs.toGMTString()+";";
        vyprs.setDate(365 + 365 + vyprs.getDate());
        document.cookie=strName+"=; expires="+vyprs.toGMTString()+";";
        document.all.CompletPrice.value = "0.00";
}
function InsTreeCook(intId,idTree){
        var vyprs=new Date();
        vyprs.setDate(vyprs.getDate() - 365);
        document.cookie="category"+idTree+"="+intId+"; expires="+vyprs.toGMTString()+";";
        vyprs.setDate(365 + 365 + vyprs.getDate());
        document.cookie="category"+idTree+"="+intId+"; expires="+vyprs.toGMTString()+";";
}
function InsertCookies(strName,strData){
        var vyprs=new Date();
        vyprs.setDate(vyprs.getDate() - 365);
        document.cookie=strName+"="+strData+"; expires="+vyprs.toGMTString()+";";
        vyprs.setDate(365 + 365 + vyprs.getDate());
        document.cookie=strName+"="+strData+"; expires="+vyprs.toGMTString()+";";
}
function ExtractCookies(strName){
        var cookieList=document.cookie.split("; ");
        var cookieArray = new Array();
        var name = "#"
        for (var i=0; i < cookieList.length; i++){
                if(cookieList[i].indexOf(strName)>-1){
                      if( cookieList[i].indexOf("=")>-1){name = cookieList[i].split("=");}
                 }
        }
        if (name != "#"){
                        return name[1];
        }else{
                        return "none";
        }
}

function ParseCookies(strName){
        var strCook = ExtractCookies(strName)
        if (strCook != "none"){
                var strList = strCook.split("a");
                for (var i=0; i < strList.length-1; i++){
                  if(typeof(document.all[strList[i]+'a']) == "object"){document.all[strList[i]+'a'].click();}
                }
     }
}
function FormatNumber(text){
        var mezi = BarterComma(text);
        mezi = ''+Math.round(parseFloat(mezi) * 100);
        var desetiny = mezi.substring(mezi.length-2, mezi.length);
        var cele = mezi.substring(0,mezi.length-2);
        if (parseFloat(mezi) < 1){
                var mezi = "0."+desetiny;
        }else{
                var mezi = cele+"."+desetiny;
        }
        return mezi;
}
function BarterComma(text){
        var mezi = ''+text;
        if (mezi.indexOf(',') != -1){
                mezi = mezi.split(",");
                mezi = mezi[0]+"."+mezi[1];
        }else{
                mezi = text;
        }
        return parseFloat(mezi);
}
function ControlNumber(){
//bylo <48
     if ((event.keyCode <45) || (event.keyCode >57)) event.returnValue = false;
}
//----------info okno-------------------------------------------------------
function InfoWindow(strAddress) {
       showModalDialog(strAddress,"Info","status:no; center:yes; help:no; minimize:no;dialogWidth=450pt;dialogHeight=320pt");
}
function WriteDate(){
    var strDay=new Date();
    var d=strDay.getDay();
    if (d==1) {document.writeln('pondělí') }
    else { if (d==2) {document.writeln('úterý') }
    else { if (d==3) {document.writeln('středa') }
    else { if (d==4) {document.writeln('čtvrtek') }
    else { if (d==5) {document.writeln('pátek') }
    else { if (d==6) {document.writeln('sobota') }
    else { if (d==0) {document.writeln('neděle') }}}}}}};
    document.writeln(strDay.getDate(),'.',strDay.getMonth()+1,'.',strDay.getFullYear());
    }
function EmailControl(f){
    if ((f=='' || f=='vas@email.cz') ||(f.indexOf('@') < 1 || f.indexOf('@') != f.lastIndexOf('@') || f.lastIndexOf('.') < f.lastIndexOf('@')+2  || f.lastIndexOf('.') > (f.length-3) || f.lastIndexOf('.') < (f.length-4))){
       alert(JS15);
       return false;
       }
    return true;
}
function ShowSearchMenu(x){
    if (x == 1){
        document.all.SearchTable.style.display='';
    }else{
        document.all.SearchTable.style.display='none';
    }
}
function LocInfo(){
    document.all.StateInfo2.innerHTML="  probíhá připojování...";
    var e = event.srcElement;
    var y = 0;
    var x = 0;
    while (typeof e == 'object' && e.tagName != 'BODY'){
          y += e.offsetTop;
          e = e.offsetParent;
    };
    x = (window.screen.width/2)+375
    document.all.StateInfo1.style.top=y-140;
    document.all.StateInfo1.style.left=x;
}

function PositionInfo(strText){
    document.all.StateInfo3.innerHTML=strText;
    document.all.StateInfo2.innerHTML="  probíhá připojování...";
    var e = event.srcElement;
    var y = 0;
    var x = event.clientX;
    while (typeof e == 'object' && e.tagName != 'BODY'){
          y += e.offsetTop;
          e = e.offsetParent;
    };
    document.all.StateInfo1.style.top=y-140;
    if (document.body.clientWidth < 933){
      document.all.StateInfo1.style.left=x-175;
    }else{
      document.all.StateInfo1.style.left=780;
    }
}
function LocState(strCode,intCount){
    window.parent.frames['WinStat'].location.href="/InfoState.asp?ID="+strCode+"&CN="+intCount
    PositionInfo("On-line stav");
}
function ChangeStorage(bState){
    if(bState){
        for(var i = 0; i < document.all['S'].length; i++){
            document.all['S'][i].value="0"
        }
    }else{
        for(var i = 0; i < document.all['S'].length; i++){
            document.all['S'][i].value="-1"
        }

    }
}
function ChangeCloseout(bState){
    if(bState){
        for(var i = 0; i < document.all['C'].length; i++){
            document.all['C'][i].value="1"
        }
    }else{
        for(var i = 0; i < document.all['C'].length; i++){
            document.all['C'][i].value="3"
        }

    }
}

function ControlUserDataSubmit(){
  if(document.UserDataForm.FirstName.value == "" || document.UserDataForm.LastName.value == ""){alert(R14);return false}
  if(document.UserDataForm.Street.value == ""){alert(R15);return false}
  if(document.UserDataForm.City.value == ""){alert(R16);return false}
  if(document.UserDataForm.ZipCode.value == ""){alert(R17);return false}
  if(document.UserDataForm.Phone.value == ""){alert(R18);return false}
  if(document.UserDataForm.Email.value == ""){alert(R19);return false}
  if(document.UserDataForm.Login.value == ""){alert(R20);return false}
  if(document.UserDataForm.Login.value.length < 4){alert(JS13);return false}
  if(document.UserDataForm.Password.value == ""){alert(R21);return false}
  if(document.UserDataForm.Password.value.length < 4){alert(JS14);return false}
  return true
}
function ControlDataOrder(){
  if(document.OrderForm.PriceSum.value == "0"){alert("Vaše objednávka má nulovou hodnotu.");return false}
  if(document.OrderForm.FirstName.value == "" || document.OrderForm.LastName.value == ""){alert(JS01);return false}
  if(document.OrderForm.Street.value == ""){alert(JS03);return false}
  if(document.OrderForm.HouseNo.value == ""){alert(JS04);return false}
  if(document.OrderForm.City.value == ""){alert(JS05);return false}
  if(document.OrderForm.ZipCode.value == ""){alert("Vyplňte PSČ.");return false}
  if(document.OrderForm.Phone.value == ""){alert(JS06);return false}
  if(document.OrderForm.Email.value == ""){alert("Vyplňte email.");return false}
  if(document.OrderForm.PriceSum.value == "0"){alert("Vaše objednávka má nulovou hodnotu.");return false}
  if(document.OrderForm.DeliveryType.value == "-"){alert("Vyberte způsob dopravy.");return false}
 // if(document.OrderForm.Research.value == ""){alert("Vyberte prosím, co Vás přivedlo na naše stránky.");return false}
  return true
}
function ControlDataOrder2(){
	if(document.OrderForm.PriceSum.value == "0"){alert(JS08);return false}
	if(document.OrderForm.FirstName.value == "" || document.OrderForm.LastName.value == ""){alert(JS01);return false}
	if(document.OrderForm.Street.value == ""){alert(JS03);return false}
	if(document.OrderForm.HouseNo.value == ""){alert(JS04);return false}
	if(document.OrderForm.City.value == ""){alert(JS05);return false}
	if(document.OrderForm.ZipCode.value == ""){alert(JS09);return false}
	if(document.OrderForm.Phone.value == ""){alert(JS06);return false}
	if(document.OrderForm.Email.value == ""){alert(JS10);return false}
	if(document.OrderForm.DeliveryType.value == "-"){alert(JS11);return false}
	if(intControlPay == 0){alert(JS02);return false}
//	if(document.OrderForm.Research.value == ""){alert("Vyberte prosím, co Vás přivedlo na naše stránky.");return false}
  return true
}
function ControlPassword(NameOne,NameTwo){
  if (document.all[NameOne].value != document.all[NameTwo].value){
  alert(JS12);
  document.all[NameOne].value = "";
  document.all[NameTwo].value = "";
  document.all[NameOne].focus();
  return false;
  }else{
  return true;
  }
}

function goToCase()
{
	window.location.href="/Order.asp?OrdSub=ok"	    
}


function AdvertisingOpen(){
     var msg = window.open("PopUpAdvertising.asp","Reklama","scrollbars=yes,height=200,width=350,left=10,top=10");
     msg.focus()
}
//zahlasovani ankety funguje pod netscapem(4.7+) mozilou(1.3) ie....
function VoteInquiry(plngAns){
	document.forms.frmInq.InqAns.value = plngAns;
	document.forms.frmInq.submit();
}
function NoSpace(){
     if (event.keyCode == 32) event.returnValue = false;
}
function DelSpace(strId){
	var Temp = objGet(strId).value
	for(var i = 0; i < Temp.length; i++){
		if(Temp.indexOf(' ') > 0){Temp = Temp.replace(' ','')}
	}
	objGet(strId).value = Temp
}
function ControlScript(strScript,strValue,strId){
	if(strValue.length > 0){
		window.frames['WinStat'].location.href='/'+strScript+'.asp?value='+strValue+'&amp;id='+strId;
	}
}
function BookmarksClick(e){
	if (!e) var e = window.event;
	var srcEl = e.srcElement? e.srcElement : e.target;	
	if(srcEl.tagName == 'SPAN'){srcEl = srcEl.parentNode};
	var parEl = srcEl.parentNode;
	var iCount;
	var i;
	for(i = 0; i < parEl.childNodes.length; i++ ){
		if(parEl.childNodes[i] == srcEl){iCount = i};
		if(parEl.childNodes[i].className == 'bookActive'){parEl.childNodes[i].className = ''};
	}
	parEl.childNodes[iCount].className = "bookActive";
	parEl = parEl.parentNode;
	for(i = 0; i < parEl.childNodes.length; i++ ){
		if(parEl.childNodes[i].className == 'bookActive'){parEl.childNodes[i].className = ''};
	}
	if(IE){
		iCount = iCount + 2;
	}else{
		iCount = iCount + 3;
	}
	parEl.childNodes[iCount].className = "bookActive";
}
function ControlInt(intParam, strText){
	if(intParam > 0 ){
		return true;
	}else{
		if(window.confirm(strText)){
			return true;
		}else{
			return false;		
		}
	}
}
function WholeSaleCheck(bAction){
	if(bAction){
		objGet('trWholeSale').style.visibility = 'visible';
		objGet('trWholeSale_2').style.visibility = 'visible';
	}else{
		objGet('trWholeSale').style.visibility = 'hidden';
		objGet('trWholeSale_2').style.visibility = 'hidden';
	}
}
function ConSubReg(e){
	for(var i = 0; i < e.length; i++){
		if(e[i].className == "w200 inputText RedBG"){e[i].className = "w200 inputText"}
	}
	var bRet = true; 
	var sMess = ''; 
	if(e['WholeSale'].checked){
		sMess += ConSubReg_inc(e,'Firm',"Vyplňte název firmy.");
		sMess += ConSubReg_inc(e,'Login',"Vyplňte přihlašovací jméno.");
		sMess += ConSubReg_inc(e,'Password',"Vyplňte heslo.");
	}else{
		sMess += ConSubReg_inc(e,'FirstName',"Vyplňte jméno.");
		sMess += ConSubReg_inc(e,'LastName',"Vyplňte příjmení.");
	}
	sMess += ConSubReg_inc(e,'Street',"Vyplňte ulici.");
	sMess += ConSubReg_inc(e,'City',"Vyplňte město.");
	sMess += ConSubReg_inc(e,'ZipCode',"Vyplňte PSČ.");
	sMess += ConSubReg_inc(e,'Phone',"Vyplňte telefon.");
	sMess += ConSubReg_inc(e,'Email',"Vyplňte email.");
	if(e['WholeSale'].checked){
		sMess += ConSubReg_inc(e,'IC',"Vyplňte IČ.");
	}
	if(sMess.length > 0){
		bRet = false;
		alert(sMess);	
		}
	return bRet;
}
function ConSubReg_inc(e,sName,sMess){
	if(e[sName].value == ""){
		e[sName].className = "w200 inputText RedBG";	
		e[sName].focus();	
		return sMess + '\n';
	}else{
		return '';
	}
}
