/*
 * @author			Daniyal Hamid
 * 
 * @license			This JavaScript file is a commercial file, available for purchase at 
 *					http://codecanyon.net/user/daniyal/portfolio. Any illegal copying, 
 *					distribution, packaging or re-production of this script for commercial or 
 *					personal use is strictly prohibited and will be considered theft.
 *
 * @copyright		The author is the first owner of copyright and reserves all rights to
 *					all written work contained in this file. Distribution, re-production
 *					or commercial use of the written work in this file, without the author's 
 * 					signed permission, prior consent or a valid license, is strictly prohibited.
 *					The author is protected by the "Copyright, Designs and Patents Act 1988" of 
 *					the United Kingdom. Any infringement of the copyright, in or outside of the
 *					United Kingdom, may result in a lawsuit.
 */


(function(b){var a=new Array();var c={backspace:8,tab:9,enter:13,esc:27,space:32,"pg-up":33,"pg-dn":34,end:35,home:36,left:37,up:38,right:39,down:40,"0":48,"1":49,"2":50,"3":51,"4":52,"5":53,"6":54,"7":55,"8":56,"9":57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,"num-0":96,"num-1":97,"num-2":98,"num-3":99,"num-4":100,"num-5":101,"num-6":102,"num-7":103,"num-8":104,"num-9":105,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,"semi-colon":186,";":186,equal:187,"=":187,comma:188,",":188,dash:189,"-":189,period:190,".":190,"/":191,"[":219,"]":221,"\\":220};b(document).bind("keydown",function(d){if(a.length!=0){b.each(a,function(h,e){var g=e.key;var f=g.indexOf("+");if(f!=-1){var j=g.split("+");if(j[0]=="ctrl"||j[0]=="control"){if(d.ctrlKey&&d.keyCode==c[j[1]]){d.preventDefault();e.func.apply(e.selected,["control+"+j[1]])}}else{if(j[0]=="alt"){if(d.altKey&&d.keyCode==c[j[1]]){d.preventDefault();e.func.apply(e.selected,["alt+"+j[1]])}}else{if(j[0]=="shift"){if(d.shiftKey&&d.keyCode==c[j[1]]){d.preventDefault();e.func.apply(e.selected,["shift+"+j[1]])}}else{if(j[0]=="meta"){if(d.metaKey&&d.keyCode==c[j[1]]){d.preventDefault();e.func.apply(e.selected,["meta+"+j[1]])}}else{throw new Error(g+" is not a valid key combination!")}}}}}else{if(d.keyCode==c[g]&&!(d.ctrlKey||d.altKey||d.shiftKey||d.metaKey)){d.preventDefault();e.func.apply(e.selected,[g])}}})}});b.fn.assign=function(g,d,f){var e=b(this);if(null!=d&&typeof d==="object"){b.each(d,function(j,h){a.push({key:h,selected:e,func:f})})}b(e).bind(g,function(h){h.stopPropagation();f.apply(e,[h.target])})}})(jQuery);
