/*
Auto-updater (Gavin Russell gavin@wavex.co.uk - http://www.wavex.co.uk)
Do not use without authors permission.
*/

function QueryString(key)
{
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	}
	return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse()
{
	var query = window.location.search.substring(1);
	var pairs = query.split("&");
	
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;		
		}
	}

}

//number will be given a value of 
var number=3;
var step = 1;
var whichimage = 1;
		
QueryString_Parse();
var imageurl=""
var title="";
var url = "";
var mainbody = "";
var splash_url = "";
var splash_pic = "";
/*
var title="Are you on a blacklist?";
var url = "/products/svx.htm?popup=/products/spamtests/";
var mainbody = "1 in 5 companies have at one time been on a blacklist, are you? - Wavex have devised a quick and easy way to see if you are affected and what you can do."
*/

ref=QueryString("referrer");

//cref = getCookie("ref") || ''

if (ref == null) { 
ref=document.referrer;
}

if (ref.length < 5) {
ref='' + document.location;
}

/*
if (cref.length > 5) {
ref = cref;
}
*/

test=QueryString('test') || '';

if (test.length > 1) {
ref='' + test;
}

ref=ref.toLowerCase();

if (ref.indexOf("neti")>-1) {
title="NETi";
url = "wavex_neti.html";
mainbody = "Find out more about Wavex's acclaimed network management application - NETi.";
}
if (ref.indexOf("junipe")>-1) {
title="Juniper Appliances";
url = "o_security_services.html";
mainbody = "Wavex has extensive experience with many of Juniper security devices to ensure you get the most from your investment. Firewalling, VPNs, QoS, Routing";
}
if (ref.indexOf("netscre")>-1) {
title="Netscreen Appliances";
url = "o_security_services.html";
mainbody = "Wavex has extensive experience with many of Juniper security devices to ensure you get the most from your investment. Firewalling, VPNs, QoS, Routing";
}
if (ref.indexOf("cisco")>-1) {
title="Cisco Appliances";
url = "o_security_services.htm";
mainbody = "Wavex has extensive experience with many of Cisco security devices to ensure you get the most from your investment. Firewalling, AL, VPNs, QoS, Routing";
}

if (ref.indexOf("blackbe")>-1) {
title="Blackberry solutions";
url = "o_remote_working.html";
mainbody = "With Wavex's range of remote working solutions you can ensure you teams can collaborate effortlessly while out of the office.";
}

if (ref.indexOf("helpdesk")>-1) {
title="Need a Helpdesk?";
url = "o_user_support.html";
mainbody = "With Wavex's award-winning IT support services - there is always someone to call, 24/7 365 days a year.";
}


if (ref.indexOf("help desk")>-1) {
title="Need a Helpdesk";
url = "o_user_support.html";
mainbody = "With Wavex's award-winning IT support services - there is always someone to call, 24/7 365 days a year.";
}

if (ref.indexOf("voip")>-1) {
title="VoIP";
var url = "o_telephony.html";
mainbody = "Wavex can deliver not only the IP Telephony component - but the supporting network infrastructure, after-sales support and training.";
}

if (ref.indexOf("teleph")>-1) {
title="VoIP";
var url = "o_telephony.html";
mainbody = "Wavex can deliver not only the IP Telephony component - but the supporting network infrastructure, after-sales support and training.";
}
if (ref.indexOf("phon")>-1) {
title="IP Telephony";
var url = "o_telephony.html";
mainbody = "Wavex can deliver not only the IP Telephony component - but the supporting network infrastructure, after-sales support and training.";
}
if (ref.indexOf("network")>-1) {
title="Networking services";
url = "o_infrastucture_support.html";
mainbody = "Wavex's skilled network engineers can troubleshoot &amp; implement and support almost any network architecture providing extra skilled resource to your teams.";
}

if (ref.indexOf("computer")>-1) {
title="Computer support";
url = "o_user_support.html";
mainbody = "Wavex has devised solutions to meet both the financial, service levels and cashflow requirements for demanding small businesses."
}

if (ref.indexOf("consulta")>-1) {
title="Consultancy and Advice";
url = "o_advisory_services.html";
mainbody = "Wavex have great breadth of experience and abilities to call upon to ensure you always receive appropriate upto date advice.";
}

if (ref.indexOf("sme")>-1) {
title="SME IT services";
url = "o_user_support.html";
mainbody = "Wavex has devised solutions to meet both the financial and service levels for demanding small businesses."
}

/*
if (ref.indexOf("support")>-1) {
title="Small Businesses IT Support";
url = "o_user_support.html";
mainbody = "Wavex has devised solutions to meet both the financial, service levels and cashflow requirements for demanding small businesses."
}
*/

if (ref.indexOf("vpn")>-1) {
title="VPN Services";
url = "o_remote_working.html";
mainbody = "Implementing VPNs for your remote sites or workers is just a small part of the overall Wavex support offering."
}
if (ref.indexOf("outsourc")>-1) {
title="Outsourcing services";
url = "complementary_support_service.html";
mainbody = "Wavex is leading the way in technical outsourcing through the use of their bespoke support applications."
}
if (ref.indexOf("securi")>-1) {
title="Security services";
url = "o_security_services.html";
mainbody = "Security is paramount and Wavex's experience in networking and systems management helps ensure your assets are protected."
splash_url="o_security_services.html";
splash_pic="/images/splashes/home_defend.jpg";
}

if (ref.indexOf("firewal")>-1) {
title="Firewall support";
url = "o_security_services.html";
mainbody = "Wavex can support your infrastructure or procure devices accreditied with the highest level of security."
splash_url="o_security_services.html";
splash_pic="/images/splashes/home_defend.jpg";
}

if (ref.indexOf("bristol")>-1) {
title="Bristol Support";
url = "full_support_service.html";
mainbody = "Wavex extends their cutting-edge support services to customers in the Brisol area."
}
if (ref.indexOf("cardiff")>-1) {
title="Cardiff Support";
url = "full_support_service.html";
mainbody = "Wavex open Cardiff offices - extending their cutting-edge support services to customers in the Cardiff area."
}
if (ref.indexOf("reading")>-1) {
title="Reading Support";
url = "full_support_service.html";
mainbody = "Wavex open Reading offices - extending their cutting-edge support services to customers in the Reading area."
}
if (ref.indexOf("bath")>-1) {
title="Bath Support";
url = "full_support_service.html";
mainbody = "Wavex open Bath offices - extending their cutting-edge support services to customers in the Bath area."
}
if (ref.indexOf("swindon")>-1) {
title="Swindon Support";
url = "full_support_service.html";
mainbody = "Wavex open Swindon offices - extending their cutting-edge support services to customers in the Swindon area."
}
if (ref.indexOf("job")>-1) {
title="IT Jobs";
url = "careers.asp";
mainbody = "Are you interested in working with a team of friendly yet highly skilled and motivated individuals?";
}
if (ref.indexOf("swyx")>-1) {
title="SWYX - VoIP";
url = "o_telephony.html";
mainbody = "Wavex has extensive experience in both installation, support and custom development for the VoIP office solution - SWYX"
}
if (ref.indexOf("mitel")>-1) {
title="Mitel - VoIP";
url = "o_telephony.html";
mainbody = "Wavex has both the expertise in voice and data for planning, installing, and supporting a range of VoIP business solutions."
}
if (ref.indexOf("avaya")>-1) {
title="Avaya - VoIP";
url = "o_telephony.html";
mainbody = "Wavex has both the expertise in voice and data for planning, installing, and supporting a range of VoIP business solutions."
}
if (ref.indexOf("ip office")>-1) {
title="IP Office - VoIP";
url = "o_telephony.html";
mainbody = "Wavex has both the expertise in voice and data for planning, installing, and supporting a range of VoIP business solutions."
}

if ((ref.indexOf("recover")>-1) || (ref.indexOf("disast")>-1) ) {
title="Disaster recovery";
url = "o_back_up_business.html";
var mainbody = "Wavex is expert in disaster recovery planning, business continuity solutions, and recovery execution."
splash_url="o_back_up_business.html";
splash_pic="/images/splashes/home_disaster.jpg"
}

if (ref.indexOf("monit")>-1)  {
title="Server Monitoring";
url = "server_monitoring.html";
mainbody = "Wavex's years of experience in monitoring and troubleshooting servers - brought to you for free with MonX&trade; - Windows Premptive Monitoring.";
}

if ( (ref.indexOf("free server")>-1) || (ref.indexOf("monx")>-1) ) {
title="Server Monitoring";
url = "wavex_monx.html";
mainbody = "Wavex's years of experience in monitoring and troubleshooting servers - brought to you for free with MonX&trade; - Windows Premptive Monitoring.";
}


if (ref.indexOf("backu")>-1) {
title="Cloud backup";
url = "o_back_up_business.html";
mainbody = "Have piece of mind with Wavex's DSX - secure, cost-effective online backup and retrieval of your companies data"
splash_url="o_back_up_business.html";
splash_pic="/images/splashes/home_disaster.jpg"
}

if ( (ref.indexOf("qlikv")>-1) || (ref.indexOf("intel")>-1) ) {
title="Business Intelligence";
url = "o_business_inteligence.html";
mainbody = "Leverage your most important asset - your data. With the use of QlikView&trade; Wavex can deliver valuable results within days.";
}

$quote = '"'; 
//window.location=" + url + "
var text="<a href='" + url + "'>" + title + "</a>"
//var text="<div class='block green' onclick='window.location=\"" + url + "\"'>"
//text +="<div class='title'>" + title
//text +="</div><div class='content'>" + mainbody
//text +="</div>"



//text="<h2><a href='" + url + "'><img src='images/bullet_more.gif' width='30' height='30' border='0' class='bullet' /><span class='home_box_title'>" + title + "</span></a></h2>"
//text="<a href='" + url + "' style='cursor: pointer;'><img src='images/bullet_more.gif' width='30' height='30' border='0' class='bullet' /><div class='typeface-js home_box_title2'>" + title + "</div></a>"

//text="<a href='" + url + "' style='cursor: pointer;'><img src='images/bullet_more.gif' width='30' height='30' border='0' class='bullet' style='padding-top:3px;' /><div class='home_box_title2'>" + title + "</div></a>"
//text +="<p>" + mainbody + " <a href='" + url + "' class='more_link'>More</a></p>"

/*
if (splash_url.length>1){
	var banner_link = document.all ? document.all('splash_url') : document.getElementById ? document.getElementById('splash_url') : null;	
	var banner_pic = document.all ? document.all('SlideShow') : document.getElementById ? document.getElementById('SlideShow') : null;	
    banner_link.href=splash_url;
	banner_pic.style.filter="blendTrans(duration=2)"
    banner_pic.style.filter="blendTrans(duration=crossFadeDuration)"
    banner_pic.filters.blendTrans.Apply() 
	banner_pic.src=splash_pic;
	banner_pic.filters.blendTrans.Play()
}
*/

if (url.length>1){
var el = document.all ? document.all('homebutton') : document.getElementById ? document.getElementById('homebutton') : null;
if (el) {
	el.innerHTML = text;
	el.className='inner_interest';
	}
}

//slide();
