﻿     $(document).ready(function() {
		 
		 /*
		 Cufon.replace('h1');
		 Cufon.replace('h2');
         Cufon.replace('h3');
		 */
		 randomtip();
		 //$(".tipTop").tipTip({maxWidth: "auto", edgeOffset: 10});
		 $.backstretch("images/bg.jpg", {speed: 150});
  		 //$(function(){	$('#contentScroll').jScrollPane();});

         $(".thumbs a.image").click(function() {
			 
			var _ImageName = $(this)[0].id;
			var _ImageAlt = $("#"+ _ImageName +"").find("img").attr("alt");
			var imageTitle = $("#" + _ImageName + "").parent().find("span").html();
            var imageDesc = $("#" + _ImageName + "").parent().find("p").html();
			
         	$("#SWF").html("");
			$("#videoDesc").html("");
			 
			 $('#imageLink').css('display','block');
			 $('#imageLink').attr('href','Images/portfolio/'+_ImageName+'-l.jpg');
			 $('#imageLink').find('img').attr('alt',_ImageAlt);

			 var imgContent = "<img src='images/portfolio/"+_ImageName+"-l.jpg' alt='' width='473' height='260'>"
			 document.getElementById("imgBox").innerHTML = imgContent;  
             
             $("#videoDesc").html("<h3>" + imageTitle + "</h3><p>" + imageDesc + "</p>");
			 
          });



         $(".thumbs a.video").click(function() {

            var _FileName = $(this)[0].id;
             //var videoTitle = $("#" + videoId + "").attr("title");
            var videoTitle = $("#" + _FileName + "").parent().find("span").html();
            var videDesc = $("#" + _FileName + "").parent().find("p").html();
            //alert(_FileName);
			
			$("#imgBox").html("");
			$("#videoDesc").html("");
			
             var _width = 485, _height = 260;
             var swfContent =
                "<object width='" + _width + "' height='" + _height + "' id='objSWF'>" +
			    "    <param name='src' value='Videos/" + _FileName + ".swf' />" +
			    "    <embed src='Videos/" + _FileName + ".swf' wmode='window' quality='high' menu='false' loop='false' width='" + _width + "' height='" + _height + "' name='objSWF' />" +
				"</object>";
             document.getElementById("SWF").innerHTML = swfContent;  
             
             $("#videoDesc").html("<h3>" + videoTitle + "</h3><p>" + videDesc + "</p>");
         })
     });
	 
			this.randomtip = function(){
			var length1 = $(".section1 li").length; // this is where we put the id of the list
			var ran1 = Math.floor(Math.random()*length1) + 1;
			$(".section1 li:nth-child(" + ran1 + ")").show();
			
			var length2 = $(".section2 li").length; // this is where we put the id of the list
			var ran2 = Math.floor(Math.random()*length2) + 1;
			$(".section2 li:nth-child(" + ran2 + ")").show();
			
			var length3 = $(".section3 li").length; // this is where we put the id of the list
			var ran3 = Math.floor(Math.random()*length3) + 1;
			$(".section3 li:nth-child(" + ran3 + ")").show();
		};

        TopUp.addPresets({
        "a.imageBig": {
                title: "{alt} ",
                //group: "Press",
                readAltText: 1,
                shaded: 1
            }
            
        });
       

