// Generate Javascript for Home Page Profile Area // width="194" height="215" // "images/home-profile/" var profList = new Array(); profList[0]= "bd-template-1.jpg";profList[1]= "bible-book-template-d1.jpg";profList[2]= "bin-houfan-main-page-d4.jpg";profList[3]= "Budget-Coach-d1.jpg";profList[4]= "Carmanlaw_Updated.jpg";profList[5]= "Cross-Partner-layout_b1a.jpg";profList[6]= "Cuisine-Solution-DefaultPag.jpg";profList[7]= "Cusinie-Template-update-1.jpg";profList[8]= "Cusinie-Template.jpg";profList[9]= "design_self-pub-1.jpg";profList[10]= "dobiz-01.jpg";profList[11]= "duncak-music_2.jpg";profList[12]= "Express-Invitation-1.jpg";profList[13]= "Flooring-Company-Template-1.jpg";profList[14]= "Flooring-Company-Template-3.jpg";profList[15]= "Four-Season-Template-1.jpg";profList[16]= "Four-Season-Template-4.jpg";profList[17]= "ften_d1.jpg";profList[18]= "HJ-illustration-1-update.jpg";profList[19]= "HP-Header1-Logo1.jpg";profList[20]= "Hush-templateflash1.jpg";profList[21]= "Job-Plant-Template-4.jpg";profList[22]= "layout-neptune-1.jpg";profList[23]= "learning-cafe-d3.jpg";profList[24]= "legwork_d1b.jpg";profList[25]= "legwork_d3.jpg";profList[26]= "mafia-template.jpg";profList[27]= "ManCard_Template_Update.jpg";profList[28]= "norderic_d1.jpg";profList[29]= "norderic_d4.jpg";profList[30]= "O3Balance_d4.jpg";profList[31]= "OnlineShoppingStore-Ecommer.jpg";profList[32]= "palm-template-d2.jpg";profList[33]= "Pawlinks-Template-D2.jpg";profList[34]= "paxel-03.jpg";profList[35]= "purenatural-new-2b-InProgre.jpg";profList[36]= "pure_naturals-_b2-2.jpg";profList[37]= "rileys-template-4.jpg";profList[38]= "Scuba-Diving-Template2.jpg";profList[39]= "SequentialT_d1.jpg";profList[40]= "shop4design-d1b.jpg";profList[41]= "shop4design-d3b.jpg";profList[42]= "SPOTSOT.jpg";profList[43]= "StateWide-Template-Home-D1.jpg";profList[44]= "TechWisdom-Template-1.jpg";profList[45]= "Thumbs.db";profList[46]= "UK-Screen-Template-D2a.jpg";profList[47]= "web-drag-n-drop-1.jpg";profList[48]= "web-Pizza-Depot-removed.jpg";profList[49]= "web-sapil-d1.jpg";profList[50]= "web-shirley-d3.jpg";profList[51]= "website-2.jpg";profList[52]= "website-3.jpg";profList[53]= "webstudio.jpg";profList[54]= "web_14.jpg";profList[55]= "wp-banner_d1.jpg";profList[56]= "wwc-d2.jpg";profList[57]= "wwcomm-03.jpg";profList[58]= "x8_d1.jpg";profList[59]= "x8_Layout-B1.jpg";profList[60]= "x8_Layout-B2.jpg";profList[61]= "x8_Percurrsion-Template.jpg";profList[62]= "Yachting-Template.jpg"; var countOpac=0; function processHomeProfile() { var randomIndex=Math.floor(Math.random()*profList.length); blendimage('home_profile', 'homeProImg', 'images/home-profile/'+profList[randomIndex], 1500); //setTimeout (processHomeProfile(),15000); } // Following JavaScript contain different Opacaity manipulation functions // Prepared from knowledge from different sites by Faisal - TW // function fadeHide(id) { opacity(id, 100, 0, 500); } function fadeShow(id) { opacity(id, 0, 100, 500); } function opacity(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; countOpac = countOpac+1; if (countOpac==102) { // Last call from blendImage countOpac = 0; setTimeout ('processHomeProfile()',4000); } } function shiftOpacity(id, millisec) { //if an element is invisible, make it visible, else make it ivisible if(document.getElementById(id).style.opacity == 0) { opacity(id, 0, 100, millisec); } else { opacity(id, 100, 0, millisec); } } function blendimage(divid, imageid, imagefile, millisec) { countOpac = 0; var speed = Math.round(millisec / 100); var timer = 0; //set the current image as background document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; //make image transparent changeOpac(0, imageid); //make new image document.getElementById(imageid).src = imagefile; //fade in image for(i = 0; i <= 100; i++) { setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); timer++; } } function currentOpac(id, opacEnd, millisec) { //standard opacity is 100 var currentOpac = 100; //if the element has an opacity set, get it if(document.getElementById(id).style.opacity < 100) { currentOpac = document.getElementById(id).style.opacity * 100; } //call for the function that changes the opacity opacity(id, currentOpac, opacEnd, millisec) }