//<!-- Hide the script
function fixIE6flicker(fix) {
try {
	document.execCommand("BackgroundImageCache", false, fix);
} catch(err) { }

}

window.onload = function() { fixIE6flicker(true); }


var distributionHoverOn=function(elm){

	elm.style.background='url(img/distribution-home-hover.jpg) no-repeat';

}

var distributionHoverOff=function(elm){
	
	elm.style.background=' url(img/distribution-home.jpg) no-repeat';

}

var designHoverOn=function(elm){

	elm.style.background=' url(img/design-home-hover.jpg) no-repeat';

}

var designHoverOff=function(elm){
	
	elm.style.background=' url(img/design-home.jpg) no-repeat';

}

var printingHoverOn=function(elm){

	elm.style.background=' url(img/printing-home-hover.jpg) no-repeat';

}

var printingHoverOff=function(elm){
	
	elm.style.background=' url(img/printing-home.jpg) no-repeat';

}

 	contactEmailBlur=function(el){ 
        validateEmail();
        if(el.value==''){
            el.value='Your email';
        }
        
    }
	contactEmailFocus=function(el){
        $('submit-contact').disabled = false;  
        if(el.value=='Your email'){ el.value='';	}	
    }


validateEmail=function(){
    
      
    var email=$('mail').value;    
    var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(email)){ 
    
        $('submit-contact').disabled = false;
        $('mailError').innerHTML=''
		$('mailError').style.display='none';
        return true;
	
    }else{
        $('submit-contact').disabled = true;
		$('mailError').style.display='block';
        $('mailError').innerHTML='Please enter valid email'
        return false;
        
    }    
} 



contactSubmit=function(){
    
    if(validateEmail()){
        $('contactForm').submit();
    }
}


function thesame(value1, value2, description)
{
  if (((value1 != null) || 
       (value1 != "")) && 
       value2 != "" && 
       value1 != value2)
  {
       alert("The " + description + " must be identical.");
       return (false);
  }
  return (true);
}
var confirmMailDelete=function(messageID){

		if (confirm("Do you realy want to delete this message?")) { 

				window.location='/admin/deletemessage.php?SifM='+messageID;

		 }

}
var confirmJobApplicantDelete=function(SifJ){

		if (confirm("Do you realy want to delete this message?")) { 

				window.location='/admin/deleteapplicant.php?SifJ='+SifJ;

		 }

}

var confirmMlistAction=function(formID){

		if (confirm("Are you sure you want to do that?")) { 
			$(formID).submit();            
		}

}

function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
		if(!document.forms[FormName])
				return;
		var objCheckBoxes = document.forms[FormName].elements[FieldName];
		if(!objCheckBoxes)
				return;
		var countCheckBoxes = objCheckBoxes.length;
		if(!countCheckBoxes)
				objCheckBoxes.checked = CheckValue;
		else
				// set the check value for all check boxes
				for(var i = 0; i < countCheckBoxes; i++)
						objCheckBoxes[i].checked = CheckValue;
}
// end hiding -->















