
/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 *
 * @return  boolean  whether pointer is set or not
 */

function setPointer(theRow, thePointerColor)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
        return false;
    }

    var row_cells_cnt           = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++) {
        theRow.cells[c].bgColor = thePointerColor;
    }

    return true;
} // end of the 'setPointer()' function

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_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 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];}
}





/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var documentroot="http://www.sysnet.sk/site"
var menu1=new Array()
menu1[0]='<a href="'+documentroot+'/stolne-pocitace/6/48/submenu/">- počítače</a>'
menu1[1]='<a href="'+documentroot+'/graficke-stanice/6/49/submenu/">- grafické stanice</a>'
menu1[2]='<a href="'+documentroot+'/notebooky/6/50/submenu/">- notebooky</a>'
menu1[3]='<a href="'+documentroot+'/prislusenstvo-notebooky/6/55/submenu/">- prísluš. k notebookom</a>'
menu1[4]='<a href="'+documentroot+'/organizery-pda/6/159/submenu/">- PDA</a>'
menu1[5]='<a href="'+documentroot+'/prislusenstvo-pda/6/52/submenu/">- príslušenstvo k PDA</a>'

var menu2=new Array()
menu2[0]='<a href="'+documentroot+'/akcia/">- aktuálne</a>'

var menu3=new Array()
menu3[0]='<a href="'+documentroot+'/fotoaparaty-digitalne/11/156/submenu/">- digitálne fotoaparáty</a>'
menu3[1]='<a href="'+documentroot+'/prislusenstvo-digifoto/11/143/submenu/">- príslušenstvo</a>'



var menu4=new Array()
menu4[0]='<a href="'+documentroot+'/servis/">- cenník servisu</a>'
menu4[1]='<a href="'+documentroot+'/zmluvny-servis/">- zmluvný servis</a>'

var menu5=new Array()
menu5[0]='<a href="'+documentroot+'/obchodne-podmienky/">- obchodné podmienky</a>'
menu5[1]='<a href="'+documentroot+'/sposob-nakupu/">- spôsob nakupovania</a>'
menu5[2]='<a href="'+documentroot+'/reklamacie/">- reklamácie</a>'
menu5[3]='<a href="'+documentroot+'/nakup-na-splatky/">- nákup na splátky</a>'


var menuwidth='130px' //default menu width
var menubgcolor='#93A9BF;'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu




function winopen(urlx,namex,hx,wx)
{
        window.open(urlx,namex,'statusbar,resizable,HEIGHT='+hx+',WIDTH='+wx);
}


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_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 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];}
}




/*    ----------------------- new registration java script ----------------- */
	function submitFormReg() {
	        if (isFormValid()) {
	                document.frmReg.submit();
	        }
	}

	function isFormValid(){
	        if (isFormFieldBlank('frmReg', 'meno')) {
	                alert("Prosím vyplňte meno");
	                document.frmReg.meno.focus();
	                return false;
	        }

        if (isFormFieldBlank('frmReg', 'priezvisko')) {
                alert("Prosím vyplňte priezvisko");
                document.frmReg.priezvisko.focus();
                return false;
        }
        if (isFormFieldBlank('frmReg', 'ulica')) {
                alert("Prosím vyplňte ulicu");
                document.frmReg.ulica.focus();
                return false;
        }
        if (isFormFieldBlank('frmReg', 'psc')) {
                alert("Prosím vyplňte psČ");
                document.frmReg.psc.focus();
                return false;
        }
        
         if (ifMaxLenght('frmReg', 'psc')) {
                alert("Pložka psč musí mať 5 znakov");
                document.frmReg.psc.focus();
                return false;
        }

        if (isFormFieldBlank('frmReg', 'sidlo')) {
                alert("Prosím vyplňte sidlo");
                document.frmReg.sidlo.focus();
                return false;
        }
        if (isFormFieldBlank('frmReg', 'telefon')) {
                alert("Prosím vyplňte telefon");
                document.frmReg.telefon.focus();
                return false;
        }
        if (isFormFieldBlank('frmReg', 'email')) {
                alert("Prosím vyplňte email");
                document.frmReg.email.focus();
                return false;
        }
          if (isFormFieldBlank('frmReg', 'setlogin')) {
                alert("Prosím vyplňte prihlasovacie meno");
                document.frmReg.setlogin.focus();
                return false;
        }
        
          if (isFormFieldBlank('frmReg', 'setpassword')) {
                alert("Prosím vyplňte prihlasovacie heslo");
                document.frmReg.setpassword.focus();
                return false;
        }
        
         if (isFormFieldBlank('frmReg', 'setrepeatpassword')) {
                alert("Prosím zopakujte prihlasovacie heslo");
                document.frmReg.setrepeatpassword.focus();
                return false;
        }
        
        if (comparepass('inFormName', 'pass1', 'pass2')) {
                alert("Zadané heslá sa nezhodujú");
                document.frmReg.setrepeatpassword.focus();
                return false;
        }

        return true;
}





function comparepass(inFormName, inpass1, inpass2)
{
	var sVal = document.forms.frmReg.setpassword.value;
	var ssVal = document.forms.frmReg.setrepeatpassword.value;
	if (sVal != ssVal)
	{
	  return true;
	}
	  return false;
}

function ifMaxLenght(inFormName, inInputName)
{
	var sVal = document.forms[inFormName].elements[inInputName].value.length;
	var maxVal = 5;
	if (sVal == maxVal)
	{
		return false;
	}
		return true;
}

function isFormFieldBlank(inFormName, inInputName){
        var sVal = document.forms[inFormName].elements[inInputName].value;
        var bRetVal = true;

        // MKE SURE THAT SOME THING WAS ENTERED BESIDE JUST SPACE CHARACTERS
        for (i = 0; i < sVal.length; i++) {
                if (sVal.charAt(i) != ' ' )
                {
                 if (sVal.charAt(i) != '@' )
                  {
                        bRetVal = false
                  }
                }
        }
        return bRetVal
}



function submitForm2() {
        if (isFormValid2()) {
                document.frmFind.submit();
        }
}

function isFormValid2(){


        if (isFormFieldBlank('frmFind', 'tel')) {
           if (isFormFieldBlank('frmFind', 'from')) {
                 alert("Prosím vyplňte telefónne číslo alebo emailovú adresu");
                document.frmFind.tel.focus();
              } else
              {return true}
        }
        else
        {return true};
}



//==================================== rolover text nad otaznikom =====

//zjisteni IE prohlizece a dany do globalni promenne
var IE= null;
var ua = navigator.appName.toLowerCase();
if(ua.indexOf('explorer')>-1 ) {IE=true;}
var objItem;
//pozice posledniho kliku----------------------------
var oClientX = 0;
var oClientY = 0;
//------hlidani zmeny---------------
var gnCh = 0;



 function ShowTitle(idText,strCount){
 	 
    var text = new Array();
    var text1	= 'Uvedené číslo pri skladových množstvách znamená, v prevažnej väčšine naše<br> skladové zásoby v externom sklade. Tento tovar vieme dodat do 24 hodín od<br> objednania (viď obchodné podmienky). Niektoré produkty držime skladom aj<br> na našej prevádzke v Bratislave. O presných termínoch dodania a doručenia<br> sa informujte, buď pomocou kontaktného formulára uvedeného nižšie, alebo<br> mailom, faxom, pripadne telefonicky';
    var text2	= 'Produktové  číslo je jedinečné označenie každého tovaru, slúži na presnú<br> identifikáciu druhu a modelu, ak máte záujem o akýkoľvek tovar, alebo<br> o informáciu o konkrétnom produkte, uvedte prosím aj jeho produktové číslo.'
    var text3	= 'Ak máte záujem o zaslanie notebooku do Českej republiky, stačí si vyplniť objednávku, <br>vybrať spôsob prepravy kuriérom a spôsob platby dobierka, do poznámky treba uviesť<br> „Dodať do ČR“ a potvrdiť objednávku, cena prepravy bude upravená po jej potvrdení.<br>'
    text[1] = text1;
    text[2] = text2;
    text[3] = text3;
	if(strCount.length > 0){strCount = strCount + " "}
       document.getElementById('showElem').innerHTML = text[idText];
       document.getElementById('showElem').style.visibility = "visible";
       
    }
    
    
    
 function HideTitle(){
     document.getElementById('showElem').style.visibility = "hidden";
    }



 function getMouse(e){
	var x;
	var y;

	if (navigator.appName=="Microsoft Internet Explorer" || navigator.appName=="Opera"){
	    x = window.event.x+9;
		y = window.event.y+20;
    }
	if (navigator.appName=="Netscape"){
		x = e.screenX+11;
		y = e.screenY-115;
    }


    x =  x + document.documentElement.scrollLeft;
    y =  y + document.documentElement.scrollTop;

    x = x.toString() + "px"
    y = y.toString() + "px"

	document.getElementById('showElem').style.left = x;
    document.getElementById('showElem').style.top  = y;
}
    
function winopen(urlx,namex,hx,wx)
{        window.open(urlx,namex,'statusbar,resizable,scrollbars,HEIGHT='+hx+',WIDTH='+wx);        
}



//vyhladavacia lista, najmenej 3znaky, nepouzite

function submitFindForm() {
	        if (isFormFindField()) {
	                document.findform.submit();
	        }
	}
function isFormFindField(){
		
		var sVal = document.forms['findform'].elements['q'].value;
	
		if (sVal.length<3){
			alert('Do vyhľadávania zadajte najmenej 3 znaky');
			return false;
		}
		return true;
}

