﻿$(function(){
	$('.fadein img:gt(0)').hide();
	setInterval(function(){$('.fadein :first-child').fadeOut(1500).next('img').fadeIn(1500).end().appendTo('.fadein');}, 5000);

	var curPage = location.pathname.substring(1);
	if(curPage.indexOf('/') != -1) curPage = curPage.substring(0, curPage.indexOf('/'));
	var page = $('a[href='+curPage+'][pagegroup]');
	var pageGroup = curPage;
	if(page.length >0){
		pageGroup = $(page[0]).attr('pagegroup');
		var menuLink = $('#main-nav a[pagegroup='+pageGroup +']');
		menuLink.attr('id', 'on');
	}
	
	$("#login .inline-label").lettering('words');

	if(typeof(bannerSet[pageGroup]) == 'object' && bannerSet[pageGroup].length > 0){
		$('#slider').empty();
		for(var i=0; i<bannerSet[pageGroup].length; i++){
			var li = $('<li />');
			li.attr('id', bannerSet[pageGroup][i].id);
			li.html(bannerSet[pageGroup][i].content);
			$('#slider').append(li);
		}
	}
	$('#slider').css('visibility','visible');	
	$('#slider').anythingSlider({'buildArrows':false});	
});

var bannerSet = [];
bannerSet['publishers'] = [];
bannerSet['advertisers'] = [];
bannerSet['agencies'] = [];
bannerSet['about-us'] = [];
bannerSet['contact-us'] = [];

bannerSet['publishers'].push({'id':'title11', 'content':'<a href="http://www.theaffiliaterace2011.com/Frontpage" target="_blank"><img src="files/105/20110728_Slideshow_AffiliateRace.jpg" /></a>'});
bannerSet['publishers'].push({'id':'title12', 'content':'<img src="files/105/20110728_Slideshow_Monetize.jpg"/>'});
bannerSet['publishers'].push({'id':'title13', 'content':'<img src="files/105/20110728_Slideshow_Relax.jpg" />'});
bannerSet['publishers'].push({'id':'title2', 'content':'<img src="files/105/20110728_Slideshow_WeConnect.jpg" /><h2>We Connect</h2><h3 id="subtitle1"><a href="publishers">Publishers with commissions</a></h3><h3 id="subtitle2"><a href="advertisers">Advertisers with consumers</a></h3><h3 id="subtitle3"><a href="agencies">Agencies with results</a></h3>'});
bannerSet['publishers'].push({'id':'title15', 'content':'<img src="files/105/20110728_Slideshow_TopBrands.jpg" />'});

bannerSet['advertisers'].push({'id':'title11', 'content':'<img src="files/105/20110728_Slideshow_NoCure.jpg" />'});
bannerSet['advertisers'].push({'id':'title12', 'content':'<img src="files/105/20110728_Slideshow_Nordics.jpg" />'});
bannerSet['advertisers'].push({'id':'title3', 'content':'<img src="files/105/20110728_Slideshow_Performance_based_marketing_solutions.jpg" /><h2>Performance based marketing solutions</h2><h3 id="subtitle4"><a href="advertisers-email-marketing-programs">Email Marketing</a></h3><h3 id="subtitle5"><a href="advertisers-campaign-types">Lead Generation</a></h3><h3 id="subtitle6"><a href="advertisers-search">Search</a></h3><h3 id="subtitle7"><a href="about-affiliate-marketing">Affiliate Marketing</a></h3>'});
bannerSet['advertisers'].push({'id':'title2', 'content':'<img src="files/105/20110728_Slideshow_WeConnect.jpg" /><h2>We Connect</h2><h3 id="subtitle1"><a href="publishers">Publishers with commissions</a></h3><h3 id="subtitle2"><a href="advertisers">Advertisers with consumers</a></h3><h3 id="subtitle3"><a href="agencies">Agencies with results</a></h3>'});
bannerSet['advertisers'].push({'id':'title15', 'content':'<img src="files/105/20110728_Slideshow_Behavioural_targeting.jpg" />'});
bannerSet['advertisers'].push({'id':'title16', 'content':'<img src="files/105/20110728_Slideshow_TrustedTopBrands.jpg" />'});

bannerSet['agencies'].push({'id':'title11', 'content':'<img src="files/105/20110728_Slideshow_Customized.jpg" />'});
bannerSet['agencies'].push({'id':'title12', 'content':'<img src="files/105/20110728_Slideshow_NoCure.jpg" />'});
bannerSet['agencies'].push({'id':'title13', 'content':'<img src="files/105/20110728_Slideshow_Nordics.jpg" />'});
bannerSet['agencies'].push({'id':'title15', 'content':'<img src="files/105/20110728_Slideshow_Behavioural_targeting.jpg" />'});
bannerSet['agencies'].push({'id':'title16', 'content':'<img src="files/105/20110728_Slideshow_TrustedTopBrands.jpg" />'});
bannerSet['agencies'].push({'id':'title3', 'content':'<img src="files/105/20110728_Slideshow_Performance_based_marketing_solutions.jpg" /><h2>Performance based marketing solutions</h2><h3 id="subtitle4"><a href="advertisers-email-marketing-programs">Email Marketing</a></h3><h3 id="subtitle5"><a href="advertisers-campaign-types">Lead Generation</a></h3><h3 id="subtitle6"><a href="advertisers-search">Search</a></h3><h3 id="subtitle7"><a href="about-affiliate-marketing">Affiliate Marketing</a></h3>'});
bannerSet['agencies'].push({'id':'title2', 'content':'<img src="files/105/20110728_Slideshow_WeConnect.jpg" /><h2>We Connect</h2><h3 id="subtitle1"><a href="publishers">Publishers with commissions</a></h3><h3 id="subtitle2"><a href="advertisers">Advertisers with consumers</a></h3><h3 id="subtitle3"><a href="agencies">Agencies with results</a></h3>'});

bannerSet['contact-us'].push({'id':'title11', 'content':'<img src="files/105/20110728_Slideshow_JPPolitiken.jpg"/>'});
bannerSet['contact-us'].push({'id':'title12', 'content':'<img src="files/105/20110728_Slideshow_Nordics.jpg"/>'});
bannerSet['contact-us'].push({'id':'title3', 'content':'<img src="files/105/20110728_Slideshow_Performance_based_marketing_solutions.jpg"/><h2>Performance based marketing solutions</h2><h3 id="subtitle4"><a href="advertisers-email-marketing-programs">Email Marketing</a></h3><h3 id="subtitle5"><a href="advertisers-campaign-types">Lead Generation</a></h3><h3 id="subtitle6"><a href="advertisers-search">Search</a></h3><h3 id="subtitle7"><a href="about-affiliate-marketing">Affiliate Marketing</a></h3>'});
bannerSet['contact-us'].push({'id':'title14', 'content':'<img src="files/105/20110728_Slideshow_Relax.jpg"/>'});
bannerSet['contact-us'].push({'id':'title15', 'content':'<img src="files/105/20110728_Slideshow_TrustedTopBrands.jpg" />'});
bannerSet['contact-us'].push({'id':'title2', 'content':'<img src="files/105/20110728_Slideshow_WeConnect.jpg" /><h2>We Connect</h2><h3 id="subtitle1"><a href="publishers">Publishers with commissions</a></h3><h3 id="subtitle2"><a href="advertisers">Advertisers with consumers</a></h3><h3 id="subtitle3"><a href="agencies">Agencies with results</a></h3>'});

bannerSet['about-us'].push({'id':'title11', 'content':'<img src="files/105/20110728_Slideshow_JPPolitiken.jpg" />'});
bannerSet['about-us'].push({'id':'title12', 'content':'<img src="files/105/20110728_Slideshow_Nordics.jpg" />'});
bannerSet['about-us'].push({'id':'title3', 'content':'<img src="files/105/20110728_Slideshow_Performance_based_marketing_solutions.jpg" /><h2>Performance based marketing solutions</h2><h3 id="subtitle4"><a href="advertisers-email-marketing-programs">Email Marketing</a></h3><h3 id="subtitle5"><a href="advertisers-campaign-types">Lead Generation</a></h3><h3 id="subtitle6"><a href="advertisers-search">Search</a></h3><h3 id="subtitle7"><a href="about-affiliate-marketing">Affiliate Marketing</a></h3>'});
bannerSet['about-us'].push({'id':'title14', 'content':'<img src="files/105/20110728_Slideshow_Relax.jpg" />'});
bannerSet['about-us'].push({'id':'title15', 'content':'<img src="files/105/20110728_Slideshow_TrustedTopBrands.jpg" />'});
bannerSet['about-us'].push({'id':'title2', 'content':'<img src="files/105/20110728_Slideshow_WeConnect.jpg" /><h2>We Connect</h2><h3 id="subtitle1"><a href="publishers">Publishers with commissions</a></h3><h3 id="subtitle2"><a href="advertisers">Advertisers with consumers</a></h3><h3 id="subtitle3"><a href="agencies">Agencies with results</a></h3>'});

function openWin(url)
{
	aWindow = window.open(url,"thewindow",'toolbar=0,location=0,directories=0,status=0,menubar=0, width=400, height=400, scrollbars, resizable');
	aWindow.focus();
}

function CheckLogin(){
var $login = $('#dwLogin');
var $password = $('#dwPassword');
if($login.length > 0 && $login.val() != '' && $login.val() != 'Username'
&& $password .length > 0 && $password .val() != '' && $password .val() != 'Password'){
document.forms[0].action = 'https://partner.smartresponse-media.com/partners/program_selective.html?list_all=&amp;time_frame=null&amp;category_id=&amp;sort=4';
document.forms[0].submit();
} else {
return false;
}
}
