// JavaScript Document
var startClass;
var startImg;

function read_more(){
	// first close any open dropdowns
	var obj = document.getElementById("arrow");
	var str = obj.src;
		
	if (str.indexOf("arrow_open.gif") == -1)	{
		obj.src = str.replace(/_close/,"_open");
		collapse1.slidedown();
	} else {		
		obj.src = str.replace(/_open/,"_close");
		collapse1.slideup();
	}
}

function swapClass(src)	{
	var obj = document.getElementById(src);
	startClass = obj.className;
	obj.className = "navImgOver"
}
function swapClassOut(src)	{
	var obj = document.getElementById(src);
	obj.className = startClass;
}

function showAbstract(src)	{
	var obj1 = document.getElementById(src);
	var obj2 = document.getElementById("newsControl");
	
	obj2.innerHTML = obj1.innerHTML;
}

function on(src)	{
	var obj = document.getElementById(src);
	obj.src = "Images/navOptionOverAnim.gif";
}

function off(src)	{
	var obj = document.getElementById(src);
	obj.src = "Images/navOption.gif";
}

function swapImg(src,sImg)	{
	var obj = document.getElementById(src);
	obj.src = "Images/" + sImg;
}

function onBg(src)	{	
	var obj = document.getElementById(src);
	obj.className = "clientAreaOver";
}

function offBg(src)	{
	var obj = document.getElementById(src);
	obj.className = "clientArea";
}

function onDetails(src)	{	
	var obj = document.getElementById(src);
	obj.className = "portfolioControlDetailOver";
}
function offDetails(src)	{
	var obj = document.getElementById(src);
	obj.className = "portfolioControlDetail";
}

// Staff profile functions
var sStaff		= "none";
var sStaffImg	="sTeam.jpg"

function onSBg(src)	{	
	if (src != sStaff)	{
		var obj = document.getElementById(src);
		obj.className = "staffNavOver";
		var sRoll = document.getElementById('staffRollOver');
		var sRollImg = document.getElementById('mainImage');
		sRollImg.src = "Images/s" + src + ".jpg";
	}
}

function offSBg(src)	{
	if (src != sStaff)	{	
		var obj = document.getElementById(src);
		obj.className = "staffNav";
		var sRollImg = document.getElementById('mainImage');
		sRollImg.src = "Images/" + sStaffImg;
	}
}

function swapStaff(staff)	{
	// bodyText
	var sBody = document.getElementById('leftCol');
	
	var retStr = "";
	var retImg;
	//sStaff = staff;

	switch (staff)	{
		case "paul":
			retStr = retStr + "<h1>Paul Barlow - Director</h1>";
			retStr = retStr + "<p>Vertical's director and driving force is Paul Barlow. An important member of the agency from its earliest years, Paul has been building the business since 1989, becoming a director in 1990 and sole owner in 2006.</p><p>With a seven year career in sales, marketing and product management in the pharmaceutical industry before joining Vertical, Paul has a breadth of marketing experience rarely found. His strategic planning abilities and shrewd business mind have achieved results for clients across a wide range of sectors. Under his guidance, Vertical has achieved an outstanding track record of winning and retaining business. In fact, some clients have been with the agency for 16 years.</p><p><em>&ldquo;I'm just as excited about the future too. Marketing is changing so quickly. Traditional print methods have been overtaken by rich media and the web offers endless opportunities.&rdquo;</em></p><p>If you'd like to discuss your businesses needs with Paul, please <a href='contact.asp'>click here</a>.</p>";
			sStaffImg = "sPaul.jpg";
			break;
		case "andyl":
			retStr = retStr + "<h1>Andy Lock - Creative Consultant</h1>";
			retStr = retStr + "<p>Andy Lock has been the lynchpin of Vertical's creative department since its inception. Today, Andy works with Vertical and our clients, constantly monitoring the quality of creative output as regards design. He liaises closely with both our account management team and clients to take projects through from brief to completion. As well as producing concepts and developing designs himself, Andy continues to steer the creative direction of other projects flowing through the agency.</p><p>After studying at the Southampton College of Art in Reprographic Techniques, Andy has spent his entire career working in design and print. Andy has a wealth of design knowledge, plus a passion for landscape photography, climbing and hill walking.</p><p>If you'd like to speak to Andy about your creative, please <a href='contact.asp'>click here</a>.</p>";			
			sStaffImg = "sAndyL.jpg";
			break;
		case "andyb":
			retStr = retStr + "<h1>Andy Barber - Digital Developer</h1>";
			retStr = retStr + "<p>Andy Barber brings a rare combination of multimedia know-how and design talent to Vertical's digital marketing abilities. A master in the digital sphere with nine years experience, Andy's abilities include web development, digital media and database knowledge. This means he's not just fluent in HTML, Flash, JavaScript, VB Script, ASP, PHP, AJAX, SQL and mySQL but is also familiar with the wider marketing aspects, such as creating digital mailers and managing Google ad word campaigns. On top of this, Andy's design flair ensures websites have eye-catching style and comprehensive functionality in equal measure.</p><p>Prior to joining Vertical, Andy was involved in ground-breaking web development work, which helped GFM become the first IFA to offer online guided selling of ISAs and Bonds.</p><p>If you'd like to discuss your digital offering with Andy, please <a href='contact.asp'>click here</a>.</p>";
			sStaffImg = "sAndyB.jpg";
			break;
		case "tim":
			retStr = retStr + "<h1>Tim Rose - Account Manager</h1>";
			retStr = retStr + "<p>For Vertical's clients, Tim is an effective and valuable extension of their marketing department, working to support them in all aspects of their account. With fifteen years of agency and consultancy experience, Tim is well versed in helping clients establish and maintain market awareness through adept use of the full marketing mix.</p><p>Tim's early career in the Royal Electrical and Mechanical Engineers lends him a natural affinity with technical brands, making him the ideal person to guide marketing activities for complex products and services.</p><p>In his spare time Tim enjoys scuba diving. He is a member of the Professional Association of Diving Instructors and actively passes on his knowledge to dive enthusiasts and students at his local dive club.</p><p>If you'd like to discuss your next campaign with Tim, <a href='contact.asp'>click here</a></p>";
			sStaffImg = "sTim.jpg";
			break;
		case "jo":
			retStr = retStr + "<h1>Jo Murphy - Account Executive</h1>";
			retStr = retStr + "<p>With ten years of PR experience plus a BA, Jo is accomplished at recommending and co-ordinating winning PR and marcomms strategies. Her broad experience complements the needs of Vertical's international clients perfectly, having previously worked client-side as a communications executive for EMEA and Asia Pacific, travelling across Europe and America executing global  PR campaigns in multiple languages.</p><p>Jo is responsible for ensuring all aspects of her clients' integrated strategies run effectively, from the initial strategic planning through to back-end coverage analysis and reporting. She is also responsible for managing the promotional activities of Vertical.</p><p><em>&ldquo;Companies are now beginning to recognise the importance of integrated marketing communications. While advertising, exhibitions, direct mail and sales promotion are all important, there will always be a place for PR as it offers credibility to a product or service.&rdquo;</em></p><p>If you'd like to discuss your PR with Jo, please <a href='contact.asp'>click here</a>";
			sStaffImg = "sJo.jpg";
			break;
		case "james":
			retStr = retStr + "<h1>James Gibson - Graphic Designer</h1>";
			retStr = retStr + "James brings energy and ideas to Vertical's creative department, helping to deliver high standards of creative and conceptual design. James is able to effectively translate concepts, designs and branding across both traditional and digital media, making him ideal for integrated campaigns.</p><p>In his spare time James enjoys listening to local bands and gigs and can often be found whiling away the hours on his guitar.</p><p><em>&ldquo;Our clients are always looking for refreshing ideas and designs, so I'm actively encouraged to think 'outside the box.' Being a modern designer of the web generation, I try to break out of conventional design boundaries to incorporate the latest graphics ideas and design trends in my work. I really enjoy being a part of this rapidly changing design environment.&rdquo;</em></p><p>If you'd like to speak to James about creative design, please <a href='contact.asp'>click here</a>";			
			sStaffImg = "sJames.jpg";
			break;
		case "hayley":
			retStr = retStr + "<h1>Hayley Giles - Administration &amp; Marketing Support</h1>";
			retStr = retStr + "<p>Hayley is a key part of the team, ensuring the office runs smoothly and carrying out the daily administration tasks essential to any business.</p><p>Yet, with valuable experience in marketing as well as office administration, Hayley is well positioned to support clients on various junior account executive level projects too, from sourcing data and carrying out research, to updating websites and proof-reading.</p><p>Hayley joined the team in 2007, and has quickly become familiar with Vertical's operations.  Her ability to multi-task alongside the rest of team means that Vertical can be flexible and adapt to clients' requirements smoothly and rapidly.</p>";			
			sStaffImg = "sHayley.jpg";
			break;
		case "tony":
			retStr = retStr + "<h1>Tony Wainwright - Account Manager</h1>";
			retStr = retStr + "<p>With 25 years experience in the military, aviation and security electronics industries, Tony brings a wealth of technical and marketing experience to Vertical's client base. Having held senior management positions with some of the security industry's leading companies and in his continuing work as an independent technical consultant, Tony is uniquely positioned to understand complex products and guide Vertical's team to deliver highly effective communications that influence the client's target audiences.</p><p>Tony is currently learning to fly and has a passion for cars. In his remaining spare time he plays drums and enjoys creating and listening to music.</p><p><em>&ldquo;Having worked with many marketing departments and agencies throughout my career in security systems, I have gained a valuable insight into the requirements of this exacting industry sector, most importantly from the client's perspective. I believe that this insight forms a key part of the value proposition offered by Vertical to its security systems' clients.&rdquo;</em></p><p>If you'd like to discuss the challenges facing your company today in the security industry with Tony, please <a href='contact.asp'>click here</a>";
			sStaffImg = "sTony.jpg";
			break;
		case "main":
			retStr = retStr + "<h1>The agency that speaks your language</h1>";
			retStr = retStr + "<p>Vertical's whole approach has been based on knowledge and understanding - to fully appreciate the clients' strategies, technologies, products and markets.  This has proved to be a winning formula, helping to retain clients for many years and earning us the reputation of being &lsquo;the agency that speaks your language.&rsquo;</p><p>As Roger Gibbs, one of our technology clients since 1991, said: <em>&ldquo;The winning and losing of business starts with how you are perceived, which is why we entrust the protection of our brand, plus the balance of design, copy and technical information to Vertical. Over the years they have given us sound advice and their understanding of our technology and market is critical to the success we enjoy.&rdquo;</em></p><p>If you're looking to take your communications strategy to a higher level, <a href='contact.asp'>talk</a> to Vertical &lsquo;the agency that speaks your language.&rsquo;</p>";
			sStaffImg = "sAgency.jpg";			
			break;			
			}	
	
	if (staff != "main")	{
		retStr = retStr + "<p><a href=javascript:swapStaff('main'); class='newsArrow'>Back to Agency Info</a></p>"
	}
	document.getElementById("banner").style.background = "url(Images/" + sStaffImg + ")";
	sBody.innerHTML = retStr
}

// Pass values to Flash movie
function doPassVar(args){
   var sendText = args;
   window.document.portfolio.SetVariable("sIn.command", sendText);
}

// Print page
function printPage(sCon1,sDate)	{
	var obj1 = document.getElementById(sCon1);	
	var retStr = "";
	//alert(obj1.innerHTML);

	newwindow=window.open();
	newdocument=newwindow.document;
	retStr =  '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
	retStr =  retStr + '<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
	retStr =  retStr + '<title>Vertical Marketing Communications Ltd</title>';
	retStr =  retStr + '</head><style>h1{line-height:normal;}</style><body>'
	retStr =  retStr + '<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height:16px;">';
	retStr =  retStr + '<img src="Images/printLogo.jpg" style="float:right; margin-bottom:10px;"><div style="clear:both;"></div>';	
	retStr =  retStr + 	obj1.innerHTML;
	retStr =  retStr +  "<p><a href='javascript:this.print()'>" + "Print this Page</a></p>";
	retStr =  retStr +  "<br/><br/><span style='font-size:10px; color:#999999;'>&copy;Vertical Marketing Communications Ltd " +  sDate + ".</span></div>";
	retStr =  retStr + "</body></html>";
	newdocument.write(retStr);
	newdocument.close();
}


function popUpDetails(theURL) {
	// THIS FUNCTION IS USED
	var theName = "friend";
	var theProperties = "width=400,height=400";
	var theProps = theProperties +  ",status=yes,left=150,top=150";
	window.open(theURL,theName,theProps);
}


	function testEmail(src) {
	  var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
	  return regex.test(src);
	  alert(regex.test(src));	  
	}

     // Check whether string s is empty.
      function isEmpty(s)
      { return ((s == null) || (s.length == 0)) }

	function validateForm()	{ //Validates Idiom Form	
		var formError = false;
		// Check Name
			if (isEmpty(document.getElementById('Name').value) == true)	{
				formError = true;
			} else {
				if (isEmpty(document.getElementById('Company').value) == true)	{
					formError = true;
				} else {
					if (isEmpty(document.getElementById('JobTitle').value) == true)	{
						formError = true;
					} else {
						if (isEmpty(document.getElementById('Email').value) == true)	{
							formError = true;
						}	else {
								if (testEmail(document.getElementById('Email').value) == false) {
									formError = true;
									alert("The email address provided is invalid.");
								}									
							}
						}						
					}					
				}		
		
		var obj = document.getElementById('Submit');
		if (formError == false) {
			obj.disabled = false;
		} else {
			obj.disabled = true;			
		}
	}
	
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// SWF related scripts

function sendEvent(swf,typ,prm) { 
  thisMovie(swf).sendEvent(typ,prm); 
};
function getUpdate(typ,pr1,pr2,swf) {};

function thisMovie(swf) {
  if(navigator.appName.indexOf("Microsoft") != -1) {
    return window[swf];
  } else {
    return document[swf];
  }
};

function loadFile(swf,obj) { 
  thisMovie(swf).loadFile(obj); 
}

var openFolio = "web0";

function swapFolio(src, xml)	{
	var obj1 = document.getElementById(src);
	var obj2 = document.getElementById(openFolio);

	openFolio = src;
	
	obj2.style.display = "none";
	obj1.style.display = "block";
	
	createplayer(xml);
}

