function blockError() {
  return true;
}

window.onerror = blockError;

$(document).ready(function(){
if($.browser.msie){
        Printfix();
    } 

   	/* check for iPhone */
   	var agent=navigator.userAgent.toLowerCase();
	var is_iphone = ((agent.indexOf('iphone')!=-1));
	var is_ipad = ((agent.indexOf('ipad')!=-1));


if(is_iphone==true || is_ipad==true){
is_mobile = true;
} else { is_mobile = false; }


	if (is_iphone || is_ipad) {
		/* iPhone telephone number formatting */
		/* adds 'tel:' scheme formatted phone number to all microformatted telephone number on the page */
		$('.tel .value:not(.nodial)').each(function(){
			var telNo = $(this).text().replace(/\(.*\)/,'').replace(/\s+/g,'');
                            telNo = telNo.replace(/\//g,'');
			var wrapLink = '<a href="tel:'+telNo+'"></a>';
			$(this).wrap(wrapLink);
		});
	
	}



});


var roundedboxes;

function Printfix(){
    roundedboxes = $("#box_vl_hell,#box_content");
    window.onbeforeprint = removeRoundedboxes;
    window.onafterprint = addRoundedboxes;
}

function removeRoundedboxes(){
     $(roundedboxes).css("behavior","none");
    }
    
    function addRoundedboxes(){
     $(roundedboxes).css("behavior","url(PIE.htc)");
    }


function ajaxRequest(){
 var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; //activeX versions to check for in IE
 if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
  for (var i=0; i<activexmodes.length; i++){
   try{
    return new ActiveXObject(activexmodes[i]);
   }
   catch(e){
    //suppress error
   }
  }
 }
 else if (window.XMLHttpRequest){
  return new XMLHttpRequest();
 } else {
  return false;
 }
}
