


$(document).ready(function() {
	$('body').addClass('js');
	$('input, textarea').placeholder();
	$('a[rel=external]').attr('target','_blank');
	initHomepageSlides();
});

/*! http://mths.be/placeholder v1.8.7 by @mathias */
(function(f,h,c){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=c.fn,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){return this.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind('focus.placeholder',b).bind('blur.placeholder',e).trigger('blur.placeholder').end()};j.input=a;j.textarea=d;c(function(){c(h).delegate('form','submit.placeholder',function(){var k=c('.placeholder',this).each(b);setTimeout(function(){k.each(e)},10)})});c(f).bind('unload.placeholder',function(){c('.placeholder').val('')})}function g(l){var k={},m=/^jQuery\d+$/;c.each(l.attributes,function(o,n){if(n.specified&&!m.test(n.name)){k[n.name]=n.value}});return k}function b(){var k=c(this);if(k.val()===k.attr('placeholder')&&k.hasClass('placeholder')){if(k.data('placeholder-password')){k.hide().next().show().focus().attr('id',k.removeAttr('id').data('placeholder-id'))}else{k.val('').removeClass('placeholder')}}}function e(){var o,n=c(this),k=n,m=this.id;if(n.val()===''){if(n.is(':password')){if(!n.data('placeholder-textinput')){try{o=n.clone().attr({type:'text'})}catch(l){o=c('<input>').attr(c.extend(g(this),{type:'text'}))}o.removeAttr('name').data('placeholder-password',true).data('placeholder-id',m).bind('focus.placeholder',b);n.data('placeholder-textinput',o).data('placeholder-id',m).before(o)}n=n.removeAttr('id').hide().prev().attr('id',m).show()}n.addClass('placeholder').val(n.attr('placeholder'))}else{n.removeClass('placeholder')}}}(this,document,jQuery));


// gen_validatorv2.js
function Validator(a){this.formobj=document.forms[a];if(!this.formobj){alert("BUG: couldnot get Form object "+a);return}if(this.formobj.onsubmit){this.formobj.old_onsubmit=this.formobj.onsubmit;this.formobj.onsubmit=null}else{this.formobj.old_onsubmit=null}this.formobj.onsubmit=form_submit_handler;this.addValidation=add_validation;this.setAddnlValidationFunction=set_addnl_vfunction;this.clearAllValidations=clear_all_validations}function set_addnl_vfunction(a){this.formobj.addnlvalidation=a}function clear_all_validations(){for(var a=0;a<this.formobj.elements.length;a++){this.formobj.elements[a].validationset=null}}function form_submit_handler(){for(var itr=0;itr<this.elements.length;itr++){if(this.elements[itr].validationset&&!this.elements[itr].validationset.validate()){return false}}if(this.addnlvalidation){str=" var ret = "+this.addnlvalidation+"()";eval(str);if(!ret){return ret}}return true}function add_validation(c,d,a){if(!this.formobj){alert("BUG: the form object is not set properly");return}var b=this.formobj[c];if(!b){alert("BUG: Couldnot get the input object named: "+c);return}if(!b.validationset){b.validationset=new ValidationSet(b)}b.validationset.add(d,a)}function ValidationDesc(a,b,c){this.desc=b;this.error=c;this.itemobj=a;this.validate=vdesc_validate}function vdesc_validate(){if(!V2validateData(this.desc,this.itemobj,this.error)){this.itemobj.focus();return false}return true}function ValidationSet(a){this.vSet=new Array();this.add=add_validationdesc;this.validate=vset_validate;this.itemobj=a}function add_validationdesc(a,b){this.vSet[this.vSet.length]=new ValidationDesc(this.itemobj,a,b)}function vset_validate(){for(var a=0;a<this.vSet.length;a++){if(!this.vSet[a].validate()){return false}}return true}function validateEmailv2(e){if(e.length<=0){return true}var a=e.match("^(.+)@(.+)$");if(a==null){return false}if(a[1]!=null){var b=/^\"?[\w-_\.]*\"?$/;if(a[1].match(b)==null){return false}}if(a[2]!=null){var c=/^[\w-\.]*\.[A-Za-z]{2,4}$/;if(a[2].match(c)==null){var d=/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;if(a[2].match(d)==null){return false}}return true}return false}function V2validateData(strValidateStr,objValue,strError){var epos=strValidateStr.search("=");var command="";var cmdvalue="";if(epos>=0){command=strValidateStr.substring(0,epos);cmdvalue=strValidateStr.substr(epos+1)}else{command=strValidateStr}switch(command){case"req":case"required":if(eval(objValue.value.length)==0){if(!strError||strError.length==0){strError=objValue.name+" : Required Field"}alert(strError);return false}break;case"maxlength":case"maxlen":if(eval(objValue.value.length)>eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : "+cmdvalue+" characters maximum "}alert(strError+"\n[Current length = "+objValue.value.length+" ]");return false}break;case"minlength":case"minlen":if(eval(objValue.value.length)<eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : "+cmdvalue+" characters minimum  "}alert(strError+"\n[Current length = "+objValue.value.length+" ]");return false}break;case"alnum":case"alphanumeric":var charpos=objValue.value.search("[^A-Za-z0-9]");if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alpha-numeric characters allowed "}alert(strError+"\n [Error character position "+eval(charpos+1)+"]");return false}break;case"num":case"numeric":var charpos=objValue.value.search("[^0-9]");if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only digits allowed "}alert(strError+"\n [Error character position "+eval(charpos+1)+"]");return false}break;case"alphabetic":case"alpha":var charpos=objValue.value.search("[^A-Za-z]");if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphabetic characters allowed "}alert(strError+"\n [Error character position "+eval(charpos+1)+"]");return false}break;case"alnumhyphen":var charpos=objValue.value.search("[^A-Za-z0-9-_]");if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": characters allowed are A-Z,a-z,0-9,- and _"}alert(strError+"\n [Error character position "+eval(charpos+1)+"]");return false}break;case"email":if(!validateEmailv2(objValue.value)){if(!strError||strError.length==0){strError=objValue.name+": Enter a valid Email address "}alert(strError);return false}break;case"lt":case"lessthan":if(isNaN(objValue.value)){alert(objValue.name+": Should be a number ");return false}if(eval(objValue.value)>=eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : value should be less than "+cmdvalue}alert(strError);return false}break;case"gt":case"greaterthan":if(isNaN(objValue.value)){alert(objValue.name+": Should be a number ");return false}if(eval(objValue.value)<=eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : value should be greater than "+cmdvalue}alert(strError);return false}break;case"regexp":if(objValue.value.length>0){if(!objValue.value.match(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+": Invalid characters found "}alert(strError);return false}}break;case"dontselect":if(objValue.selectedIndex==null){alert("BUG: dontselect command for non-select Item");return false}if(objValue.selectedIndex==eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+": Please Select one option "}alert(strError);return false}break}return true};

// emailProtector.js
var decryption_cache=new Array();function decrypt_string(f,c,h,k){var b="'"+f+","+k+"'";if(decryption_cache[b]){return decryption_cache[b]}if(addresses[f]){var f=addresses[f]}if(!f.length){return"Error, not a valid index."}if(c==0||h==0){var e=f.split(" ");c=e[0];h=e[1];e[0]="";e[1]="";f=e.join(" ").substr(2)}var l="";var g=f.split(" ");for(var a in g){var d=g[a];var j=exponentialModulo(d,c,h);if(k&&a<7){continue}if(k&&j==63){break}l+=String.fromCharCode(j)}decryption_cache[b]=l;return l}function decrypt_and_email(d,a,b){if(!a||!b){a=0;b=0}if(!d){d=0}var c=decrypt_string(d,a,b,false);parent.location=c}function decrypt_and_echo(d,a,b){if(!a||!b){a=0;b=0}if(!d){d=0}var c=decrypt_string(d,a,b,true);document.write(c);return true}function exponentialModulo(b,a,c){if(c%2==0){answer=1;for(var d=1;d<=c/2;d++){temp=(b*b)%a;answer=(temp*answer)%a}}else{answer=b;for(var d=1;d<=c/2;d++){temp=(b*b)%a;answer=(temp*answer)%a}}return answer};

// slideshow.js
function initHomepageSlides(){homepage_slide_animation_speed=800;homepage_slide_animation_timeout=4000;if($(".homepage_slide").length<=1){return}$("#slide_next").click(onSlideNextClick);$("#slide_prev").click(onSlidePrevClick);var a=$(".homepage_slide:first");a.addClass("current");var b=100;$(".homepage_slide").each(function(){$(this).css("zIndex",b);b-=1});onSlideAnimationComplete()}function shuffleArray(b){for(var d,a,c=b.length;c;d=parseInt(Math.random()*c),a=b[--c],b[c]=b[d],b[d]=a){}return b}function onSlideNextClick(a){navigateSlides(1)}function onSlidePrevClick(a){navigateSlides(-1)}function navigateSlides(b){clearTimeout(time_out);if(animationInProgress){return}var a=$(".homepage_slide");for(var g=0;g<a.length;g++){if($(a[g]).hasClass("current")){var c=$(a[g]);c.removeClass("current");break}}var h=g+b;if(h<0){h+=a.length}if(h>=a.length){h=0}var d=$(a[h]);d.addClass("current");var f=$(c).css("zIndex");d.css("zIndex",Number(f)+10);animationInProgress=true;var e=parseFloat(d.css("width"));d.css(h%2?"right":"left",(e*b)/4+"px");d.css("display","block");d.css("opacity","0");if(h%2){d.animate({right:0,opacity:1},homepage_slide_animation_speed,onSlideAnimationComplete)}else{d.animate({left:0,opacity:1},homepage_slide_animation_speed,onSlideAnimationComplete)}}function onSlideAnimationComplete(){animationInProgress=false;time_out=setTimeout(onSlideNextClick,homepage_slide_animation_timeout)};
