// JavaScript Document

var j$ = jQuery;

j$(document).ready(init);
j$(window).load(loaded);


var windowWidth = 0;
var windowHeight = 0;
var base_inner_width = 990;

var agent = navigator.userAgent;
if(agent.indexOf('Windows NT 5.1') > -1)
{
  j$("html").addClass('winXP');
}


function init()
{
	//ASSIGN VALUES TO GLOBALS
	windowWidth = j$(window).width();
	windowHeight = j$(window).height();
	

	//TABLE RESET
	j$('table').attr({'cellspacing':0, 'width':'100%'});
	j$('td').attr({'valign':'top'});
////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
	//apply target="blank" to OUTGOING LINKS
//	j$('a').each(function(i){
//			var h=j$(this).attr('href');
//			if(h.indexOf('http://')>-1)
//			{
//				var cI = h.indexOf('inboxorange.');
//				if(cI<0 || cI>12)
//				{
//					j$(this).attr({'target':'_blank'});
//				}
//			}
//		})
////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
	//Home Page Menu Rollovers
	
	
	//initial setup
	j$("#home-preview-col .page").hide();
	j$("#home-preview-col .post-23").show();
	j$("li#emailDesign a, li#customerLoyalty a, li#socialMedia a, li#dataAnalytics a, li#everythingElse a").mouseover(function(){
		});
	j$("li#emailDesign a").mouseover(function(){
			j$("#home-preview-col div.page").css('z-index','1').stop().fadeTo("slow",0);
			j$("#home-preview-col .post-15").css('z-index','2').stop().fadeTo("slow",1);
			j$("#home-icon-nav").css("background-position","-936px 0");
		});
	j$("li#customerLoyalty a").mouseover(function(){
			j$("#home-preview-col div.page").css('z-index','1').stop().fadeTo("slow",0);
			j$("#home-preview-col .post-17").css('z-index','2').stop().fadeTo("slow",1);
			j$("#home-icon-nav").css("background-position","-1872px 0");
		});
	j$("li#socialMedia a").mouseover(function(){
			j$("#home-preview-col div.page").css('z-index','1').stop().fadeTo("slow",0);
			j$("#home-preview-col .post-19").css('z-index','2').stop().fadeTo("slow",1);
			j$("#home-icon-nav").css("background-position","-2808px 0");
		});
	j$("li#dataAnalytics a").mouseover(function(){
			j$("#home-preview-col div.page").css('z-index','1').stop().fadeTo("slow",0);
			j$("#home-preview-col .post-21").css('z-index','2').stop().fadeTo("slow",1);
			j$("#home-icon-nav").css("background-position","-3744px 0");
		});
	j$("li#everythingElse a").mouseover(function(){
			j$("#home-preview-col div.page").css('z-index','1').stop().fadeTo("slow",0);
			j$("#home-preview-col .post-23").css('z-index','2').stop().fadeTo("slow",1);
			j$("#home-icon-nav").css("background-position","0px 0px");
		});


////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
	//search box message
	
//	j$('#searchform #s').each(function(){
//			j$(this).css({'color':'#CCC'}).attr('value','search here');
//		});
//	j$('#searchform #s').click(function(){
//			j$(this).css({'color':'#000'});
//			if(j$(this).attr('value')=='search here')
//			{
//				j$(this).attr('value','');
//			}
//		});

}


