var windowSize={width:0,height:0,calc:function(){if(typeof(window.innerWidth)=='number'){this.width=window.innerWidth;this.height=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){this.width=document.documentElement.clientWidth;this.height=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){this.width=document.body.clientWidth;this.height=document.body.clientHeight;}},getWidth:function(){this.calc();return this.width;},getHeight:function(){this.calc();return this.height;}};function SubmitOnEnter(e){var keynum;if(window.event)
{keynum=e.keyCode;}
else if(e.which)
{keynum=e.which;}
if(keynum==Event.KEY_RETURN){document.search_form.submit();}}
function valid_mail(strEmail){if(strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1){return true;}
else{return false;}}
function prompt_delete(ad_name){if(confirm('Da li ste sigurni da želite da obrišete oglas:\n'+ad_name+'  ?')){return true;}
else{return false;}}
function prompt_delete_pic(){if(confirm('Da li ste sigurni da želite da obrišete Vaš logo ?')){return true;}
else{return false;}}
function prompt_delete_pic_js(el){alert_confirm('Da li ste sigurni da želite da obrišete Vašu sliku ?',"document.location = '"+el+"'");return false;}
function go_back(){window.history.go(-1);}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";var domainParts=document.domain.split(".");if(domainParts.length>1){var domain_text="; domain=.";if(domainParts.length==2){domain_text+=document.domain;}
else{domainParts.shift();domain_text+=domainParts.join(".");}}
else
var domain_text="";document.cookie=name+"="+value+expires+"; path=/"+domain_text;}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){var expires="; expires=Thu, 01-Jan-1970 16:00:01 GMT";var domainParts=document.domain.split(".");if(domainParts.length>1){if(domainParts.length>2){domainParts.shift();}
document.cookie=name+"="+expires+"; path=/; domain=."+domainParts.join(".");document.cookie=name+"="+expires+"; path=/";}}
function attach_click(el_id,color_on,color_off,class_name){bg_color=(typeof(class_name)=='undefined')?true:false;elem=document.getElementById(el_id);elements=elem.getElementsByTagName('input');el_count=elements.length;for(i=0;i<el_count;i++){elements[i].onclick=function(){colorize(this,color_on,color_off,class_name);};colorize(elements[i],color_on,color_off,class_name);}}
function colorize(check_box,color_on,color_off,class_name){bg_color=(typeof(class_name)=='undefined')?true:false;color_on=(color_on)?color_on:'#ccc';color_off=(color_off)?color_off:'#F7F6F6';el_style=check_box.parentNode.parentNode;if(check_box.type=='checkbox'){if(check_box.checked){if(bg_color)el_style.style.backgroundColor=color_on;else{jQuery(el_style).toggleClass(class_name);}}
else{if(bg_color)el_style.style.backgroundColor=color_off;else{jQuery(el_style).toggleClass(class_name);}}}}
function toggle_show_hide(el_id,type){if(!type)type=0;if(document.getElementById(el_id)){el=document.getElementById(el_id);}
else{el=document.forms[0].elements[el_id];}
if(type==0){if(el.style.display=='none'||el.style.display==''){el.style.display='block';}
else{el.style.display='none';}}
else{if(el.style.visibility=='hidden'){el.style.visibility='visible';}
else{el.style.visibility='hidden';}}}
jQuery(document).ready(function(){colorizeChildElements('category_region_table','tdColored','#dcdbda','#f4f3f2');colorizeChildElements('category_region_table','tdTransparent','#dcdbda','#f4f3f2');colorizeChildElements('contentMiddle','NewJobs','#dcdbda','#f4f3f2');if(windowSize.getWidth()<1120&&(readCookie('AuthJ')==null)){jQuery('#login_container, #logged_container').css({'position':'relative','right':'35px'});}
bookmark_us();});function colorizeChildElements(ParentElId,ChildElClass,HoverColor,OutColor){if(jQuery('#'+ParentElId)){var ChildElements=jQuery('.'+ChildElClass);ChildElements.each(function(i,Element){Element.onmouseover=function(){Element.style.backgroundColor=HoverColor};Element.onmouseout=function(){Element.style.backgroundColor=OutColor};});}}
function alert_lakodoposla(alert_message,alert_type,enclose,callback){if(!alert_type){my_alert_type='error';}
else{my_alert_type=alert_type;}
if(!alert_type||enclose){alert_message='<div class=\"errorbox\"> <div class=\"'+my_alert_type+'box_top\"><div class=\"error_right\"> </div></div>    <div id=\"hdr'+my_alert_type+'\"><p>'+alert_message+'</p></div>   <div class=\"'+my_alert_type+'box_bottom\"><div class=\"error_right\"> </div></div>   </div>';}
var this_callback=(typeof(callback)=="undefined")?function(){}:callback;jQuery.prompt(alert_message,{buttons:{"OK":true},show:"fadeIn",opacity:0.3,callback:this_callback});}
var default_callbackfunc=false;function alert_confirm(confirm_message,callbackfunc,alert_type){if(!alert_type){alert_type='info';confirm_message='<div class=\"errorbox\"> <div class=\"'+alert_type+'box_top\"><div class=\"error_right\"> </div></div>    <div id=\"hdr'+alert_type+'\"><p>'+confirm_message+'</p></div>   <div class=\"'+alert_type+'box_bottom\"><div class=\"error_right\"> </div></div>   </div>';}
default_callbackfunc=callbackfunc;jQuery.prompt(confirm_message,{buttons:{"OK":true,"Odustani":false},callback:myformsubmit,show:"fadeIn",opacity:0.3,zIndex:1999,overlayspeed:'fast'});}
function myformsubmit(value,message){if(value){eval(default_callbackfunc);}}
function bookmark_usx(){jQuery("a.jqbookmark").attr("rel","sidebar");}
function bookmark_us(){if(window.opera){if(jQuery("a.jqbookmark").attr("rel")==""){jQuery("a.jqbookmark").attr("rel","sidebar");}}
jQuery("a.jqbookmark").click(function(event){if(!window.opera){event.preventDefault();}
bookmark_ldpo();});}
function bookmark_ldpo(){var url='http://'+window.location.hostname;var title=document.title;if(window.sidebar){window.sidebar.addPanel(title,url,"");}else if(window.external&&document.all){window.external.AddFavorite(url,title);}else if(window.opera){return true;}else{alert_lakodoposla('Kliknite CTRL+D (CMD+D na Mac-u) da bi ste dodali www.lakodoposla.com u omiljene sajtove!','info',true);}}
function ldp_popup(url,w,h){var win=null;_w=(typeof(w)=="undefined")?750:w;_h=(typeof(h)=="undefined")?550:w;LeftPosition=(screen.width)?(screen.width-_w)/2:0;TopPosition=(screen.height)?(screen.height-_h)/2:0;myname="LakoDoPosla";settings='height='+_h+',width='+_w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,menubar=no';win=window.open(url,myname,settings);}
