/*----------------------------------------------------

	JSONLOAD.JS

----------------------------------------------------*/
$(document).ready(function(){
	
	var bodyid = $('body').attr('id');
	var $url   = location.href;
	
	$https	   = $url.charAt(4)=='s'?'/cmate':'';
	$msg   	   = $("#msg-response");
	
	$('body').append($('<div id="bbBlack"/>')).append($('<div id="bbWhite"/>'));
	$bbW=$('#bbWhite');
	$bbB=$('#bbBlack');
	
	// Close Response Messages
	$msg.click(function(){$(this).slideUp()});
	
	// Input Hints
	if(!Modernizr.input.placeholder){$('input[name="search"]').each(function(){$pl=$(this).attr('placeholder');$t=$(this);$v=$t.val();$t.val($pl);$t.focus(function(e){$(e.target).val('')}).end().blur(function(){$t2=$(this);if($t2.val()==''){$t2.val($pl);$sr.slideUp()}});});}
	
	// Style Top Navigation
	$('#top li a').each(function(){$currPage = $url.replace('http://'+location.hostname,'');$t=$(this);/*if($t.attr('href')=="/shopcart.asp")$t.addClass('basket');*/if($t.attr('href')==$currPage)$t.addClass('current')});
	
	// Smart Search
	var delay = (function(){var timer=0;return function(callback,ms){clearTimeout(timer);timer=setTimeout(callback,ms);};})();
	$sb=$('input[name="search"]');$ss=$('input[value="search"]');$sr=$('#searchresults');$pr=$('#prsearch');
	function ref(){$sr.html('<li style="padding:70px 200px"><img src="'+$https+'/img/wait.gif'+'" alt="Loading"/></li>').slideDown()}
	$('body').click(function(){$sr.slideUp()})
	$sb.keydown(function(e){ref()});
	$sb.keyup(function(e){delay(function(){$t=$(e.target);if($t.val().length>1){ref();$.get($https+'/?search='+$t.val(),function(data){$sr.html(data).slideDown()})}},500);});
	$pr.submit(function(){if($sb.val()=="Enter product name, model or stock code..."){alert('Please enter some text to begin a search');return false;}});
	
	//Price Promise
	$pp=$('#price-promise')
	$pp.submit(function(){$pp.find('span').removeClass('warning').addClass('required');mt=true;$msg.html('<ul><li>Please make sure you have completed all the required fields</li>');$msg.append('</ul><span></span>');checker('name','You must enter your name');checker('address','You must enter your address');checker('telephone','You must enter your telephone number');checker('email','You must enter your email address');checker('invoice','You must enter your cartridgemate.com.au invoice number');checker('prod_det','You must enter the product details');checker('prod_req','You must enter the product you require');checker('part_no','You must enter the part number');checker('man','You must enter the product manufacturer');checker('qty','You must enter a quantity');checker('price','You must enter the price paid');checker('comp_name','You must enter the competitor\'s name');checker('comp_tel','You must enter the competitor\'s telephone number');checker('comp_email','You must enter the competitor\'s email address');checker('comp_address','You must enter the competitor\'s address');$cap=$('input[name="captcha"]');if($cap.val()!=get_cookie('security_code')){$msg.append('<li>Security code incorrect</li>');mt=false;};if(mt==false)$msg.slideDown().delay(4000).slideUp();else $.post("#",$pp.serialize(),function(data){$msg.html(data).slideDown().delay(4000).slideUp()});return false})
	
	// Product Link (Buy/More Info)
	function resetbbW(){$bbW.css('display','none');$bbB.css('display','none')}
	$p=$('#products input,#single-product input');
	$p.click(function(){$t=$(this);set_cookie('url',location.href);if($t.hasClass('more-info'))location.href=$t.parent().parent().find('span.photo a.product-list-link').attr('href');else if($t.hasClass('fav')){b=$.browser;u=location.href;t='CartridgeMate: '+document.title;if(b.msie)window.external.AddFavorite(u,t);else if(b.mozilla)window.sidebar.addPanel(t,u,"");else alert('Sorry, your browser does not support this feature')}else if($t.hasClass('email')){$w=900;$h=$(window).height();$st=$(window).scrollTop();$w2=500;$h2=350;$t2=($h-$h2)/2;$l2=($w-$w2)/2;$bbW.css('width',$w2+'px').css('height',$h2+'px').css('top',$t2+$st+'px').css('left',$l2+'px').css('display','block');$bbB.css('height',$('body').height()+'px').css('display','block');$bbB.click(function(){resetbbW()})}else if($t.attr('value')=='Buy Now' || $t.attr('value')=='Add to Basket'){$sid=$t.attr('id').replace('s','');$qid=$('#q'+$sid);$qty=$qid.val()!=undefined?$qid.val():'1';$t.hasClass('silent')?$.get('/shopcart.asp?smode=jadd&sid='+$sid+'&qty='+$qty,function(data){$('#runtotal').html(data);$t.attr('value','Added');$t.css('position','relative');$t.addClass('green')}) : location.href='/shopcart.asp?smode=add&sid='+$sid+'&qty='+$qty}});
	
	$friend=$('#friend');
	$friend.submit(function(){$friend.find('span').removeClass('warning').addClass('required');mt=true;$msg.html('<ul><li>Please make sure you have completed all the required fields</li>');checker('yname','Your name is missing');checker2('yemail');checker('fname','Your friend\'s name is missing');checker2('femail');$msg.append('</ul><span></span>');if(mt==false)$msg.slideDown().delay(4000).slideUp();else{$.post("#",$friend.serialize(),function(data){$msg.html(data).slideDown().delay(4000).slideUp();})};return false})
		
	$sf=$('#shopcart-form');
	$ef=$('#existing-form');
	$emf=$('#email-form');
	$cf=$('#checkout-form');
	$shf=$('#shipping-form');
	
	// Shopcart Event Chain
	$sf
		.find('select[name="country"]').change(function(){$sf.submit()}).end()
		.find('a.basketupdate').click(function(){$sf.submit()}).end()
		.find('p#basket-buttons input').click(function(e){$('form').find('span').removeClass('warning').addClass('required');$t=$(e.target);switch($t.val()){case "Continue Shopping": $u=get_cookie('url');location.href=$u!=undefined?$u:"/";break;case "New Customer": if($cf.is(':visible')){$cf.slideUp()}else{$ef.slideUp();$emf.slideUp();$cf.slideDown()};break;case "Existing Customer":if($ef.is(':visible')){$ef.slideUp()}else{$cf.slideUp();$emf.slideUp();$ef.slideDown()};break;case "Checkout": $('#secure').submit();break;case "Express Checkout": location.href='/cmate/checkout.asp';break}})
			
	// Existing Customer Form
	$c=$ef.find('input[name="customer"]');
	$u=$ef.find('input[name="email2"]');
	$p=$ef.find('input[name="password2"]')
		
	$ef
		.find('a.email-me').click(function(){$ef.slideUp();$emf.slideDown()}).end()
		.find('input[name="email2"],input[name="password2"]').blur(function(){$.get('?email='+$u.val().toLowerCase()+'&password='+$p.val(),function(data){$c.val(data)})}).end()
		.submit(function(){$ef.find('span').removeClass('warning').addClass('required');mt=true;$msg.html('<ul><li>Please make sure you have completed all the required fields</li>');checker2('email2');checker('password2','You must supply a password for this account');if($c.val()=='' && mt==true){$msg.append('<li>Sorry, we cannot find your details - Please double check the email and password</li>');mt=false};$msg.append('</ul><span></span>');if(mt==false)$msg.slideDown().delay(4000).slideUp();return mt;})
		
	//Email Password Form
	$e3=$emf.find('input[name="email3"]')
	$e3.blur(function(){$.get('includes/check.asp?email='+$(this).val().toLowerCase(),function(data){$e3.attr('alt',data)})})
	$emf.submit(function(){$emf.find('span').removeClass('warning').addClass('required');mt=true;$msg.html('<ul><li>Please make sure you have completed all the required fields</li>');checker2('email3');if($e3.val().toLowerCase()!=$e3.attr('alt') && mt==true){mt=false;$msg.append('<li>There is no account set up for this email address - Please create a new account</li>')};$msg.append('</ul><span></span>');if(mt==false)$msg.slideDown().delay(4000).slideUp();return mt;})
	
	// Checkout Event Chain
	$examex=$('#examex');$gstamex=$('#gstamex');$totamex=$('#totamex');$extot=$('#extot');$gsttot=$('#gsttot');$tot=$('#tot');$gst=($gsttot.length>0)? parseFloat(parseFloat($gsttot.html().replace(/\$/,'')))>0?10:0:0;$trv=$('#checkout-form table tr.voucher');$trv.css('display','none')
	$cf
		.find('input[name="pay"]').change(function(){if($(this).val()=="0")$('#cardpayment').slideDown();else {$('#cardpayment').slideUp();$('#ccard').attr("src","../../images/select.gif");$cf.find('select[name="card"]').val('Select');amex()}}).end()
		.find('select[name="billcountry"]').change(function(){$t=$(this);$shf.find('input[name="ccountry"]').val($t.val());$shf.submit();}).end()
		.find('select[name="free"]').change(function(){$t=$(this);$v=$t.val();$.get('?free='+$v);if($v==1)e=g=c='$0.00';else if($v==2){e='$6.32';g='$0.63';c='$6.95'};$('#exdel').html(e);$('#gstdel').html(g);$('#cdel').html(c);amex()}).end()
		.find('input[name="voucher"]').blur(function(){$t=$(this);$.get('?voucher='+$t.val(),function(data){$('#vouchercell').html(data=='OK'?'Voucher Accepted':'Voucher Invalid/Expired');amex()})}).end()		
		.find('input[name="ins"][type="checkbox"]').change(function(){$t=$(this);if($t.is(':checked')==true){$il='Insurance';$addex='$5.00';$addgst='$0.50';$addtot='$5.50'}else{$il='';$addex='';$addgst='';$addtot=''};$('#inslabel').html($il);$('#exins').html($addex);$('#gstins').html($addgst);$('#totins').html($addtot);amex()}).end()
		.find('input[name="creditcard"]').change(function(){$t=$(this);$v=$t.val().replace(/ /g,"").replace(/-/g,"");$t.val($v.substring(0,4)+' '+$v.substring(4,8)+' '+$v.substring(8,12)+' '+$v.substring(12,16)+' '+$v.substring(16,20))}).end()
		.find('select[name="card"]').change(function(){$t=$(this);$v=$t.val();$('#ccard').attr("src","../../images/"+$v+".gif");amex()}).end()
		.find('input[name="deltick"][type="checkbox"]').change(function(){$t=$(this);$y=$t.is(':checked');$('input[name="shipfname"]').val($y?$('input[name="fname"]').val():'');$('input[name="shiplname"]').val($y?$('input[name="lname"]').val():'');$('input[name="shipcompany"]').val($y?$('input[name="company"]').val():'');$('input[name="shippingaddress0"]').val($y?$('input[name="billingaddress0"]').val():'');$('input[name="shippingaddress1"]').val($y?$('input[name="billingaddress1"]').val():'');$('input[name="shippingaddress2"]').val($y?$('input[name="billingaddress2"]').val():'');$('input[name="shippingaddress3"]').val($y?$('input[name="billingaddress3"]').val():'');$y?$('select[name="shipcountry"] option[value="'+$('select[name="billcountry"]').val()+'"]').attr("selected","selected"):null;$('input[name="shippcode"]').val($y?$('input[name="billpcode"]').val():'')}).end()
		.find('input[name="email"]').blur(function(){$t=$(this);$e=$.trim($t.val().toLowerCase());$cid=$cf.find('input[name="customer"]').val();$.get('includes/check.asp?email='+$e+'&cid='+$cid,function(data){$t.attr('alt',data);})}).end()
		.find('#cvc').click(function(){$w=$(window).width();$h=$(window).height();$st=$(window).scrollTop();$w2=500;$h2=300;$t2=($h-($h2+40))/2;$l2=($w-$w2)/2;$bbW.html('<h3>CVC Signature Code</h3><p><img src="img/_credit-card.gif" alt="Credit Card">The signature code should appear on the back of all credit and debit cards. It provides an additional security measure to prevent fraudulent use of cards.</p><p>The signature code is an extra three digits found on the back of your card, on the signature strip. The last few digits of your card may be repeated before the code - but it is just the last set of digits that you need to enter for the signature code.</p><p>Some cards do not have a signature code. If your card does not have the extra numbers, please enter <strong>000</strong>.</p><p>American Express cards carry the CVC number on the front of the card and is normally four digits just above the long number.</p><p>[<a href="javascript:void(0)">Close</a>]').css('height',$h2+'px').css('top',$t2+$st+'px').css('width',$w2+'px').css('left',$l2+'px').css('display','block');$bbB.css('height',$('body').height()+'px').css('display','block');$bbW.find('A').click(function(){resetbbW()});$bbB.click(function(){resetbbW()})}).end()				
		.submit(function(){$cf.find('span').removeClass('warning').addClass('required');mt=true;$msg.html('<ul><li>Please make sure you have completed all the required fields</li>');checker('fname','The billing address first name is missing');checker('lname','The billing address last name is missing');checker('billingaddress0','The first line of the billing address is missing');checker('billingaddress2','The billing address suburb is missing');checker('billingaddress3','The billing address state is missing');checker('billpcode','The billing post code is missing');checker2('email');$p2=$('input[name="password"]');if($p2){checker('password','You have not entered a password');if($p2.length>0){if($p2.val()!='' && $p2.val().length<6){mt=false;$msg.append('<li>Your password must be 6-20 characters</li>')}}};checker('tel','The telephone number is missing');checker('shipfname','The shipping address first name is missing');checker('shiplname','The shipping address last name is missing');checker('shippingaddress0','The first line of the shipping address is missing');checker('shippingaddress2','The shipping address suburb is missing');checker('shippingaddress3','The shipping address state is missing');checker('shippcode','The shipping post code is missing');$rp=$('input[name="resetpassword"]');if($rp.length>0){if($rp.val()!='' && $rp.val().length<6){mt=false;$msg.append('<li>Your new password must be 6-20 characters</li>')}};if($('#payment').length>0 && $('input[name="pay"]:checked').val()=="0")card_checker();$email=$cf.find('input[name="email"]');if($.trim($email.val().toLowerCase())==$email.attr('alt') && $email.attr('alt')!="" && $cf.find('input[name="updateaccount"]').is(':checked')){mt=false;$msg.append('<li>This email address is already linked to an account. Please login to use this account.</li>')};$msg.append('</ul><span></span>');if(mt==false){window.location.hash='msg';$msg.slideDown().delay(8000).slideUp()};return mt})	
	if($cf.length>0)amex()					
	// Admin
	if(typeof fadmin=='function')fadmin()
});

//Card Checker
function card_checker()
	{		
	checker('card','You must specify the type of card','Select',null,'select')	
	mt2=true;msg2='';$cv=$cf.find('input[name="creditcard"]').val().replace(/ /g,"").replace(/-/g,"")
	//Numeric Check
	for(var k=0;k<parseInt($cv.length);k++){var a=$cv.charAt(k);if(a<"0"||a>"9"){mt=false;mt2=false;break;}};if(mt2==false){$('span[title="creditcard"]').removeClass('required').addClass('warning');msg2+='<li>Invalid Credit Card Number - Not Numeric</li>'}
	if(mt2==true&&$cv.length<10){$('span[title="creditcard"]').removeClass('required').addClass('warning');mt2=false;mt=false;msg2+='<li>Invalid Credit Card Number - Not enough digits</li>'}
	//Modulus 10 Checker
	function bigger_than_5(){num=z*2;if(z*2>=10){n=num.toString();mtot+=parseInt(n.charAt(0))+parseInt(n.charAt(1))}else mtot+=num}
	mtot=0;z=parseInt($cv.charAt(0));if($cv.length%2==0 && mt==true)bigger_than_5();else mtot+=z;
	x=1;y=parseInt($cv.length);while(x<y){z=parseInt($cv.charAt(x));if($cv.length%2==0 && mt==true){if(x%2!=0)mtot+=z;else bigger_than_5()}else{if(x%2!=0)bigger_than_5();else mtot+=z};x++};
	if(mtot%10!=0 && mt2==true){$('span[title="creditcard"]').removeClass('required').addClass('warning');mt=false;mt2=false;msg2+='<li>Invalid Credit Card Number</li>'}
	//Check Start Date & Expiry
	d=new Date();$cm=d.getMonth()+1;$cy=d.getFullYear()
	//$sm=$cf.find('select[name="startmonth"]').val();$sy=$cf.find('select[name="startyear"]').val();if((($sy==$cy&&$sm>$cm)||($sy>$cy))){$('span[title="start"]').removeClass('required').addClass('warning');mt=false;msg2+='<li>Your credit card start date is incorrect</li>'}
	$em=$cf.find('select[name="expirymonth"]').val();$ey=$cf.find('select[name="expiryyear"]').val();
	if(($ey<$cy)||($ey==$cy&&$em<$cm)){$('span[title="expiry"]').removeClass('required').addClass('warning');mt=false;mt2=false;msg2+='<li>Your credit card has expired</li>'}
	if(mt2==false){$msg.append(msg2)}
	checker('cv2','The card CVC number is missing');
	}

function amex()
	{
	//SubTotal
	$subtotalup=0;
	$cf.find('td').each(function(){$t=$(this);if($t.hasClass('add'))$subtotalup+=addvalue($t.html())});stot=$subtotalup.toFixed(2);net=(stot/(1+($gst/100))).toFixed(2);$extot.attr('title','$'+net);$gsttot.attr('title','$'+(stot-net).toFixed(2));$tot.attr('title','$'+stot);
	
	//Discount
	a=b=c='';
	if(v=parseFloat(get_cookie('v'))/100){$trv.css('display','');
		//d=(addvalue($tot.attr('title'))*v*-1).toFixed(2);
		d=(addvalue($('#totdis').attr('title'))*v*-1).toFixed(2);e=(d/(1+($gst/100))).toFixed(2);a='$'+e;b='$'+(d-e).toFixed(2);c='$'+d;f=addvalue($extot.attr('title'));g=addvalue($gsttot.attr('title'));h=addvalue($tot.attr('title'));$extot.attr('title','$'+(parseFloat(f)+parseFloat(e)).toFixed(2));$gsttot.attr('title','$'+(parseFloat(g)+parseFloat(d-e)).toFixed(2));$tot.attr('title','$'+(parseFloat(h)+parseFloat(d)).toFixed(2))}else $trv.css('display','none');
	$('#exdis').html(a);$('#gstdis').html(b);$('#totdis').html(c)
	
	//Amex
	$sur=0.025;$a=$('#checkout-button').find('input[name="amex"]');$tramex=$('#checkout-form table tr.amex');		
	if($('#checkout-form select[name="card"]').val()=='Amex'){stot=addvalue($tot.attr('title'))*$sur;net=(stot/(1+($gst/100)));a='$'+net.toFixed(2);b='$'+(stot-net).toFixed(2);c='$'+stot.toFixed(2);d='1';e='';f='Credit Card Details <em> (2.5% Amex surcharge applies)</em>'}else{a=b=c='';d='0';e='none';f='Credit Card Details'};$examex.html(a);$gstamex.html(b);$totamex.html(c);$a.val(d);$tramex.css('display',e);$('#cardpayment legend').html(f)
	//Final Total
	$extot.html('$'+(addvalue($extot.attr('title'))+addvalue($examex.html())).toFixed(2));$gsttot.html('$'+(addvalue($gsttot.attr('title'))+addvalue($gstamex.html())).toFixed(2));$tot.html('$'+(addvalue($tot.attr('title'))+addvalue($totamex.html())).toFixed(2));
	}
	
function addvalue(a)
	{return(a?parseFloat(a.replace(/\$/,'').replace(/\,/,'')):0)}
	
function set_cookie(c,v)
	{document.cookie=c+"="+escape(v)+";path=/;1"}
			
function get_cookie(c)
	{dc=document.cookie;cs=dc.indexOf(c+"=");if(cs!=-1){cs+= c.length+1;ce=dc.indexOf(";",cs);if(ce==-1)ce=dc.length;return unescape(dc.substring(cs,ce))}}

//Form Validation
function checker(obj,msg,v,s,ta)
	{ta=ta==null?'input':ta;v=v==null?'':v;s=s==null?'==':s;if(eval('$(\''+ta+'[name="'+obj+'"]\').val()'+s+'"'+v+'"')){$msg.append('<li>'+msg+'</li>');$('span[title="'+obj+'"]').removeClass('required').addClass('warning');mt=false}}
	
function numchecker(obj,msg)
	{
	$n=$('input[name="'+obj+'"]').val();mt2=true;for(var k=0;k<parseInt($n.length);k++){var a=$n.charAt(k);if((a<"0"||a>"9")&&a!="."){$('span[title="'+obj+'"]').removeClass('required').addClass('warning');mt=false;mt2=false}};if(mt2==false)$msg.append('<li>'+msg+'</li>')
	}
	
function checker2(obj)
	{
	mt2=true;eS=$('input[name="'+obj+'"]').val();eP=/^(.+)@(.+)$/;sC="\\(\\)!£$%^&*()+='#~?<>@,;:\\\\\\\"\\.\\[\\]";vC="\[^\\s"+sC+"\]";qU="(\"[^\"]*\")";aT=vC+'+';wD="("+aT+"|"+qU+")";uP=new RegExp("^"+wD+"(\\."+wD+")*$");dP=new RegExp("^"+aT+"(\\."+aT+")*$");mA=eS.match(eP);
	if(mA==null){mt=false;mt2=false;msg='The email address seems incorrect'};
	if(mt2==true && mA[1].match(uP)==null){mt=false;mt2=false;msg='The email username does not seem to be valid.'};
	if(mt2==true && mA[2].match(dP)==null){mt=false;mt2=false;msg='The email domain does not seem to be valid.'};
	if(mt2==true){dA=mA[2].match(new RegExp(aT,"g"));l=dA.length;if(dA[l-1].length<2 || dA[l-1].length>4){mt=false;mt2=false;msg='The email address must end in a two,three or four letter domain'}};
	if(mt2==false){$('span[title="'+obj+'"]').removeClass('required').addClass('warning');$msg.append('<li>'+msg+'</li>')}
	}
		
// XXX. Plugins
//------------------------------------------------------------------------------------------

/*
 * Modernizr v1.6
 * http://www.modernizr.com
 *
 * Developed by: 
 * - Faruk Ates  http://farukat.es/
 * - Paul Irish  http://paulirish.com/
 *
 * Copyright (c) 2009-2010
 * Dual-licensed under the BSD or MIT licenses.
 * http://www.modernizr.com/license/
 */
window.Modernizr=function(i,e,u){function s(a,b){return(""+a).indexOf(b)!==-1}function D(a,b){for(var c in a)if(j[a[c]]!==u&&(!b||b(a[c],E)))return true}function n(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1);c=(a+" "+F.join(c+" ")+c).split(" ");return!!D(c,b)}function S(){f.input=function(a){for(var b=0,c=a.length;b<c;b++)L[a[b]]=!!(a[b]in h);return L}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));f.inputtypes=function(a){for(var b=0,c,k=a.length;b<
k;b++){h.setAttribute("type",a[b]);if(c=h.type!=="text"){h.value=M;if(/^range$/.test(h.type)&&h.style.WebkitAppearance!==u){l.appendChild(h);c=e.defaultView;c=c.getComputedStyle&&c.getComputedStyle(h,null).WebkitAppearance!=="textfield"&&h.offsetHeight!==0;l.removeChild(h)}else/^(search|tel)$/.test(h.type)||(c=/^(url|email)$/.test(h.type)?h.checkValidity&&h.checkValidity()===false:h.value!=M)}N[a[b]]=!!c}return N}("search tel url email datetime date month week time datetime-local number range color".split(" "))}
var f={},l=e.documentElement,E=e.createElement("modernizr"),j=E.style,h=e.createElement("input"),M=":)",O=Object.prototype.toString,q=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),F="Webkit Moz O ms Khtml".split(" "),v={svg:"http://www.w3.org/2000/svg"},d={},N={},L={},P=[],w,Q=function(a){var b=document.createElement("style"),c=e.createElement("div");b.textContent=a+"{#modernizr{height:3px}}";(e.head||e.getElementsByTagName("head")[0]).appendChild(b);c.id="modernizr";l.appendChild(c);a=c.offsetHeight===
3;b.parentNode.removeChild(b);c.parentNode.removeChild(c);return!!a},o=function(){var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return function(b,c){c=c||document.createElement(a[b]||"div");b="on"+b;var k=b in c;if(!k){c.setAttribute||(c=document.createElement("div"));if(c.setAttribute&&c.removeAttribute){c.setAttribute(b,"");k=typeof c[b]=="function";if(typeof c[b]!="undefined")c[b]=u;c.removeAttribute(b)}}return k}}(),G={}.hasOwnProperty,R;R=
typeof G!=="undefined"&&typeof G.call!=="undefined"?function(a,b){return G.call(a,b)}:function(a,b){return b in a&&typeof a.constructor.prototype[b]==="undefined"};d.flexbox=function(){var a=e.createElement("div"),b=e.createElement("div");(function(k,g,r,x){g+=":";k.style.cssText=(g+q.join(r+";"+g)).slice(0,-g.length)+(x||"")})(a,"display","box","width:42px;padding:0;");b.style.cssText=q.join("box-flex:1;")+"width:10px;";a.appendChild(b);l.appendChild(a);var c=b.offsetWidth===42;a.removeChild(b);
l.removeChild(a);return c};d.canvas=function(){var a=e.createElement("canvas");return!!(a.getContext&&a.getContext("2d"))};d.canvastext=function(){return!!(f.canvas&&typeof e.createElement("canvas").getContext("2d").fillText=="function")};d.webgl=function(){var a=e.createElement("canvas");try{if(a.getContext("webgl"))return true}catch(b){}try{if(a.getContext("experimental-webgl"))return true}catch(c){}return false};d.touch=function(){return"ontouchstart"in i||Q("@media ("+q.join("touch-enabled),(")+
"modernizr)")};d.geolocation=function(){return!!navigator.geolocation};d.postmessage=function(){return!!i.postMessage};d.websqldatabase=function(){return!!i.openDatabase};d.indexedDB=function(){for(var a=-1,b=F.length;++a<b;){var c=F[a].toLowerCase();if(i[c+"_indexedDB"]||i[c+"IndexedDB"])return true}return false};d.hashchange=function(){return o("hashchange",i)&&(document.documentMode===u||document.documentMode>7)};d.history=function(){return!!(i.history&&history.pushState)};d.draganddrop=function(){return o("drag")&&
o("dragstart")&&o("dragenter")&&o("dragover")&&o("dragleave")&&o("dragend")&&o("drop")};d.websockets=function(){return"WebSocket"in i};d.rgba=function(){j.cssText="background-color:rgba(150,255,150,.5)";return s(j.backgroundColor,"rgba")};d.hsla=function(){j.cssText="background-color:hsla(120,40%,100%,.5)";return s(j.backgroundColor,"rgba")||s(j.backgroundColor,"hsla")};d.multiplebgs=function(){j.cssText="background:url(//:),url(//:),red url(//:)";return/(url\s*\(.*?){3}/.test(j.background)};d.backgroundsize=
function(){return n("backgroundSize")};d.borderimage=function(){return n("borderImage")};d.borderradius=function(){return n("borderRadius","",function(a){return s(a,"orderRadius")})};d.boxshadow=function(){return n("boxShadow")};d.textshadow=function(){return e.createElement("div").style.textShadow===""};d.opacity=function(){var a=q.join("opacity:.5;")+"";j.cssText=a;return s(j.opacity,"0.5")};d.cssanimations=function(){return n("animationName")};d.csscolumns=function(){return n("columnCount")};d.cssgradients=
function(){var a=("background-image:"+q.join("gradient(linear,left top,right bottom,from(#9f9),to(white));background-image:")+q.join("linear-gradient(left top,#9f9, white);background-image:")).slice(0,-17);j.cssText=a;return s(j.backgroundImage,"gradient")};d.cssreflections=function(){return n("boxReflect")};d.csstransforms=function(){return!!D(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])};d.csstransforms3d=function(){var a=!!D(["perspectiveProperty","WebkitPerspective",
"MozPerspective","OPerspective","msPerspective"]);if(a)a=Q("@media ("+q.join("transform-3d),(")+"modernizr)");return a};d.csstransitions=function(){return n("transitionProperty")};d.fontface=function(){var a,b=e.head||e.getElementsByTagName("head")[0]||l,c=e.createElement("style"),k=e.implementation||{hasFeature:function(){return false}};c.type="text/css";b.insertBefore(c,b.firstChild);a=c.sheet||c.styleSheet;b=k.hasFeature("CSS2","")?function(g){if(!(a&&g))return false;var r=false;try{a.insertRule(g,
0);r=!/unknown/i.test(a.cssRules[0].cssText);a.deleteRule(a.cssRules.length-1)}catch(x){}return r}:function(g){if(!(a&&g))return false;a.cssText=g;return a.cssText.length!==0&&!/unknown/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(g.split(" ")[0])===0};f._fontfaceready=function(g){g(f.fontface)};return b('@font-face { font-family: "font"; src: "font.ttf"; }')};d.video=function(){var a=e.createElement("video"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('video/ogg; codecs="theora"');
b.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"')||a.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');b.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return b};d.audio=function(){var a=e.createElement("audio"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"');b.mp3=a.canPlayType("audio/mpeg;");b.wav=a.canPlayType('audio/wav; codecs="1"');b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}return b};d.localstorage=function(){try{return"localStorage"in
i&&i.localStorage!==null}catch(a){return false}};d.sessionstorage=function(){try{return"sessionStorage"in i&&i.sessionStorage!==null}catch(a){return false}};d.webWorkers=function(){return!!i.Worker};d.applicationcache=function(){return!!i.applicationCache};d.svg=function(){return!!e.createElementNS&&!!e.createElementNS(v.svg,"svg").createSVGRect};d.inlinesvg=function(){var a=document.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==v.svg};d.smil=function(){return!!e.createElementNS&&
/SVG/.test(O.call(e.createElementNS(v.svg,"animate")))};d.svgclippaths=function(){return!!e.createElementNS&&/SVG/.test(O.call(e.createElementNS(v.svg,"clipPath")))};for(var H in d)if(R(d,H)){w=H.toLowerCase();f[w]=d[H]();P.push((f[w]?"":"no-")+w)}f.input||S();f.crosswindowmessaging=f.postmessage;f.historymanagement=f.history;f.addTest=function(a,b){a=a.toLowerCase();if(!f[a]){b=!!b();l.className+=" "+(b?"":"no-")+a;f[a]=b;return f}};j.cssText="";E=h=null;i.attachEvent&&function(){var a=e.createElement("div");
a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function c(p){for(var m=-1;++m<r;)p.createElement(g[m])}function k(p,m){for(var I=p.length,t=-1,y,J=[];++t<I;){y=p[t];m=y.media||m;J.push(k(y.imports,m));J.push(y.cssText)}return J.join("")}var g="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video".split("|"),r=g.length,x=RegExp("<(/*)(abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video)",
"gi"),T=RegExp("\\b(abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video)\\b(?!.*[;}])","gi"),z=b.createDocumentFragment(),A=b.documentElement,K=A.firstChild,B=b.createElement("style"),C=b.createElement("body");B.media="all";c(b);c(z);a.attachEvent("onbeforeprint",function(){for(var p=-1;++p<r;)for(var m=b.getElementsByTagName(g[p]),I=m.length,t=-1;++t<I;)if(m[t].className.indexOf("iepp_")<0)m[t].className+=" iepp_"+
g[p];K.insertBefore(B,K.firstChild);B.styleSheet.cssText=k(b.styleSheets,"all").replace(T,".iepp_$1");z.appendChild(b.body);A.appendChild(C);C.innerHTML=z.firstChild.innerHTML.replace(x,"<$1bdo")});a.attachEvent("onafterprint",function(){C.innerHTML="";A.removeChild(C);K.removeChild(B);A.appendChild(z.firstChild)})}(this,document);f._enableHTML5=true;f._version="1.6";l.className=l.className.replace(/\bno-js\b/,"")+" js";l.className+=" "+P.join(" ");return f}(this,this.document);
