function BrowserInfo() {
	var agent = window.navigator.userAgent;
	if (agent.indexOf("MSIE") != -1) {
			var start = agent.indexOf("MSIE");
			this.name = "MSIE";
			this.version = parseFloat(agent.substring(start + 5, agent.indexOf(";", start)));
	} else if (agent.indexOf("Firefox") != -1) {
			var start = agent.indexOf("Firefox");
			this.name = "Firefox";
			this.version = agent.substring(start + 8, agent.length);
			var firstDec = this.version.indexOf(".") + 1;
			while (this.version.indexOf(".", firstDec) != -1)
				this.version = this.version.substring(0, firstDec) + this.version.substring(firstDec).replace(".", "");
			this.version = parseFloat(this.version);
	} else {
			this.name = "Unknown";
			this.version = 0;
	}
}

var info = new BrowserInfo();
var userAgent = window.navigator.userAgent
var isIE = (window.navigator.userAgent.indexOf("MSIE") != -1);
var isIE6 = (info.name == "MSIE" && info.version < 7);
/*var isSafari = (window.navigator.userAgent.indexOf("Safari") != -1);
var isMac = navigator.appVersion.indexOf("Mac")!=-1;*/
var isFireFox = (window.navigator.userAgent.indexOf("Firefox") != -1);
/*var isMacFireFox = isMac && isFireFox;
var is_iPod = navigator.appVersion.indexOf("iPod")!=-1;
var is_iPhone = navigator.appVersion.indexOf("iPhone")!=-1;*/

if (info.name == "MSIE" && info.version < 7)
	document.writeln('<link href="stylesIE6.css" rel="stylesheet" type="text/css" />');
else
	document.writeln('<link href="stylesDynamic.css" rel="stylesheet" type="text/css" />');
/*if (isMac || isSafari)
	document.writeln('<link href="stylesMac.css" rel="stylesheet" type="text/css" />');

if (isMacFireFox)
	document.writeln('<link href="stylesMacFireFox.css" rel="stylesheet" type="text/css" />');

if (is_iPod || is_iPhone)
	document.writeln('<link href="styles_iPod.css" rel="stylesheet" type="text/css" />');*/


function writePngImage(url, width, height, alt) {
	if (!isIE6)
		document.write("<img alt=\"" + alt + "\" src=\"" + url + "\" style=\"width: " + width + "px; height: " + height + "px;\">");
	else
		document.write("<img src=\"spacer.png\" style=\"width: " + width + "px; height: " + height + 
			"px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + url + "', sizingMethod=scale);\">");
}

function writePngClass(url, width, height, alt, className) {
	if (!isIE6)
		document.write("<img alt=\"" + alt + "\" class=\"" + className + "\" src=\"" + url + "\" style=\"width: " + width + "px; height: " + height + "px;\">");
	else
		document.write("<img alt=\"" + alt + "\" class=\"" + className + "\"  src=\"spacer.png\" style=\"width: " + width + "px; height: " + height + 
			"px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + url + "', sizingMethod=scale);\">");
}

function writePngImageMap(url, width, height, alt, map) {
	if (!isIE6)
		document.write("<img usemap=\"" + map + "\" alt=\"" + alt + "\" src=\"" + url + "\" style=\"width: " + width + "px; height: " + height + "px;\">");
	else
		document.write("<img usemap=\"" + map + "\" src=\"spacer.png\" style=\"width: " + width + "px; height: " + height + 
			"px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + url + "', sizingMethod=scale);\">");
}

function renderFlash(src, width, height, features) {
	document.writeln('<embed src="' + src + '" quality="high" bgcolor="#ffffff" width="' + width + 
					 '" height="' + height + '" align="middle" allowscriptaccess="sameDomain" ' +
					 'type="application/x-shockwave-flash" ' + features + 
					 'pluginspage="http://www.macromedia.com/go/getflashplayer" />');
}
/* menu start */

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="Mortgage_Leads.php">Mortgage Leads</a>'
menu1[1]='<a href="Insurance_Leads.php">Insurance Leads</a>'
menu1[2]='<a href="Real_Estate_Leads.php">Real Estate Leads</a>'
menu1[3]='<a href="Debt_Consolidation_Leads.php">Debt Consolidation Leads</a>'
menu1[4]='<a href="Automotive_Leads.php">Automotive Leads</a>'
menu1[5]='<a href="Business_And_Sales_Leads.php">Sales Leads</a>'
menu1[6]='<a href="Travel_Leads.php">Travel Leads</a>'
menu1[7]='<a href="Business_And_Sales_Leads.php">Business Leads</a>'
menu1[8]='<a href="Merchant_Service_Leads.php">Merchant Service Leads</a>'

//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="Live_Transfer_Leads.php">Live Transfer Leads</a>'
menu2[1]='<a href="Web_Leads.php">Web Leads</a>'
menu2[2]='<a href="Direct_Leads.php">Direct Leads</a>'
menu2[3]='<a href="Email_Marketing.php">Email Marketing</a>'
menu2[4]='<a href="Text_Marketing.php">Text Marketing</a>'
menu2[5]='<a href="Lead_Capture.php">Lead Capture</a>'


var menuwidth='165px' //default menu width
var menubgcolor='#183f6d'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
/*menu end*/


/*img slider scripts */


$(document).ready(function(){
						   

(function($){$.scrollTo=function(a,b){return $('html,body').scrollTo(a,b)};$.fn.scrollTo=function(e,f){f=$.extend({axis:'y',speed:1},f||{});if(f.axis.length!=2)f.queue=false;if(f.queue)f.speed=Math.ceil(f.speed/2);return this.each(function(){var d=$(this),t=e,k,l,u={};switch(typeof t){case'string':if(/^([+-]=)?\d+(px)?$/.test(t))break;t=$(t,this);case'object':k=$(t).offset()}$.each(f.axis.split(''),parse);animate(f.onAfter);function parse(i,a){var b=a=='x'?'Left':'Top',p=b.toLowerCase();var c='scroll'+b;u[c]=k?k[p]+(d.is('html,body')?0:d[0][c]-d.offset()[p]):t;if(f.margin&&typeof t=='object')u[c]-=parseInt($(t).css('margin'+b))||0;if(!i&&f.queue){if(d[0][c]!=u[c])animate(f.onAfterFirst);delete u[c]}};function animate(a){d.animate(u,f.speed,f.easing,a)}})}})(jQuery);


(function($){var f={elements:'img',itemSize:{height:200,width:200},view:null,navigators:null,navigationMode:'s',speed:600,wrappers:'simple',circular:false,easing:'linear',axis:'x',margin:true,start:null,setWidth:false};function wrap(a,b,c){switch(b){case'crop':a=a.wrap('<div class="jq-ss-crop">').parent().css('overflow','hidden');case'resize':return a.css(c);case'simple':return a.wrap('<div class="jq-ss-simple">').parent();case'link':if(a.is('img'))return a.wrap('<a target="_blank" class="jq-ss-link">').parent().each(function(){this.href=this.firstChild.src});default:return a}};$.fn.scrollShow=function(e){e=$.extend({},f,e);return this.each(function(){var d=this,$v=e.view?$(e.view,this):this,$e=$(e.elements,$v),l=$e.length,q=0;$.each(e.wrappers.split(/\s*,\s*/),function(i,a){$e=wrap($e,a,e.itemSize)});$e.css(e.itemSize);if(!e.navigators){e.navigators='';e.navigationMode='r'}if(e.navigators.constructor!=Array)e.navigators=[e.navigators];$.each(e.navigationMode.split(''),function(i,b){switch(b.charAt(0)){case's':$(e.navigators[i],d).eq(0).bind('click',{dir:-1},sequential).end().eq(1).bind('click',{dir:+1},sequential);break;case'r':var c=$(e.navigators[i]||$e,d),r=$e.length/c.length;if(r===Infinity)return;c.each(function(a){$(this).bind('click',{pos:Math.floor(r*a)},random)});break}});(function(a,w){var b=(a.width()+attrs('margin')+attrs('padding')+attr('border'));do w-=b;while(w>0&&l--);if(!e.setWidth)return;do{a=a.parent();if(a[0]==$v[0])return}while(a.length>1);a.width(b*$e.length)})($e,$v.width());if(e.start!=null)random(e.start);function attrs(a){return attr(a+'Left')+attr(a+'Right')};function attr(a){return parseInt($e.css(a))||0};function sequential(a){a.data.pos=q+a.data.dir;return random(a)};function random(a){var b=typeof a=='number'?a:a.data.pos;if(b<0)b=q==0&&e.circular?l:0;else if(b>l)b=q==l&&e.circular?0:l;$v.stop().scrollTo($e[b],e);q=b;return false}})}})(jQuery);


(function( $ ){
	
	var defaults = {
		elements:'img',//elements selector (relative to view)
		itemSize:{
			height:169,
			width:147
		},
		view:null,//container of the elements, the one to fix the width.
		navigators:null,//selector to the elements to navigate the slideshow.
		navigationMode:'s',//sequential, random, localscroll
		speed:600,//speed of transition, 1 for no-animation
		wrappers:'simple',//simple,resize,crop,link
		circular:false,//should the slideshow rewind/advance on the extremes ?.
		easing:'linear',//easing equation
		axis:'x',//axis to displace the slideshow
		margin:true,//take margin in account?
		start:null, //force the scroll to start at some position element.
		setWidth:false//whether to calculate and set, the overall width of the slideshow.
	};
	
	function wrap( $els, type, size ){//wrap the photos with several different wrappers.
		switch( type ){
			case 'crop': $els = $els.wrap('<div class="jq-ss-crop">').parent().css('overflow','hidden');					
			case 'resize': return $els.css( size );
			case 'simple': return $els.wrap('<div class="jq-ss-simple">').parent();
			case 'link': 
				if( $els.is('img') )
					return $els.wrap('<a target="_blank" class="jq-ss-link">').parent().each(function(){
						this.href = this.firstChild.src;
					});
			default: return $els;					
		}
	};
	
	$.fn.scrollShow = function( settings ){
		settings = $.extend( {}, defaults, settings );
		
		return this.each(function(){
			var 
				widget	  = this,
				$view	  = settings.view ? $(settings.view, this) : this,
				$elements = $(settings.elements, $view),
				limit	  = $elements.length,
				active	  = 0;
			
			$.each( settings.wrappers.split(/\s*,\s*/), function( i, wrapper ){
				$elements = wrap( $elements, wrapper, settings.itemSize );													 
			});			
			$elements.css( settings.itemSize );//ensure the outer elements have fixed size.
			
			if( !settings.navigators ){//this shouldn't get to happen
				settings.navigators = '';
				settings.navigationMode = 'r';
			}
			
			if( settings.navigators.constructor != Array )
				settings.navigators = [settings.navigators];
			
			$.each( settings.navigationMode.split(''), function( i, type ){
				switch( type.charAt(0) ){
					case 's'://sequential navigation
						$(settings.navigators[i],widget)
							.eq(0).bind('click', { dir: -1 }, sequential ).end()//number of pic move by clicking left button
							.eq(1).bind('click', { dir: +1 }, sequential );//number of pic move by clicking right button
					break;
					case 'r'://random navigation
						var $nav = $(settings.navigators[i] || $elements, widget),
							ratio = $elements.length / $nav.length;
						if( ratio === Infinity ) return;//no navigator found
						$nav.each(function( pos ){
							$(this).bind( 'click', { pos: Math.floor(ratio*pos) }, random );												  
						});
					break;
				}
			});				

			(function( $e, w ){					  
				var imgw = ($e.width() + attrs('margin') + attrs('padding') + attr('border'));
				
				do w -= imgw;
				while( w > 0 && limit-- );//find the last element we can scroll To.
				
				if( !settings.setWidth ) return;
				
				do{
					$e = $e.parent();
					if( $e[0] == $view[0] )
						return;
				}while( $e.length > 1 );
				$e.width( imgw * $elements.length  );//if there's a container for the elements, calculate it's width.
				
			})( $elements, $view.width() );

			if( settings.start != null )
				random( settings.start );
			
			function attrs( name ){
				return attr(name+'Left') + attr(name+'Right');
			};
			function attr( name ){
				return parseInt($elements.css(name)) || 0;	
			};
			
			function sequential( event ){
				event.data.pos = active + event.data.dir;
				return random( event );
			};
			
			function random( event ){
				var pos = typeof event == 'number' ? event : event.data.pos;
				if( pos < 0 )
					pos = active == 0 && settings.circular ? limit : 0;
				else if( pos > limit )
					pos = active == limit && settings.circular ? 0 : limit;
	
				$view.stop().scrollTo( $elements[pos], settings );
				active = pos;
				return false;
			};				
		});
	};
		  
});
						   });

