function toggleSub(koji,boja){
	koji.style.background = boja;
}

function toggleHelp(which){
	which = document.getElementById(which);
	if (which.style.display == 'none'){
		which.style.display = 'block';
		} else {
		which.style.display = 'none';
		}
}

function toggleStep(step){
	maxstep = document.stepsform.stepsnum.value;
	for (i=1; i<=maxstep; i+=1) {
		selectedlayer = document.getElementById(i);
		if (i == step) {
			selectedlayer.style.display = 'block';
			bolder = document.getElementById(i*100);
			bolder.style.fontWeight = 'bold';
		}
		else {
			selectedlayer.style.display = 'none';
			bolder = document.getElementById(i*100);
			bolder.style.fontWeight = 'normal';
		}
	}
}

function layerShowHide(toshow,tohide){
	layerstoshow = toshow.split(',');
	for (i=0; i<layerstoshow.length; i+=1)
	{
		if (selectedlayer = document.getElementById(layerstoshow[i]))
		{
			selectedlayer.style.display = 'block';
		}
	}
	layerstohide = tohide.split(',');
	for (i=0; i<layerstohide.length; i+=1)
	{
		if (selectedlayer = document.getElementById(layerstohide[i]))
		{
			selectedlayer.style.display = 'none';
		}
	}
}

function toggleVisibility(vis,hid) {
	layerstoshow = vis.split(',');
	for (i=0; i<layerstoshow.length; i+=1)
	{
		if (selectedlayer = document.getElementById(layerstoshow[i]))
		{
			selectedlayer.style.visibility = 'visible';
		}
	}
	layerstohide = hid.split(',');
	for (i=0; i<layerstohide.length; i+=1)
	{
		if (selectedlayer = document.getElementById(layerstohide[i]))
		{
			selectedlayer.style.visibility = 'hidden';
		}
	}
}

var myimages=new Array()
function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
		myimages[i]=new Image()
		myimages[i].src=preloadimages.arguments[i]
	}
}

function goesto( menuform ){
   	selecteditem = menuform.urljumper.selectedIndex ;
 	newurl = menuform.urljumper.options[ selecteditem ].value ;
	if (newurl.length != 0) {
		location.href = newurl ;
	}
}

function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
	else countfield.value = maxlimit - field.value.length;
}

function povecaj(ELEMENTID, PICNAME, PICEXTENSION, OBBIGWIDTH, OBSMALLWIDTH, PICID, MAGNID) {

	ob = document.getElementById(ELEMENTID);
	inpic = document.getElementById(PICID);
	magnif = document.getElementById(MAGNID);
	ob.style.height = inpic.style.height;
	

	if (ob.style.width == OBSMALLWIDTH + 'px') { 
		
		ob.style.width = OBBIGWIDTH + 'px';
		magnif.innerHTML = '<div style="position: relative; left: 0px; top: 0px; background: url(http://img.moj-posao.net/images/content_images/imgswap/magniback.gif); background-repeat: no-repeat;"><img src="http://img.moj-posao.net/images/content_images/imgswap/magniminus.gif"></div>'
		inpic.innerHTML = '<img src="' + 'http://img.moj-posao.net/images/content_images/imgswap/' + PICNAME + '.' + PICEXTENSION + '" />';

	} else { 
		
		ob.style.width = OBSMALLWIDTH + 'px';
		magnif.innerHTML = '<div style="position: relative; left: 0px; top: 0px; background: url(http://img.moj-posao.net/images/content_images/imgswap/magniback.gif); background-repeat: no-repeat;"><img src="http://img.moj-posao.net/images/content_images/imgswap/magniplus.gif"></div>'
		inpic.innerHTML = '<img src="' + 'http://img.moj-posao.net/images/content_images/imgswap/' + PICNAME + '_thumb.' + PICEXTENSION + '" />'; 
	}
}

function shake_xy(n) {
    if (self.moveBy) {
        for (i = 10; i > 0; i--) {
            for (j = n; j > 0; j--) {
            self.moveBy(0,i);
            self.moveBy(i,0);
            self.moveBy(0,-i);
            self.moveBy(-i,0);
				if (j = 0) {
					self.moveBy(0,0);
				}
            }
          }
       }
    }
    function shake_x(n) {
    if (self.moveBy) {
        for (i = 10; i > 0; i--) {
            for (j = n; j > 0; j--) {
            self.moveBy(i,0);
            self.moveBy(-i,0);
            }
          }
       }
    }
    function shake_y(n) {
    if (self.moveBy) {
        for (i = 10; i > 0; i--) {
            for (j = n; j > 0; j--) {
            self.moveBy(0,i);
            self.moveBy(0,-i);
            }
          }
       }
    }
//TEST SCROLLERA//
p6='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=bc3cb5286ec263e02336697bf0c47f59"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/erste110.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=6d7a4f9e3fa5b546427e93d2ed47071e"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/pbzlogo110.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.agrokor.hr" target="_blank"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/agrokor110.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=81abdfe9293ed3aabadc371bf259cbfc"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/Siemens_Logo_Top.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=8027f741e85f9d0afccd9bb07a8d940f"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/podravskabanka110.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=bb06646d69fb3645f8afb4bdc7132164"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/wuest95t.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=dd58ffa54298a1b8cbfa28ae4caca9cb"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/gen2.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=e9b5e331851045f72606d43e03fdc0f7"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/ZaBa_Logo_Top.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=841170195f53dbe7c36b16df12fc2405"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/electuslogo110.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=bc825268671c5a8739fb4469238e6b45"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/autozubaktopposl.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=8f61d0f4a26002daca423dfd6b35d2cb"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/lidl2.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=1c8842444dadae76064c20f5c3b4d7d1"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/iskonbox.gif" width="110" height="30" border=0 alt=""></a><br />';
p6+='<a href="http://www.moj-posao.net/jseeker_ibase_detailedview.php?sessionId=d415f0ead4e49be9318692bef89187f9&entityId=d6f717e929f6713c60c5b3def291dd64"><img style="margin:5px;" src="http://img.moj-posao.net/images/content_images/firstchoiceemployer/selectio110.gif" width="110" height="30" border=0 alt=""></a><br />';
function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){
//**data**//
this.name=name;this.initH=initH;this.initW=initW;this.heightB=heightB;
this.widthB=widthB;this.content=content;this.initBg=initBg;
this.Bg=Bg;this.iniFl=initFl;this.speed=parseInt(speed,10);
this.timer=name+"Timer";
//**methods**//
this.getElement=getElement;this.createLayer=createLayer;
this.scrollLayer=scrollLayer;this.scrollLoop=scrollLoop;
//**initiate methods**//
this.createLayer();this.getElement();this.scrollLayer();}
//**call this method to stop scrolling**//
function scrollLoop(s){this.speed=s;}
function scrollLayer(){
if(parseInt(this.elem.style.top,10)>(this.elem.offsetHeight*(-1))){
  this.elem.style.top=parseInt(this.elem.style.top,10)-this.speed+'px';
  } else {this.elem.style.top=this.initH+'px';}}
function getElement(){this.elem=document.getElementById(this.name);}
function createLayer(){
document.write('<div id="layer'+this.name+'" style="position:relative;overflow:hidden;float:');
document.write(this.initFl+';background-color:#'+this.initBg+';border:1px solid black; border-top:none;width:');
document.write(this.initW+'px;height:'+this.initH+'px;" onmouseover="');
document.write(this.name+'.scrollLoop(0)" onmouseout="'+this.name+'.scrollLoop(');
document.write(this.speed+')">');
document.write('<div id="'+this.name+'" style="position:absolute;top:');
document.write(this.initH+'px;left:0px;border:0px solid black;width:');
document.write(this.widthB+'px;height:'+this.heightB+'px;background-color:#');
document.write(this.Bg+'">');
document.write(this.content);
document.write('<\/div><\/div>');
if(this.scrollLayer){this.timer=setInterval(this.name+'.scrollLayer()','30');}
}
//END TEST SCROLLERA//