// All rights reserved. Copying, distribution or disclosure without Author's permission is prohibited, Author: Sheril Jebasingh, Contact: mailsheril@gmail.com

// JQuery Plugin: Simple jQuery Slideshow, Author: Jon Raasch, WebLink: jonraasch.com
function slideSwitch(){var $active=$('#slideshow DIV.active');if($active.length==0)$active=$('#slideshow DIV:last');var $next=$active.next().length?$active.next():$('#slideshow DIV:first');$active.addClass('last-active');$next.css({opacity:0.0}).addClass('active').animate({opacity:1.0},1000,function(){$active.removeClass('active last-active')})}

// Add Hover functionality in IE 6
sfHover=function(){var el=document.getElementById("nav");if(!/\bnav\b/.test(el.className)&&el.tagName=="UL")setHover(el);var ieNavs=document.getElementsByTagName('ul');for(i=0;i<ieNavs.length;i++){var ul=ieNavs[i];if(/\bnav\b/.test(ul.className))setHover(ul)}}
function setHover(nav){var ieULs=nav.getElementsByTagName('ul');if(navigator.appVersion.substr(22,3)!="5.0"){if((navigator.appVersion.substr(22,2)=="6.")||(navigator.appVersion.substr(22,2)=="5.")){for(j=0;j<ieULs.length;j++){var ieMat=document.createElement('iframe');if(document.location.protocol=="https:")ieMat.src="//0";else if(window.opera!="undefined")ieMat.src="";else ieMat.src="javascript:false";ieMat.scrolling="no";ieMat.frameBorder="0";ieMat.style.width=ieULs[j].offsetWidth+"px";ieMat.style.height=ieULs[j].offsetHeight+"px";ieMat.style.zIndex="-1";ieULs[j].insertBefore(ieMat,ieULs[j].childNodes[0]);ieULs[j].style.zIndex="101"}}var ieLIs=nav.getElementsByTagName('li');for(var i=0;i<ieLIs.length;i++)if(ieLIs[i]){if(/\bselected\b/.test(ieLIs[i].className)){if(ieLIs[i].nextSibling){ieLIs[i].nextSibling.className+=" hoverNext"}}ieLIs[i].onmouseover=function(){if(!/\bsfhover\b/.test(this.className)){this.className+=" sfhover";this.className=this.className.replace(' hoverNext','');if(this.nextSibling){if(!/\bhoverNext\b/.test(this.nextSibling.className)){this.nextSibling.className+=" hoverNext"}}}}
ieLIs[i].onmouseout=function(){if(!this.contains(event.toElement)){this.className=this.className.replace('sfhover','')}}}}
else{var ieLIs = document.getElementById('nav').getElementsByTagName('li');for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
ieLIs[i].onmouseover=function() {this.className+=" sfhover";hideSelects();}
ieLIs[i].onmouseout=function() {this.className=this.className.replace(' sfhover', '');showSelects()}}}}function hideSelects(){var oSelects=document.getElementsByTagName("select");for(var i=0;i<oSelects.length;i++)oSelects[i].className+=" hide"}function showSelects(){var oSelects=document.getElementsByTagName("select");for(var i=0;i<oSelects.length;i++)oSelects[i].className=oSelects[i].className.replace(" hide","")}if(window.attachEvent)window.attachEvent('onload',sfHover);

// Flash Activator
//var ie=/*@cc_on!@*/false;if(ie){if(!document.getElementById("hideObject")){document.write('<style id="hideObject"> object.flash{display:none !important;} </style>')}}objectSwap=function(){if(!document.getElementsByTagName){return}var stripQueue=[];var objects=document.getElementsByTagName('object');var minFlashVer=8;for(var i=0;i<objects.length;i++){var o=objects[i];if(ie){o.removeAttribute("data");o.setAttribute("classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");o.setAttribute("codebase","http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+minFlashVer+",0,0,0")}var h=o.outerHTML;var params="";var hasFlash=true;for(var j=0;j<o.childNodes.length;j++){var p=o.childNodes[j];if(p.tagName=="PARAM"){if(p.name=="flashVersion"){if(p.value!="")minFlashVer=p.value;hasFlash=detectFlash(p.value);if(!hasFlash){o.id=(o.id=="")?("stripFlash"+i):o.id;stripQueue.push(o.id);break}}params+=p.outerHTML}}if(!hasFlash){continue}if(!ie){continue}if(o.className.toLowerCase().indexOf("noswap")!=-1){continue}var tag=h.split(">")[0]+">";var newObject=tag.toLowerCase()+params+o.innerHTML+" </object>";o.outerHTML=newObject}if(stripQueue.length){stripFlash(stripQueue)}if(ie){document.getElementById("hideObject").disabled=true}}detectFlash=function(version){if(navigator.plugins&&navigator.plugins.length){var plugin=navigator.plugins["Shockwave Flash"];if(plugin==undefined){return false}var ver=navigator.plugins["Shockwave Flash"].description.split(" ")[2];return(Number(ver)>=Number(version))}else if(ie&&typeof(ActiveXObject)=="function"){try{var flash=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+version);return true}catch(e){return false}}return true}stripFlash=function(stripQueue){if(!document.createElement){return}for(var i=0;i<stripQueue.length;i++){var o=document.getElementById(stripQueue[i]);var newHTML=o.innerHTML;newHTML=newHTML.replace(/<!--\s/g,"");newHTML=newHTML.replace(/\s-->/g,"");newHTML=newHTML.replace(/<embed/gi,"<span");var d=document.createElement("div");d.innerHTML=newHTML;d.className=o.className;d.id=o.id;o.parentNode.replaceChild(d,o)}}$(document).ready(function(){objectSwap()});

$(function() {
    setInterval( "slideSwitch()", 8000 );
/*	$("#click").click(function(){ 
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	}); */
	
	
	//Twitter Link Modification
	$('div.tweet a').attr('target','_blank');
});

