window.addEvent('domready', function(){
	//Initialize navigation effects
		var szNormal = 135, szSmall  = 135, szFull   = 200;

		var kwicks = $$("#kwicks .kwick");
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
		kwicks.each(function(kwick, i) {
			kwick.addEvent("mouseenter", function(event) {
				var o = {};
				o[i] = {width: [kwick.getStyle("width").toInt(), szFull]};
				kwicks.each(function(other, j) {
					if(i != j) {
						var w = other.getStyle("width").toInt();
						if(w != szSmall) o[j] = {width: [w, szSmall]};
					}
				});
				fx.start(o);
			});
		});
		 
		try {
			$("kwicks").addEvent("mouseleave", function(event) {
				var o = {};
				kwicks.each(function(kwick, i) {
					o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]};
				});
				fx.start(o);
			});
		} catch(ex) {	}
		
		
	//Pull Query String into object:
		var objURL = new Object();

		window.location.search.replace(
			new RegExp("([^?=&]+)(=([^&]*))?","g"),
			
			function($0,$1,$2,$3){
				objURL[$1.toLowerCase()] = $3;
			}
		);
	
	//Create multibox and show it if specified in querystring
		if (objURL["u"] != undefined){
		//Array for keywords and their url's
		var arKeywords = [
				{Keyword: 'simplesiteupdate',URL: 'http://www.starthostingnow.com/Product.aspx?ProductId=7'},
				{Keyword: 'supportincident',URL: 'http://www.starthostingnow.com/Product.aspx?ProductId=8'},
				{Keyword: 'logincheckout',URL: 'http://www.starthostingnow.com/login.aspx?ReturnUrl=/checkout/default.aspx'},
				{Keyword: 'payinvoice',URL: 'http://www.starthostingnow.com/Product.aspx?ProductId=9'},
				{Keyword: 'basket',URL: 'http://www.starthostingnow.com/basket.aspx'}
			];

			//set defaults if nothing was supplied
			if (objURL["w"] == undefined){var boxWidth = 800}else{var boxWidth = objURL["w"]};
			if (objURL["h"] == undefined){var boxHeight = 450}else{var boxHeight = objURL["h"]};
			if (objURL["d"] == undefined){var boxDescription = ''}else{var boxDescription = objURL["d"]};
			boxDescription = unescape(boxDescription);
			var boxURL = objURL["u"];
			
			//loop through keywords array to see if the keyword supplied matches a keyword in the array.
			for (var i=0; i<arKeywords.length; i++){
				if (arKeywords[i].Keyword.toLowerCase() == boxURL.toLowerCase()){
					boxURL = arKeywords[i].URL;
					var validKeyword = true;
				}
			};
			
			
			//$('QueryPopupContainer').innerHTML = '<div class="multiboxDescDiv PopupNow">' + boxDescription + '</div><a href="' + boxURL + '" rel="width:' + boxWidth + ',height:' + boxHeight + '" class="mb" id="PopupNow">&nbsp;</a>';
			//alert($('QueryPopupContainer').innerHTML)
			//var box = new MultiBox('mb', {descClassName: 'multiboxDescDiv', showNumbers: false});
			
			if (validKeyword){
				window.location = boxURL;
				//box.open($('PopupNow'));
			}			
		} else{
			new MultiBox('mb', {descClassName: 'multiboxDescDiv', showNumbers: false});
		}
	
})