var mySlides = [
    {html:"<div class=\"slide\"><img src=\"images/dan.jpg\"><div style=\"float:right;width:400px;padding-right:5px;\"><b>Dan McGue</b><p>Designed and developed a website worthy of San Francisco's leading Apartment broker.<p /><p>Boasting a sleek, professional look and feel, it also has administrator functionality giving Dan's assistants full control over content. They can also easily update an interactive map showcasing Dan's sold and available properties throughout the city.</p></div></div>"},
	 {html:"<div class=\"slide\"><img src=\"images/canning.jpg\" style=\"border:1px solid #000000;\"><div style=\"float:right;width:400px;padding-right:5px;\"><b>Canning Electric, Inc</b><p>Canning Electric's vision was a website that not only highlighted they offer residential, commercial and industrial services - but also advertised their new 24/7 emergency service.</p><p>With more than 15 years experience serving the Bay Area, creating a gallery to show off their vast body of work was also an important requirement.</p><p>Visit <a href=\"http://www.canningelectricinc.com\" target=\"_blank\">CanningElectricInc.com</a></p></div></div>"},
    {html:"<div class=\"slide\"><img src=\"images/clearlake2.jpg\" style=\"margin-left:15px;border-left:1px solid #56483d;border-right:1px solid #56483d;\"><div style=\"float:right;width:430px;padding-right:5px;\"><b>Clearlake RV Resort</b><p>The proprietors of Clearlake Resort contacted KLC Design to create a website that not only showcased the resort features, but also Lake County which is fast becoming the new Napa.</p><p>This new site with its stylish design perfectly captures the warmth of this beautiful resort, not only highlighting the faclilities but also the surrounding attractions.</p><p>Visit <a href=\"http://www.clearlakeresortrv.com\" target=\"_blank\">ClearLakeResortRV.com</a></p></div></div>"},
    {html:"<div class=\"slide\"><img src=\"images/celtic.jpg\"><div style=\"float:right;width:400px;padding-right:5px;\"><b>San Francisco Celtic Convention</b><p>The San Francisco CSC required a website to promote the 2010 Celtic convention in San Francisco.</p><p>Requirements were to entice fans from around the world to attend and showcase the week full of events planned.</p><p> It also helped attendees book hotels, signup/prepay for a number of events and navigate the city.</p><p>Visit <a href=\"http://www.sfcelticconvention.com\" target=\"_blank\">SFCelticConvention.com</a></p></div></div>"},
	 {html:"<div class=\"slide\"><img src=\"images/viv.jpg\"><div style=\"float:right;width:430px;padding-right:5px;\"><b>Vivian Sonnenberg</b><p>Featured on ABC 7 News and the SF Gate, Vivian Sonnenberg is renowned across the country for her sleep training techniques.</p><p>\"KLC Design have been wonderful to work with. They are efficient, open to suggestions and produce excellent results. I would not hesitate to recommend the company.\" (Vivian)</p><p>Visit <a href=\"http://www.viviansonnenberg.com\" target=\"_blank\">VivianSonnenberg.com</a></p></div></div>"},
	 {html:"<div class=\"slide\"><img src=\"images/treasureisland.jpg\"><div style=\"float:right;width:400px;padding-right:5px;\"><b>Treasure Island Community Center</b><p>San Francisco GAA required a website to promote their impressive new facilities on Treasure Island.</p><p>KLC Design delivered a website that not only showcased their services though galleries, video and an online registration form, but also the proud Irish heritage behind this new facility.</p><p>Visit <a href=\"http://www.treasureislandgaa.com\" target=\"_blank\">TreasureIslandGAA.com</a></p></p></div></div>"},
     {html:"<div class=\"slide\"><img src=\"images/mother.jpg\"><div style=\"float:right;width:430px;padding-right:5px;\"><b>Mothers Hair Rescue</b><p>Una Curran, founder of Mothers Hair Rescue had been in contact with various web designing firms who promised much and delivered little.</p><p>In this economy Ms Curran wanted to get her business online asap and contacted KLC Design.  Within a month her brand new site was live and she was getting calls and emails enquiring about her services.</p><p>Visit <a href=\"http://www.mothershairrescue.com\" target=\"_blank\">MothersHairRescue.com</a></p></div></div>"}

	];

/*load app data*/
function loadApps() {

	var sliderHTML="", controllerHTML="";
	for(var i=0; i<mySlides.length; i++) {
		sliderHTML +=getSliderHTML(mySlides[i]);
		controllerHTML +=getControllerHTML(mySlides[i], i);
	}


	$('#myslides').html(sliderHTML)
	$('#myController').html(controllerHTML);



	$("#myController").jFlow({
		slides: "#myslides",
		controller: ".jFlowControl", // must be class, use . sign
		slideWrapper : "#jFlowSlide", // must be id, use # sign
		selectedWrapper: "jFlowSelected",  // just pure text, no sign
		width: "880px",
		height: "260px",
		duration: 400,
		prev: ".jFlowPrev",
		next: ".jFlowNext"
	});


	}


  function getSliderHTML(item) {

	  var html = "<div>";
	  var needLink = false;
	  if (item.action){
		  needLink = true;
		  html += "<a href=\"javascript:"+item.action+"\">";
	  }
	  else if(item.href) {
		  needLink = true;
		  html += "<a href=\""+item.href+"\" rel='facebox'>";
	  }

	  /*
	  if (needLink) {
		  if (item.linkId) {
			  html +=" id=\""+item.linkId + "\"";
		  }
		  html +=">";
		  alert(html);
	  }*/

	  /*
	  html += '<img src="' + imageLoadingURL + item.url + '" width="800" height="224" alt="' + item.title + '" border="0"/>';
	  //html += item.title;
	  if (needLink) {
		  html +="</a>";
	  }
	  html +="</div>";
	  return html;
	  */
	  return item.html;
}


  function getControllerHTML(item, i) {
	  var html = "<div class=\"jFlowControl";
	  if(i==0) {
		  html +=" enabledNavControl\">";
	  }
	  else {
		  html +=" disabledNavControl\">";
	  }
	  html +="</div>";
	  return html;

	  /*
	  var html = "<span class=\"jFlowControl\">";
	  if (i==0) {
		  html += '<img src="' + imageLoadingURL  + 'dots.png" border="0"/>';
	  }
	  else {

	  }
	  html +="</span>";
	  return html;*/
 }


