var xmldata;
var servicedata;
var defaultservicetitle;
var defaultservicedesc;

var pillarsxmldata;
var pillarsdata;
var defaultpillarstitle;
var defaultpillarsdesc;

function getBaseURL() {
    var url = location.href;  // entire url including querystring - also: window.location.href;
    var baseURL = url.substring(0, url.indexOf('/', 14));


    if (baseURL.indexOf('http://localhost') != -1) {
        // Base Url for localhost
        var url = location.href;  // window.location.href;
        var pathname = location.pathname;  // window.location.pathname;
        var index1 = url.indexOf(pathname);
        var index2 = url.indexOf("/", index1 + 1);
        var baseLocalUrl = url.substr(0, index2);

        return baseLocalUrl + "/";
    }
    else {
        // Root Url for domain name
        return baseURL + "/";
    }
}

var host = getBaseURL();

this.randomquote = function(){
	var length = $("div.randomQuote blockquote").length;
	var ran = Math.floor(Math.random()*length);
	$("div.randomQuote blockquote:eq(" + ran + ")").show();
};




//GETTING URL VARIABLES FOR VARIOUS (SEARCH OR OTHERWISE) FUNCTIONS
$.extend({
  getUrlVars: function(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
      hash = hashes[i].split('=');
      vars.push(hash[0]);
      vars[hash[0]] = hash[1];
    }
    return vars;
  },
  getUrlVar: function(name){
    return $.getUrlVars()[name];
  }
});


//var buttonWidth;
$(document).ready(function() {
	
	//HoverIntent
	(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
	
	//Highlight Team List
	var title = $('body').attr('class');
	if(title){
	$('div#left-sidebar dd#'+title).addClass('selected');
	}
	
	
	//Box Clicks
	$('div.clickbox').click(function(){
									 window.location = $(this).find('a.learnMore').attr('href')
									 return false
									 });
	
	
	//Navigation z-index fix
	
	$('div#topNavContainer').hover(function(){
			$(this).css('z-index', 100);								
											},
											function(){
												$(this).css('z-index', 1);
											});
	
	
	//Random Quotes
	if($('div.randomQuote').length){
		randomquote();
	}
	
	
	
	//Top Bar Navigation Dropdown
	$('ul.subnav').each(function(){
					var buttonWidth = $(this).parent().width();
					
					$(this).css('width', buttonWidth+'px').children('li').css({'width': buttonWidth+'px'});
						
					
								 });
	
	
	var topNavconfig = {    
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
     interval: 100, // number = milliseconds for onMouseOver polling interval    
     over: tnDrop, // function = onMouseOver callback (REQUIRED)    
     timeout: 250, // number = milliseconds delay before onMouseOut    
     out: tnRaise // function = onMouseOut callback (REQUIRED)    
	};

	
	function tnDrop(){
							var buttonWidth = $(this).width();
							$(this).addClass('hovering');
							var subnav = $(this).find('ul.subnav');
							
							//subnav
							
							

							$(subnav).slideToggle('medium');

							/*
							REPLACE THIS
							subnav.slideDown().children('li').animate({ 
								opacity: 1
								  }, 300 ).find('a').each(function(){
										  var buttonHeight = $(this).height();
													  $(this).parent('li').css({'height': buttonHeight+'px'});
								  });*/
	}
	
	function tnRaise(){
	$(this).removeClass('hovering').find('ul.subnav').slideToggle('medium');
	}
	
	$('li.tn-button:has(ul.subnav)').hoverIntent(topNavconfig);

	
//	$('li.tn-button').hover(
//							function(){
//							buttonWidth = $(this).width();
//							$(this).addClass('hovering');
//							var subnav = $(this).find('ul.subnav');
//							subnav.css('width', buttonWidth+'px');
//							//subnav
//							subnav.slideDown().children('li').css({'opacity' : '0', 'width': buttonWidth+'px'}).animate({ 
//								opacity: 1,
//								  }, 300 );
///*							subnav.slideDown('slow', function(){
//															  $(this).children('li').css({'opacity' : '0', 'width': buttonWidth+'px'}).animate({ 
//								opacity: 1,
//								  }, 300 );
//															  });*/
//							},
//							function(){
//							$(this).removeClass('hovering').find('ul.subnav').slideUp().children('li').animate({ 
//								opacity: 0,
//								  }, 300 );								
//							});
	
	
	
	
	//Services Graphic Actions
	
		//load up xml data
	if($('#Map').length){
	
	$.ajax({
        type: "GET",
	url: "/data/services.xml",
	dataType: "xml",
	success: function(xml) {
 			xmldata = xml
	}
});
		
	}
	
	defaultservicetitle = $('dt#inner-header').text();
	defaultservicedesc = $('dd#inner-desc').text();
	


	
	$('#Map area').hover(
				function(){
				var areaid = $(this).attr('id');				 
				
				switch(areaid)
        {
            case "area-1":
			$('div#services-bkg').css('background-position', '0 -524px');
           	
		   	
			break;
            case "area-2":
			$('div#services-bkg').css('background-position', '0 -1048px');
            
			break;
            case "area-3":
			$('div#services-bkg').css('background-position', '0 -1572px');
            
			break;
            case "area-4":
			$('div#services-bkg').css('background-position', '0 -2096px');
            
			break;
            case "area-5":
			$('div#services-bkg').css('background-position', '0 -2620px');
            
			break;
            case "area-6":
			$('div#services-bkg').css('background-position', '0 -3144px');
            
			break;
            case "area-7":
			$('div#services-bkg').css('background-position', '0 -3668px');
            
			break;
			default: 
			
           
        }

			servicedata = $(xmldata).find('service[id='+areaid+']');
			if(servicedata.length){
			$('dt#inner-header').text($(servicedata).find('heading').text());
		    $('dd#inner-desc').text($(servicedata).find('description').text());
			$('span#arrow').css('background-position', '-396px -30px');
			}
			else{
			$('dt#inner-header').text(defaultservicetitle);
		    $('dd#inner-desc').text(defaultservicedesc);
			$('span#arrow').css('background-position', '-367px -30px');
			}
			$("div#rolloverbox").removeClass('cssframe-dark').addClass('cssframe-darker');
								 },
				function(){
					$('div#services-bkg').css('background-position', '0 0px');
					$('dt#inner-header').text(defaultservicetitle);
		    		$('dd#inner-desc').text(defaultservicedesc);
					$('span#arrow').css('background-position', '-367px -30px');
					$('div#rolloverbox').removeClass('cssframe-darker').addClass('cssframe-dark');
				});
	
	
	//Four Pillars Graphic Actions 
	
		$('#Map-four-pillars area').hover(
				function(){
				var areaid = $(this).attr('id');				 
				
				switch(areaid)
        {
            case "area-1":
			$('div#four-pillars-bkg').css('background-position', '0 -274px');
           	
		   	
			break;
            case "area-2":
			$('div#four-pillars-bkg').css('background-position', '0 -548px');
            
			break;
            case "area-3":
			$('div#four-pillars-bkg').css('background-position', '0 -822px');
            
			break;
            case "area-4":
			$('div#four-pillars-bkg').css('background-position', '0 -1096px');
            
			default: 
			
           
        }

		
								 },
				function(){
					$('div#four-pillars-bkg').css('background-position', '0 0px');
				});
		
	if($('div#four-pillars-gallery').length){
	$('div#industries-gallery').css('width', '700px');
	var industryScrollable = $("div.scrollable").scrollable({
									size:1,
									clickable:false,
									api:true
															
															});

	var industryPop = $("div#four-pillars-gallery").overlay({  // one configuration property 
    
 
    // another property 
     // optional exposing effect 
    expose: '#595959', 
	api: true})	
	}
	
	
	
	
	
	$('a.four-pillar-click').click(function(){
				
				
				var areaindex = $(this).attr('rel');
			//	$('#gallery div.popupContent').empty().load('data/industries-popup-html.php #'+areaid)
				industryPop.load();	
				industryScrollable.seekTo(areaindex-1);
				
						 return false;
						 });
	
	
	$('#Map-four-pillars area').click(function(){
												   
			var areaid = $(this).attr('id');
			var areaindex = $(this).attr('rel');
			//	$('#gallery div.popupContent').empty().load('data/industries-popup-html.php #'+areaid)
				industryPop.load();	
				industryScrollable.seekTo(areaindex-1);
															   
											   return false;
											   });
	
/*		//load up xml data
	if($('#Map-four-pillars').length){
	
	$.ajax({
        type: "GET",
	url: "data/four-pillars.xml",
	dataType: "xml",
	success: function(xml) {
 			pillarsxmldata = xml
	}
});
		
	}
	
	defaultpillarstitle = $('dt#inner-header').text();
	defaultpillarsdesc = $('dd#inner-desc').text();
	

	
	
	$('#Map-four-pillars area').hover(
				function(){
				var areaid = $(this).attr('id');				 
				
				switch(areaid)
        {
            case "area-1":
			$('div#four-pillars-bkg').css('background-position', '0 -274px');
           	
		   	
			break;
            case "area-2":
			$('div#four-pillars-bkg').css('background-position', '0 -548px');
            
			break;
            case "area-3":
			$('div#four-pillars-bkg').css('background-position', '0 -822px');
            
			break;
            case "area-4":
			$('div#four-pillars-bkg').css('background-position', '0 -1096px');
            
			default: 
			
           
        }

			pillarsdata = $(pillarsxmldata).find('pillar[id='+areaid+']');
			if(pillarsdata.length){
			$('dt#inner-header').text($(pillarsdata).find('heading').text());
		    $('dd#inner-desc').text($(pillarsdata).find('description').text());
			$('span#arrow').css('background-position', '-396px -30px');
			}
			else{
			$('dt#inner-header').text(defaultpillarstitle);
		    $('dd#inner-desc').text(defaultpillarsdesc);
			}
			$("div#rolloverbox").removeClass('cssframe-dark').addClass('cssframe-darker');
								 },
				function(){
					$('div#four-pillars-bkg').css('background-position', '0 0px');
					$('dt#inner-header').text(defaultpillarstitle);
		    		$('dd#inner-desc').text(defaultpillarsdesc);
					$('div#rolloverbox').removeClass('cssframe-darker').addClass('cssframe-dark');
				});
*/	
	

	
	//FORMS
	
	$('form#cotendoContact').submit(function(){
										
	 
											 return false;
											 
											 });
	
	
	$('form#cotendoPushToStart').submit(function(){
											 
											 return false;
											 
											 });
	
	
	
	
	//Search
	
	
	$('input.searchbox').focus(function() {
	if($(this).val() == "Search"){
  			$(this).val('');
	}
})
//	$('form#sitesearch').submit(function(){
//						
//	//					alert("You searched for: " + $('input#searchterm').val());
//
//	 
//								
//											 
//											 });



	
	//Team Rollover Switches
	    /*
        1st parameter: Images to be selected.
        2nd parameter: Preload the image or not, default = true.
        3rd parameter: Repeat the effect or not, default = true.
        4th parameter: Event for swap In, default = mouseenter.
        5th parameter: Event for swap Out, default = mouseleave.

        Valid events such as: mouseenter, mouseleave, click, dblclick.
    */
		if($('img.swapImage').length){
		$.swapImage('img.swapImage');
		}

	
	
	//Image Buttons and Galleries http://flowplayer.org/tools/overlay.html
	
	
	$('a.freetrial').hide();
	//Global Vars for overlay
	var overlayopts = {
		 // each trigger uses the same overlay with the id "gallery" 
    target: '#gallery', 
 
    // optional exposing effect 
    expose: '#595959',
	onLoad: function(event){$('a.freetrial').delay(2000).fadeIn(1000)},
	onClose: function(event){$('a.freetrial').hide()}
	}
	
	var galopts = {
		autohide: false,
		template: '<h4>${title}</h4> <span>Image ${index} of ${total}</span>',
		opacity: 1
	}
	//Apply the overlay and gallery
	if($('a.screenshotIMG-small').length){
	$("div.screenshot a.screenshotIMG-small").overlay(overlayopts).gallery(galopts);
	}
	//Do it for the large version as well
	//Apply the overlay and gallery
	if($('a.screenshotIMG-large').length){
	$("div.screenshot a.screenshotIMG-large").overlay(overlayopts).gallery(galopts);
	}
	//Separate the image button from the enlarge button so that there aren't duplicates
	if($('a.screenshotEnlarge').length){
	$("div.screenshot a.screenshotEnlarge").overlay(overlayopts).gallery(galopts);
	}
	
	
	//CASE STUDY FORMS
	$('div.category').each(function(){
									var container = $(this);
									var icon = $(this).children('div.category-icon');
									icon.css('height', container.css('height'));
									});

//var vidloader = $('#vidloader').data('overlay');
//var vidloaderopts =  {
//		 // each trigger uses the same overlay with the id "gallery" 
//    target: '#vidloader', 
// 
//    // optional exposing effect 
//    expose: '#595959'
//	,onBeforeLoad: function(event){
//		$("div#vidloader").css({'height' : '400px', 'width' : '1000px'})
//	//	$("div#vidcontainer").css({'height' : '650px', 'width' : '1000px'})
//	}
//	,onLoad: function(event){
//		flashembed('#vidcontainer',"flash/home_animation.swf");
//		/*$("#vidloader div#vidcontainer").flashembed("flash/home_animation.swf");*/
//	
//		}
//	,onClose: function(event){}
//	};
	

$('a.vidloader').overlay({
	// each trigger uses the same overlay with the id "gallery" 
    target: '#vidloader', 
    // optional exposing effect 
    expose: '#595959'
	,onBeforeLoad: function(event){
		var trigger = this.getTrigger();
		
		$("div#vidloader").css({'height' : '650px', 'width' : '1000px'})
	}
	,onLoad: function(event){
		var trigger = this.getTrigger();
		var href = trigger.attr("href");
		flashembed('#vidcontainer', {
				src: 'flash/FLVPlayer_Progressive.swf'   
				   },
			   		{
				MM_ComponentVersion: 1,
				skinName:"flash/Clear_Skin_2",
				streamName: '../'+href,
				autoPlay: true,
				autoRewind: false

});
		/*$("#vidloader div#vidcontainer").flashembed("flash/home_animation.swf");*/
	
		}
	,onClose: function(event){}
	});

	$('a.catheader').click(function(){
									
									});
/*	$('a.downloadafterform').each(function(){
										  var tag = $(this);
										  var id = tag.attr('id');
									   tag.parent().after('<div></div>');
									   tag.parent().next('div').addClass('dlformarea').attr('id', id).after('<div class="clear"></div>');
										   });*/
	
	$('a.downloadafterform').overlay({
	 target: '#formholder', 
    // optional exposing effect 
    expose: '#595959'
	,onBeforeLoad: function(event){
		var button = this.getTrigger();
		var file = button.attr('href');
		var type = button.attr('rel');

		if(!type){
		type = 'resource'	
		}
			if(type == 'url'){
				file = encodeURIComponent(file);
			}
		
		var base = host+"thank-you/?"+type+"="
		//var form = button.attr('rel');
		//var id = button.attr('id');
		//alert(getBaseURL())
		var iconclass = button.parents('.category').attr('id');
		var form = $('#formholder');
		$('input.full-return-file').val(base+file);
		$('input#full-retURL').val(base+file);
		$('form .submit').click(function(){
		_gaq.push(['_trackEvent', 'Resources Form', 'Submit', 'Get Resource', file]);				
											  
											   })
		//_gaq.push(['_trackEvent', 'Resources Form', 'Submit', 'Get Resource', file]);
		form.children('.rounded').attr('id', iconclass)
		//var container = $('#formcontainer');
		/*container.load(form,function(){
								$(this).find('input#00NA0000004AYnl').attr('value','files/' +file);
								var containerwidth = container.children().width() + 15;
								shell.css('width', containerwidth + 'px');
								 })*/
		
		
		//var shell = $('#formcontainer');
		
	}
	,onLoad: function(event){


	}
									 });
									 
$('a.downloadafterform-short').overlay({
	 target: '#formholder-short', 
    // optional exposing effect 
    expose: '#595959'
	,onBeforeLoad: function(event){
		var button = this.getTrigger();
		var file = button.attr('href');
		var type = button.attr('rel');
		if(!type){
		type = 'resource'	
		}
			if(type == 'url'){
				file = encodeURIComponent(file);
			}
		
		var base = host+"thank-you/?"+type+"="
		//var form = button.attr('rel');
		//var id = button.attr('id');
		//alert(getBaseURL())
		var iconclass = button.parents('.category').attr('id');
		var form = $('#formholder-short');
		var filenameextensionlessIndex = file.lastIndexOf( '.' );
		var filenameextensionless = file.substr(0,filenameextensionlessIndex);
		$('input.short-return-file').val(base+file);
		$('input#short-retURL').val(base+file);
		$('form .submit').click(function(){
		//_gaq.push(['_trackEvent', 'Resources Form', 'Submit', 'Get Resource ' + filenameextensionless]);				
											  
											   })
		//_gaq.push(['_trackEvent', 'Resources Form', 'Submit', 'Get Resource', file]);
		form.children('.rounded').attr('id', iconclass)
		//var container = $('#formcontainer');
		/*container.load(form,function(){
								$(this).find('input#00NA0000004AYnl').attr('value','files/' +file);
								var containerwidth = container.children().width() + 15;
								shell.css('width', containerwidth + 'px');
								 })*/
		
		
		//var shell = $('#formcontainer');
		
	}
	,onLoad: function(event){


	}
									 });								 
								 
									 
/*	$('a.downloadafterform').click(function(){
			var button = $(this);								
			var form = $(this).attr('href');
			var file = $(this).attr('rel');
			var id = $(this).attr('id');
			var shell = button.parent().siblings('div#'+ id);
			//shell.hide();
			//button.fadeOut(500, function(){
										 shell.siblings('.dlformarea').slideUp(1000);
									//	 shell.children('a.downloadcasestudy').delay(1000).fadeIn(1000);
			shell.load(form, function() {
 					// alert('Load was performed.');
					shell.find('form').css('opacity', 0);
					shell.find('input#00NA0000004AYnl').attr('value', 'files/' + file);
					shell.slideDown(1000, function(){
										$(this).find('form').animate({ 
    
    opacity: 1,
  }, 1000 );
		   })
				});						
				//						})
			
			return false;
											
											});*/

$('a.downloadform').overlay({
	 target: '#formholder', 
    // optional exposing effect 
    expose: '#595959'
	,onBeforeLoad: function(event){
		//var button = this.getTrigger();
//		var file = button.attr('href');
//		var form = button.attr('rel');
//		var id = button.attr('id');
//		var shell = this.getOverlay();
//		var container = $('#formcontainer');
//		container.load(form,function(){
//								$(this).find('input#00NA0000004AYnl').attr('value','files/' +file);
//								var containerwidth = container.children().width() + 15;
//								shell.css('width', containerwidth + 'px');
//								 })
//		
//		
//		//var shell = $('#formcontainer');
//		
	}
	,onLoad: function(event){


	}
									 });
	


if($('#outerFrame.thank-you').length){
var resource = $.getUrlVar('resource')
var url = $.getUrlVar('url')
var redirect = $.getUrlVar('redirect')
var source = $.getUrlVar('source')
var base = 'http://www.cotendo.com/'

if(resource){
	$('h1#thanks-title').text('Thank You');
	$('#file-actions').show();
	$('a#manual-download').attr('href', base+resource);
	 setTimeout("window.location.href = '"+base+resource+"';", 5000);
 
}else if (url){
	url = decodeURIComponent(url)
	$('h1#thanks-title').text('Thank You');
	$('#file-actions').show();
	$('a#manual-download').attr('href', url);
	 setTimeout("window.location.href = '"+url+"';", 5000);
}else if (redirect){
	url = decodeURIComponent(base+redirect)
	$('h1#thanks-title').text('Thank You');
	$('#file-actions').show();
	$('a#manual-download').attr('href', url+'?source='+source);
	 setTimeout("window.location.href = '"+url+'?source='+source+"';", 5000);
}else{
	$('h1#thanks-title').text('Thank You For Contacting Us');
	$('#contact-actions').delay(2000).slideDown(600);
	$('#file-actions').hide();
}
}

function goURL(url){
	
}


if($('#webinar-container').length){
var url = $.getUrlVar('source');
var flashvars = {
	skinName: "/flash/Clear_Skin_2",
	streamName: url
};
var params = {};
var attributes = {
	data: "/flash/FLVPlayer_Progressive.swf"
};
swfobject.embedSWF("/flash/FLVPlayer_Progressive.swf", "webinar-container", "922", "600", "9.0.0", "/flash/expressInstall.swf", flashvars, params, attributes );
}


//REGION DROPDOWN
/*$('span#Regions').hover(
  function () {
    $(this).addClass("hover").children('ul#regionSelector').slideDown();
	
  },
  function () {
    $(this).removeClass("hover").children('ul#regionSelector').slideUp();
  }
)*/
var regionNavConfig = {    
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
     interval: 100, // number = milliseconds for onMouseOver polling interval    
     over: rnDrop, // function = onMouseOver callback (REQUIRED)    
     timeout: 250, // number = milliseconds delay before onMouseOut    
     out: rnRaise // function = onMouseOut callback (REQUIRED)    
	};

var regionDropper = $('span#Regions');
var regionSelector = $('ul#regionSelector');
 
function rnDrop(){
regionDropper.addClass("hover")
regionSelector.show().delay(200).children('li').animate({opacity:1},400);

}

function rnRaise(){
regionDropper.removeClass("hover")
									regionSelector.hide().children('li').css({opacity:0})
									
}

regionDropper.tooltip({

		// use div.tooltip as our tooltip
		tip: '#regionSelectorDiv',

		// use the fade effect instead of the default
	//	effect: 'fade',

		// make fadeOutSpeed similar to the browser's default
	//	fadeOutSpeed: 100,

		// the time before the tooltip is shown
	//	predelay: 400,
	
		delay: 300,

		// tweak the position
		position: "bottom left",
		offset: [0, 50]
	});

//regionDropper.hoverIntent(regionNavConfig);


/*	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});*/

/*Conduit Case Study Gateway redirect */
$('a[href$="conduit_case_study.pdf"]').attr('href', 'http://info.cotendo.com/cotendo-case-study/').attr('target', '_blank');
	
	
/*Validation*/
if($("#formholder form").length){
$("#formholder form").validate({
		
			rules: {
			first_name: "required",
			last_name: "required",
			country: "required",
			company: "required",
		//	phone: 'required',
			
			email: {
				required: true,
				email: true
			}	
		},
		messages: {
			first_name: "Please enter your First Name",
			last_name: "Please enter your Last Name",
			email: "Please enter a valid email address",
			country: "Please enter your country",
			company: "Please enter your company name",
		//	phone: 'Please enter your phone number'
                    }
	});
}
if($("#formholder-short form").length){
$("#formholder-short form").validate({
		
			rules: {
			first_name: "required",
			last_name: "required",
			
			email: {
				required: true,
				email: true
			}
			
		},
		messages: {
			first_name: "Please enter your First name",
			last_name: "Please enter your Last name",
			email: "Please enter a valid email address"
                    }
	});
	
}
	
	$('.lang-landing.index a#logo').each(function(){
		$(this).attr('href', 'http://cotendo.com') 
		$(this).attr('onclick', "_gaq.push(['_link', 'http://cotendo.com']); return false;")
	})
	
});
