function HomeLayoutLoad()
{
	jQuery.getFeed({
		url: 'NetsizeNews.xml',
		success: function(feed) {

			var titles = '<ul>';
			for(i = 0; i < 3; i++)
			{
				titles += '<li><a href="'+ feed.items[i].link + '" target="_blank">' + feed.items[i].title  +'</a></li>';
			}
			titles += '</ul>';
			
			if (titles != "") 
			{
				$(".scroller").html(titles);
				
				$(".scroller").jCarouselLite({
					vertical: true,
					hoverPause:true,
					visible: 1,
					auto: 3000,
					speed:1000
				});
			}
	
		}    
	});
	
	headerLoad();

	//$(".Header").load("../template/header.html", "", function(){ setRememberMeValue(); });
	$(".Footer").load("../template/footerHome.html", "", function(){ tb_init('a.thickbox'); });
}

function headerLoad()
{
	var megaHoverOver = function(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show(); //Find sub and fade it in
		(function($) {
			//Function to calculate total width of all ul's
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				$(this).find("ul").each(function() { //for each ul...
					rowWidth += $(this).width(); //Add each ul's width together
				});
			};
			
			//var dropShadowZindex = 1;  //z-index counter
//			
//			$.fn.dropShadow = function(options)
//			{
//				// Default options
//				var opt = $.extend({
//					left: 4,
//					top: 4,
//					blur: 2,
//					opacity: .5,
//					color: "black",
//					swap: false
//				}, options);
//				var jShadows = $([]);  //empty jQuery collection
//			
//				// Loop through original elements
//				this.not(".dropShadow").each(function()
//				{
//					var jthis = $(this);
//					var shadows = [];
//					var blur = (opt.blur <= 0) ? 0 : opt.blur;
//					var opacity = (blur == 0) ? opt.opacity : opt.opacity / (blur * 8);
//					var zOriginal = (opt.swap) ? dropShadowZindex : dropShadowZindex + 1;
//					var zShadow = (opt.swap) ? dropShadowZindex + 1 : dropShadowZindex;
//				
//					// Create ID for shadow
//					var shadowId;
//					if (this.id) { shadowId = this.id + "_dropShadow";	}
//					else { shadowId = "ds" + (1 + Math.floor(9999 * Math.random())); }
//				
//					// Modify original element
//					$.data(this, "shadowId", shadowId); //store id in expando
//					$.data(this, "shadowOptions", options); //store options in expando
//					jthis.attr("shadowId", shadowId).css("zIndex", zOriginal);
//					if (jthis.css("position") != "absolute") {jthis.css({ position: "relative",	zoom: 1   });
//				}
//			
//				// Create first shadow layer
//				bgColor = jthis.css("backgroundColor");
//				if (bgColor == "rgba(0, 0, 0, 0)") bgColor = "transparent";  //Safari
//				if (bgColor != "transparent" || jthis.css("backgroundImage") != "none" 
//				  || this.nodeName == "SELECT" 
//				  || this.nodeName == "INPUT"
//				  || this.nodeName == "TEXTAREA") {   
//				shadows[0] = $("<div></div>")
//				  .css("background", opt.color);                
//				}
//				else {
//				shadows[0] = jthis
//				  .clone()
//				  .removeAttr("id")
//				  .removeAttr("name")
//				  .removeAttr("shadowId")
//				  .css("color", opt.color);
//				}
//				shadows[0]
//				.addClass("dropShadow")
//				.css({
//				  height: jthis.outerHeight(),
//				  left: blur,
//				  opacity: opacity,
//				  position: "absolute",
//				  top: blur,
//				  width: jthis.outerWidth(),
//				  zIndex: zShadow
//				});
//			
//				// Create other shadow layers
//				var layers = (8 * blur) + 1;
//				for (i = 1; i < layers; i++) {	shadows[i] = shadows[0].clone(); }
//			
//				// Position layers
//				var i = 1;      
//				var j = blur;
//				while (j > 0) {
//					shadows[i].css({left: j * 2, top: 0});           //top
//					shadows[i + 1].css({left: j * 4, top: j * 2});   //right
//					shadows[i + 2].css({left: j * 2, top: j * 4});   //bottom
//					shadows[i + 3].css({left: 0, top: j * 2});       //left
//					shadows[i + 4].css({left: j * 3, top: j});       //top-right
//					shadows[i + 5].css({left: j * 3, top: j * 3});   //bottom-right
//					shadows[i + 6].css({left: j, top: j * 3});       //bottom-left
//					shadows[i + 7].css({left: j, top: j});           //top-left
//					i += 8;
//					j--;
//				}
//			
//				// Create container
//				var divShadow = $("<div></div>")
//				.attr("id", shadowId) 
//				.addClass("dropShadow")
//				.css({
//				  left: jthis.position().left + opt.left - blur,
//				  marginTop: jthis.css("marginTop"),
//				  marginRight: jthis.css("marginRight"),
//				  marginBottom: jthis.css("marginBottom"),
//				  marginLeft: jthis.css("marginLeft"),
//				  position: "absolute",
//				  top: jthis.position().top + opt.top - blur,
//				  zIndex: zShadow
//				});
//			
//				// Add layers to container  
//				for (i = 0; i < layers; i++) {	divShadow.append(shadows[i]); }
//			
//				// Add container to DOM
//				jthis.after(divShadow);
//				
//				// Add shadow to return set
//				jShadows = jShadows.add(divShadow);
//			
//				// Re-align shadow on window resize
//				$(window).resize(function()
//				{
//					try {
//					  divShadow.css({left: jthis.position().left + opt.left - blur,top: jthis.position().top + opt.top - blur });
//					}
//					catch(e){}
//					});
//			
//					// Increment z-index counter
//					dropShadowZindex += 2;
//			
//				});  //end each
//			
//				return this.pushStack(jShadows);
//			};			
//			
//			$.fn.removeShadow = function()
//			{
//				return this.each(function()
//				{
//				  var shadowId = $(this).shadowId();
//				  $("div#" + shadowId).remove();
//				});
//			};
//			
//			$.fn.shadowId = function() { return $.data(this[0], "shadowId"); };			
			
			
		})(jQuery); 
	
		if ( $(this).find(".row").length > 0 ) { //If row exists...
	
			var biggestRow = 0;	
	
			$(this).find(".row").each(function() {	//for each row...
				$(this).calcSubWidth(); //Call function to calculate width of all ul's
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
	
			//$(this).find(".sub").css({'width' :biggestRow}).dropShadow({left:0, top:-2, opacity: 0.4}); //Set width
			$(this).find(".row:last").css({'margin':'0'});  //Kill last row's margin
	
		} else { //If row does not exist...
	
			$(this).calcSubWidth();  //Call function to calculate width of all ul's
			//$(this).find(".sub").css({'width' : rowWidth}).dropShadow({left:2, top:2, opacity: 0.4}); //Set Width
	
		}
	
	};
	
	var megaHoverOut = function(){
		$(this).find(".sub").stop().fadeTo('fast', 0, function() { //Fade to 0 opactiy
			  $(this).hide();  //after fading, hide it
		 })//.removeShadow();
	
	};
	
	var callback = function (){
		$('#country').sSelect().change(function(){ $(location).attr('href',$(this).find("option:selected").val()); });	
		
		//Set custom configurations
		var config = {
			 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
			 interval: 100, // number = milliseconds for onMouseOver polling interval
			 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
			 timeout: 50, // number = milliseconds delay before onMouseOut
			 out: megaHoverOut // function = onMouseOut callback (REQUIRED)
		};

		//$("ul#topnav li .sub").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
		$("ul#topnav li .sub").hide();
		$("ul#topnav li").hoverIntent(config); //Trigger Hover intent with custom configurations
		
	};

	        var tldUrl = window.parent.location.href;
	        var tldArray1 = tldUrl.split("/");
	        var tldArray2 = tldArray1[2].split(".");
	        var tld = tldArray2[tldArray2.length-1];
	        var tldHeaderfile = "";
	        if (tld == "com") {
		        tldHeaderfile = "header.html"; //change to header.html before uploading
	        }
	        else if (tld == "es") {
		        tldHeaderfile = "header-es.html";
	        }
	        else if (tld == "fr") {
		        tldHeaderfile = "header-fr.html";
	        }
	        else if (tld == "nl") {
		        tldHeaderfile = "header-nl.html";
	        }
	        else {
		        tldHeaderfile = "header.html";
	        };

	//alert("pageload:"+tldHeaderfile);
	$(".Header").load("../template/"+tldHeaderfile, callback);	// ../template/header.html
}

function LayoutLoad(callback)
{	
	headerLoad();
	$(".Footer").css("height", "300px");
	//$(".Header").load("../template/header.html");
	if(callback)
	{
		$(".Footer").load("../template/footer.html", "", callback);
	}
	else
	{
		$(".Footer").load("../template/footer.html", "", function(){ tb_init('a.thickbox'); });
	}
}
//
//function LeftMenuLoad()
//{
//	var filename = location.pathname.substring(1); 
//	var leftMenuId = $(".LeftPart_Globlal").attr('id');
//	
//	switch (leftMenuId){
//	case "ContactUsLeftMenu": 
//		$(".LeftPart_Globlal").load("../template/leftmenu/lm_ContactUs.html");
//		break;
//	case "InfoLeftMenu": 
//		$(".LeftPart_Globlal").load("../template/leftmenu/lm_Info.html");
//		break;
//	case "AboutUsLeftMenu": 
//		$(".LeftPart_Globlal").load("../template/leftmenu/lm_AboutUs.html");
//		break;
//	case "ProductsLeftMenu": 
//		$(".LeftPart_Globlal").load("../template/leftmenu/lm_Products.html");
//		break;
//	case "MarketSolutionsLeftMenu": 
//		$(".LeftPart_Globlal").load("../template/leftmenu/lm_MarketSolutions.html");
//		break;
//	case "NewsEventsLeftMenu": 
//		$(".LeftPart_Globlal").load("../template/leftmenu/lm_NewsEvents.html");
//		break;
//	case "DownloadsLeftMenu": 
//		$(".LeftPart_Globlal").load("../template/leftmenu/lm_Downloads.html", "", function(){ setDownloadsLeftMenu(filename);});
//		break;
//	case "DevelopersLeftMenu": 
//		$(".LeftPart_Globlal").load("../template/leftmenu/lm_Developers.html");
//		break;			
//	
//	default : alert("Not have leftmenu");
//	}
//}
//
//function setDownloadsLeftMenu(filename)
//{
//	var className = '';
//	if($('a[href=' + filename + ']').parents("ul:first").attr("class") != "")
//	{
//		className = $('a[href=' + filename + ']').parents("ul:first").attr("class");
//		$('ul#businessCases > li > ul[class!='+ className +']').hide();
//	}
//	else if($('a[href=' + filename + ']').next("ul").attr("class") != "")
//	{
//		className = $('a[href=' + filename + ']').next("ul").attr("class");
//		$('ul#businessCases > li > ul[class!='+ className +']').hide();
//	}
//	else
//	{
//		$('ul#businessCases > li > ul').hide();
//	}
//	
//}

function GuideLoad()
{
	var callback = function() { 
								tb_init('a.thickbox');
								if ($(document).getUrlParam("id") == "registered")
								{ $("a[id=ViewLink]").click(); }
					  		  };
	LayoutLoad(callback);							  
}

function loadLegalText($legalTextContent, lang)
{
	if($legalTextContent.html() ==  "")
	{
		if (lang)
			$legalTextContent.load("../template/formular/LegalText_"+ lang +".html");
		else
			$legalTextContent.load("../template/formular/LegalText.html");
	}
	
	$legalTextContent.show();
}

function SwitchFormClick(formId, legalTextDisplay)
{
	$legalTextContent = $("#LegalContent");
	
	if(legalTextDisplay) {	loadLegalText($legalTextContent, "");	}
	else {	$legalTextContent.hide();	}
		
	$(".FormContent[id!=" + formId + "]").hide("");	
	
	$currentFormContent = $(".FormContent[id=" + formId + "]");
	
	if($currentFormContent.html() ==  "")
		$currentFormContent.load("../template/formular/" + formId + ".html", "", function(){ $("textarea[maxlength]").textLimiter(); });
	
	$currentFormContent.show();
}

function FormLoad()
{
	LayoutLoad();
	
	var $formContent = $(".FormContent");
	var $legalTextContent = $("#LegalContent");
	
	
	switch ($formContent.attr('id')){
		case "ContactUs": 
			contactUsLoad();
			break;
		case "UpdateYourProfile": 
			updateYourProfileLoad($formContent, $legalTextContent, $(document).getUrlParam("language"));		
			break;	
		case "Developer": 
			$formContent.load("../template/formular/DeveloperForm.html", "", function(){ $("textarea[maxlength]").textLimiter(); });
			loadLegalText($legalTextContent, "");
			break;
		case "Webinar_mMarketing":
			$formContent.load("../template/formular/Webinar_mMarketingForm.html");
			loadLegalText($legalTextContent, "");
			break;
		case "Webinar_Russia":
			$formContent.load("../template/formular/Webinar_RussiaCoverage.html");
			loadLegalText($legalTextContent, "");
			break;
		case "Webinar_SouthAfrica":
			$formContent.load("../template/formular/Webinar_SouthAfricaCoverage.html");
			loadLegalText($legalTextContent, "");
			break;
		case "NMSSurveyForm":
			$formContent.load("../template/formular/NMSSurveyForm.html", "", function(){ fillForm(); });
			loadLegalText($legalTextContent, "");
			break;
		case "NMSSurveyForm_MSG":
			$formContent.load("../template/formular/NMSSurveyForm_MSG.html", "", function(){ fillForm(); });
			loadLegalText($legalTextContent, "");
			break;			
	}	
}

function contactUsLoad()
{
	var youAre = $(document).getUrlParam("youare");
	var youAreDpDwnList = $("#YouAreDpDwnList");	
	
	if(youAre != null) 
	{
		youAreDpDwnList.val(youAre);
		FormContentLoad(youAre);
	}
	else
	{
		youAreDpDwnList.val("None");
	}
}

function IndividualLoad()
{
	LayoutLoad();	
	
	var helpdesk = $(document).getUrlParam("helpdesk");
	var $languageDdl = $("#LanguageDpDwnList");	
	
	if(helpdesk != null) 
	{
		$languageDdl.val(helpdesk);
		LoadLanguageForm(helpdesk);
	}
	else
	{
		$languageDdl.val("None");
	}
}

function FormContentLoad(youAre) 
{	
	var $formContent = $(".FormContent");
	var $legalTextContent = $("#LegalContent");
	
	switch (youAre){
		case "Company": 
			$formContent.load("../template/formular/CompanyForm.html", "", function(){ $("textarea[maxlength]").textLimiter(); });
			loadLegalText($legalTextContent, "");
			$(".RightPart_Column[id!=ContactFrance]").hide();
			$(".RightPart_Column[id=ContactCompany]").show();		
			break;
		
		case "Journalist": 
			$formContent.load("../template/formular/JournalistForm.html", "", function(){ $("textarea[maxlength]").textLimiter(); });
			loadLegalText($legalTextContent, "");
			$(".RightPart_Column[id!=ContactFrance]").hide();
			$(".RightPart_Column[id=ContactPress]").show();		
			break;

		case "Newsletter": 
			$formContent.load("../template/formular/NewletterForm.html");
			loadLegalText($legalTextContent, "");
			$(".RightPart_Column[id!=ContactFrance]").hide();
			$(".RightPart_Column[id=ContactCompany]").show();
			break;

		case "Job": 
			$formContent.load("../template/formular/JobForm.html");
			$("#LegalContent").hide();
			$(".RightPart_Column[id!=ContactFrance]").hide();	
			break;
	}
}

function updateYourProfileLoad($formContent, $legalTextContent, lang)
{
	if(lang)
	{
		$formContent.load("../template/formular/UpdateYourProfileForm_"+ language +".html", "", function(){ fillForm(); });
		loadLegalText($legalTextContent, lang);
	}
	else
	{
		$formContent.load("../template/formular/UpdateYourProfileForm.html", "", function(){ fillForm(); });
		loadLegalText($legalTextContent, "");
	}
}

function UpdatedProfileLoad()
{
	LayoutLoad(FillUpdatedProfileForm);
}

function FillUpdatedProfileForm()
{
	var lang = $(document).getUrlParam("language");
	
	var titleParam = $(document).getUrlParam("title");
	var firstNameParam = $(document).getUrlParam("firstname");
	var lastNameParam = $(document).getUrlParam("lastname");
	var emailParam = $(document).getUrlParam("email");
	var companyParam = $(document).getUrlParam("company");
	var jobTitleParam = $(document).getUrlParam("jobtitle");
	var subscribeParam = $(document).getUrlParam("subscribe");
	var typeParam = $(document).getUrlParam("type");
	
	if (titleParam != null){ titleParam = titleParam.replace(/\%20/g," "); }
	if (firstNameParam != null){ firstNameParam = firstNameParam.replace(/\%20/g," "); }
	if (lastNameParam != null){ lastNameParam = lastNameParam.replace(/\%20/g," "); }
	if (companyParam != null){ companyParam = companyParam.replace(/\%20/g," "); }
	if (jobTitleParam != null){ jobTitleParam = jobTitleParam.replace(/\%20/g," "); }
	if (typeParam != null){ typeParam = typeParam.replace(/\%20/g,""); }
	
	var contactInfo = $(".UpdatedProfile[lang=en] > span.ContactInfo");
	var unsubscribeInfo = $(".UpdatedProfile[lang=en] > span.Unsubscribe");
	var unsubscribeText = "Unsuscribed to all Newsletter";
	if(lang)
	{
		$(".UpdatedProfile[lang="+ lang +"]").show();
		$(".UpdatedProfile[lang!="+ lang +"]").hide();	
		
		contactInfo = $(".UpdatedProfile[lang="+ lang +"] > span.ContactInfo");
		unsubscribeInfo = $(".UpdatedProfile[lang="+ lang +"] > span.Unsubscribe");
		if (lang == 'nl') { unsubscribeText = "Uw abonnement op de Netsize nieuwsbrieven is stopgezet." };
	}
	else
	{
		$(".UpdatedProfile[lang=en]").show();
		$(".UpdatedProfile[lang!=en]").hide();		
	}
	
	var contactContent = titleParam + " " +  firstNameParam +" " + lastNameParam + ",<br/>";
	contactContent += emailParam + ",<br />";
	contactContent += jobTitleParam + " at " +  companyParam + "<br/>";
	
	contactInfo.html(contactContent);
	
	if (subscribeParam == "false" || subscribeParam == "False")
	{
		unsubscribeInfo.html(unsubscribeText);
	}
	else
	{
		var listetype = typeParam.split(";");
		
		var unsubscribe = "Subscribed to: <br/>";
		
		for (i=0; i < listetype.length; i++)
		{			
			if ( listetype[i] == "Corp") { unsubscribe += "- Corporate <br/>" ;}			
			else if (listetype[i] == "NES") { unsubscribe += "- Entertainment Solutions <br/>" ;}			
			else if (listetype[i] == "NBS") { unsubscribe += "- Business Solutions <br/>" ;}			
			else if (listetype[i] == "NMS") { unsubscribe += "- Merchant Solutions <br/>" ;}			
			else if (listetype[i] == "Press") { unsubscribe += "- Press <br/>" ; }
	   	} 
	   
		unsubscribeInfo.html(unsubscribe);	
	} 
}

function FillActivitiesItems(sector)
{
	var activities = $("select[id=activity]");
	var cloneList = $("select[id=cloneList]").clone();
	
	if (sector) 
	{	
		cloneList.find('option:not(.' + sector +')').remove();
		cloneList.prepend('<option value="None">None</option>');		
		
		activities.empty();
		$(cloneList.find('option')).each( function() {
			var option = '<option value="' + $(this).val() + '">' + $(this).text() + '</option>'
			activities.append(option); 
		} );
		
		var first = activities.find('option:first').val();
		activities.val(first); 
		
		cloneList.empty();
	}
	
}

function MarketSolutionLoad()
{
	LayoutLoad();
	
	var activity = $(document).getUrlParam("activity");		
	LoadTable(activity);	
}

function LoadTable(activity)
{
	var tab = $(".MarketSolutionTab");
	var selectList = $("select:first");
	            
	if(activity)
	{
		tab.load("../template/marketsolutionTabs/"+ activity + ".html", "", function(){ initTabs(tab, activity)});
		selectList.val(activity);
		xitiRecord(activity, 'Solutions');
	}
	else
	{
		activity = selectList.find('option:first').val();
		tab.load("../template/marketsolutionTabs/"+ activity + ".html", "", function(){ initTabs(tab, activity)});
		selectList.val(activity);
		xitiRecord(activity, 'Solutions');
	}	
}

function initTabs(tab, activity)
{
	tab.tabs({ onClick: function(tab) { xitiRecord(activity, tab.text); }}).triggerTab(1);
}

function xitiRecord(activity, name)
{	
	if(activity === undefined || name === undefined) 
		return;
		
	if (name == "Benefits") name = "Overview";
	
	if(activity == "contentProviders" || activity == "handsetManufacturers" || activity == "mobileOperators")
	{	
		xt_click(this,'C','','Ent - ' + activity + ' - ' + name,'N');
	}
	else if(activity == "commerceTrade" || activity == "marketingAgency" || activity == "businessServices")
	{
		xt_click(this,'C','','Bus - ' + activity + ' - ' + name,'N');
	}
	else if(activity == "bankingInsurance" || activity == "transportLogistics" || activity == "industryUtilities" || activity == "publicHealthcare")
	{
		xt_click(this,'C','','Mkt - ' + activity + ' - ' + name,'N');
	}	
}

function fillForm()
{
	var titleParam = $(document).getUrlParam("title");
	var firstNameParam = $(document).getUrlParam("firstname");
	var lastNameParam = $(document).getUrlParam("lastname");
	var emailParam = $(document).getUrlParam("email");
	var companyParam = $(document).getUrlParam("company");
	var jobTitleParam = $(document).getUrlParam("jobtitle");
	var marketParam = $(document).getUrlParam("market");
	var countryParam = $(document).getUrlParam("country");
	var phoneParam = $(document).getUrlParam("phone");
	var mobileParam = $(document).getUrlParam("mobile");
	
	var title = $("#TitleDpDwnList");
	var firstName = $("#FirstNameTbx");
	var lastName =  $("#LastNameTbx");
	var email = $("#EmailTbx");
	var company = $("#CompanyTbx");
	var job = $("#JobTitleTbx");
	var market = $("#MarketDpDwnList");
	var country = $("#CountryDpDwnList");
	var phone = $("#PhoneTbx");
	var mobile = $("#MobilePhoneTbx");
	

	if (titleParam != null && title.length > 0){ title.val(titleParam.replace(/\%20/g," ")); }
	if (firstNameParam != null && firstName.length > 0){ firstName.val(firstNameParam.replace(/\%20/g," ")); }
	if (lastNameParam != null && lastName.length > 0){ lastName.val(lastNameParam.replace(/\%20/g," ")); }
	if (emailParam != null && email.length > 0){ email.val(emailParam); }
	if (companyParam != null && company.length > 0){ company.val(companyParam.replace(/\%20/g," ")); }
	if (jobTitleParam != null && job.length > 0){ job.val(jobTitleParam.replace(/\%20/g," ")); }
	if (marketParam != null && market.length > 0){ market.val(marketParam.replace(/\%20/g," ")); }
	if (countryParam != null && country.length > 0){ country.val(countryParam.replace(/\%20/g," ")); }
	if (phoneParam != null && phone.length > 0){ phone.val(phoneParam); }
	if (mobileParam != null && mobile.length > 0){ mobile.val(mobileParam); }
}



function LanguageSwitcher($langDdl)
{
	var lang = $langDdl.val();
	var $formContent = $(".FormContent");
	if (lang != "None")
	{
		var ahref = "template/formular/language/";
		
		if(lang == "EN")
		{
			$formContent.load(ahref + "Copy of EN"  + ".html");
		}
		else if(lang  == "FR")
		{
			$formContent.load(ahref + "Copy of FR"  + ".html");
		}
	}
}

function NetsizeGuideParty_Load()
{
	LayoutLoad(FillNetsizeGuidePartyForm);
}

function FillNetsizeGuidePartyForm()
{
	var titleParam = $(document).getUrlParam("title");
	var firstNameParam = $(document).getUrlParam("firstname");
	var lastNameParam = $(document).getUrlParam("lastname");
	var emailParam = $(document).getUrlParam("email");
	var companyParam = $(document).getUrlParam("company");	
	
	if (titleParam != null){ titleParam = titleParam.replace(/\%20/g," "); }
	if (firstNameParam != null){ firstNameParam = firstNameParam.replace(/\%20/g," "); }
	if (lastNameParam != null){ lastNameParam = lastNameParam.replace(/\%20/g," "); }
	if (emailParam != null){ emailParam = emailParam.replace(/\%20/g," "); }
	if (companyParam != null){ companyParam = companyParam.replace(/\%20/g," "); }

	$("#TitleDpDwnList").val(titleParam);
	$("#FirstNameTbx").val(firstNameParam);
	$("#LastNameTbx").val(lastNameParam);
	$("#CompanyTbx").val(companyParam);
	$("#EmailTbx").val(emailParam);	

}

//jquery.stylish-select.min.js
(function(a){a("html").addClass("js");Array.prototype.indexOf=function(c,d){for(var b=(d||0);b<this.length;b++){if(this[b]==c){return b}}};a.fn.extend({getSetSSValue:function(b){if(b){a(this).val(b).change();return this}else{return selText=a(this).find(":selected").text()}},resetSS:function(){$this=a(this);$this.next().remove();$this.unbind().sSelect()}});a.fn.sSelect=function(b){return this.each(function(){var j={defaultText:"Please select",animationSpeed:0,ddMaxHeight:""};var m=a.extend(j,b),e=a(this),k=a('<div class="selectedTxt"></div>'),s=a('<div class="newListSelected" tabindex="0"></div>'),A=a('<ul class="newList"></ul>'),u=-1,d=-1,n=[],x=false,h="",w=false;s.insertAfter(e);k.prependTo(s);A.appendTo(s);e.hide();if(e.children("optgroup").length==0){e.children().each(function(B){var C=a(this).text();n.push(C.charAt(0).toLowerCase());if(a(this).attr("selected")==true){m.defaultText=C;d=B}h+="<li>"+C+"</li>"});A.html(h);h="";var y=A.children()}else{e.children("optgroup").each(function(D){var B=a(this).attr("label"),E=a('<li class="newListOptionTitle">'+B+"</li>");E.appendTo(A);var C=a("<ul></ul>");C.appendTo(E);a(this).children().each(function(){++u;var F=a(this).text();n.push(F.charAt(0).toLowerCase());if(a(this).attr("selected")==true){m.defaultText=F;d=u}h+="<li>"+F+"</li>"});C.html(h);h=""});var y=A.find("ul li")}var p=A.height()+3,o=s.height()+3,z=y.length;if(d!=-1){i(d,true)}else{k.text(m.defaultText)}function q(){var C=s.offset().top,B=jQuery(window).height(),D=jQuery(window).scrollTop();if(p>parseInt(m.ddMaxHeight)){p=parseInt(m.ddMaxHeight)}C=C-D;if(C+p>=B){A.css({top:"-"+p+"px",height:p});e.onTop=true}else{A.css({top:o+"px",height:p});e.onTop=false}}q();a(window).resize(function(){q()});a(window).scroll(function(){q()});function t(){s.css("position","relative")}function c(){s.css("position","static")}k.click(function(){if(A.is(":visible")){A.hide();c();return false}s.focus();A.slideDown(m.animationSpeed);t();A.scrollTop(e.liOffsetTop)});y.hover(function(C){var B=a(C.target);B.addClass("newListHover")},function(C){var B=a(C.target);B.removeClass("newListHover")});y.click(function(C){var B=a(C.target);d=y.index(B);w=true;i(d);A.hide();s.css("position","static")});function i(D,F){var B=s.offset().top,G=y.eq(D).offset().top,C=A.scrollTop();if(e.onTop==true){e.liOffsetTop=(((G-B)-o)+C)+parseInt(m.ddMaxHeight)}else{e.liOffsetTop=((G-B)-o)+C}A.scrollTop(e.liOffsetTop);y.removeClass("hiLite").eq(D).addClass("hiLite");var E=y.eq(D).text();if(F==true){e.val(E);k.text(E);return false}e.val(E).change();k.text(E)}e.change(function(B){$targetInput=a(B.target);if(w==true){w=false;return false}$currentOpt=$targetInput.find(":selected");d=$targetInput.find("option").index($currentOpt);i(d,true)});function r(B){B.onkeydown=function(E){if(E==null){var D=event.keyCode}else{var D=E.which}w=true;switch(D){case 40:case 39:v();return false;break;case 38:case 37:l();return false;break;case 33:case 36:g();return false;break;case 34:case 35:f();return false;break;case 13:case 27:A.hide();c();return false;break}keyPressed=String.fromCharCode(D).toLowerCase();var C=n.indexOf(keyPressed);if(typeof C!="undefined"){++d;d=n.indexOf(keyPressed,d);if(d==-1||d==null||x!=keyPressed){d=n.indexOf(keyPressed)}i(d);x=keyPressed;return false}}}function v(){if(d<(z-1)){++d;i(d)}}function l(){if(d>0){--d;i(d)}}function g(){d=0;i(d)}function f(){d=z-1;i(d)}s.click(function(){r(this)});s.focus(function(){a(this).addClass("newListSelFocus");r(this)});s.blur(function(){a(this).removeClass("newListSelFocus");A.hide();c()});k.hover(function(C){var B=a(C.target);B.parent().addClass("newListSelHover")},function(C){var B=a(C.target);B.parent().removeClass("newListSelHover")});A.css("left","0").hide()})}})(jQuery);

//jquery.hoverIntent.js
(function($) {
	$.fn.hoverIntent = function(f,g) {
		// default configuration options
		var cfg = {
			sensitivity: 7,
			interval: 100,
			timeout: 0
		};
		// override configuration options with user supplied object
		cfg = $.extend(cfg, g ? { over: f, out: g } : f );

		// instantiate variables
		// cX, cY = current X and Y position of mouse, updated by mousemove event
		// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
		var cX, cY, pX, pY;

		// A private function for getting mouse position
		var track = function(ev) {
			cX = ev.pageX;
			cY = ev.pageY;
		};

		// A private function for comparing current and previous mouse position
		var compare = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			// compare mouse positions to see if they've crossed the threshold
			if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
				$(ob).unbind("mousemove",track);
				// set hoverIntent state to true (so mouseOut can be called)
				ob.hoverIntent_s = 1;
				return cfg.over.apply(ob,[ev]);
			} else {
				// set previous coordinates for next time
				pX = cX; pY = cY;
				// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
				ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
			}
		};

		// A private function for delaying the mouseOut function
		var delay = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			ob.hoverIntent_s = 0;
			return cfg.out.apply(ob,[ev]);
		};

		// A private function for handling mouse 'hovering'
		var handleHover = function(e) {
			// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
			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; }

			// copy objects to be passed into t (required for event object to be passed in IE)
			var ev = jQuery.extend({},e);
			var ob = this;

			// cancel hoverIntent timer if it exists
			if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

			// else e.type == "onmouseover"
			if (e.type == "mouseover") {
				// set "previous" X and Y position based on initial entry point
				pX = ev.pageX; pY = ev.pageY;
				// update "current" X and Y position based on mousemove
				$(ob).bind("mousemove",track);
				// start polling interval (self-calling timeout) to compare mouse coordinates over time
				if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}

			// else e.type == "onmouseout"
			} else {
				// unbind expensive mousemove event
				$(ob).unbind("mousemove",track);
				// if hoverIntent state is true, then call the mouseOut function after the specified delay
				if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
			}
		};

		// bind the function to the two event listeners
		return this.mouseover(handleHover).mouseout(handleHover);
	};
})(jQuery);



