////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//  Copyright Virtual Abstract
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var timevar = 800;
var SlideIndex = 0;
var displayMode;
var displayModeCACHE;
var searchType;


function Send2F()
{
	
	//alert (displayMode);

		if(window.flashID1) window.document["flashID1"].SetVariable("displayMode",displayMode);
		if(document.flashID1) document.flashID1.SetVariable("displayMode", displayMode);			
		
		if (searchType == 'name')
		{
			if(window.flashID1) window.document["flashID1"].SetVariable("FullName", document.nameSearch.searchFullName.value);
			if(document.flashID1) document.flashID1.SetVariable("FullName", document.nameSearch.searchFullName.value);
			
			if(window.flashID1) window.document["flashID1"].SetVariable("Country", document.nameSearch.tb.value);
			if(document.flashID1) document.flashID1.SetVariable("Country", document.nameSearch.tb.value);	
			
			//alert (country_searchlinks);
			
		} else if (searchType == 'phone') {
			if(window.flashID1) window.document["flashID1"].SetVariable("Phone", document.phoneSearch.searchPhoneNumber.value);
			if(document.flashID1) document.flashID1.SetVariable("Phone", document.phoneSearch.searchPhoneNumber.value);
		} else if (searchType == 'email') {
			if(window.flashID1) window.document["flashID1"].SetVariable("Email", document.emailSearch.searchEmailAddress.value);
			if(document.flashID1) document.flashID1.SetVariable("Email", document.emailSearch.searchEmailAddress.value);
		}
		
	if(window.flashID1) window.document["flashID1"].SetVariable("searchType", searchType);
	if(document.flashID1) document.flashID1.SetVariable("searchType",searchType);

}



function SlideShow(action) 
{
		
	var ArrSlideShow=new Array(

		"tmb_socialnetwork.jpg",
		"tmb_criminalcheck.jpg",
		"tmb_peoplesearch.jpg",
		"tmb_court.jpg",
		"tmb_birth.jpg",
		"tmb_passenger.jpg",
		"tmb_marriage.jpg",
		"tmb_sexoffender.jpg",
		"tmb_death.jpg",
		"tmb_propertytax.jpg",
		"tmb_military.jpg",
		"tmb_adoption.jpg",
		"tmb_census.jpg",
		"tmb_voterregistration.jpg",
		"tmb_driverslicense.jpg",
		"tmb_licensesearch.jpg"			
	);
	
	var ArrSlideShowTitle=new Array(

		"Comprehensive Email Sample Report",	
		"Criminal Check Sample Report",
		"People Search Sample Report",
		"Court Records Sample Report",
		"Birth Records Sample Report",
		"Passenger Records Sample Report",
		"Marriage Records Sample Report",
		"Sex Offender Sample Report",
		"Death Records Sample Report",
		"Property Tax Sample Report",
		"Military Records Sample Report",
		"Adoption Records Sample Report",
		"Census Records Sample Report",
		"Voter Registration Sample Report",
		"Driver's License Sample Report",
		"DMV Records Sample Report"

	);	
	
		
	if (action == 'next')
	{
		

			if (SlideIndex >= ArrSlideShow.length-1)
			{
				SlideIndex = 0;
			} else { 
				SlideIndex ++;	
			}
	
	
		document.getElementById('SlideShow').innerHTML = '<img src="../images/'+ArrSlideShow[SlideIndex]+'" width="270" height="172" hspace="40" style="border:2px #0099CC solid" />';
		document.getElementById('SlideShowTitle').innerHTML = ArrSlideShowTitle[SlideIndex];
		
	} else if (action == 'back') {
		
		//		alert (SlideIndex+' - '+ArrSlideShow.length);

			if (SlideIndex == 0)
			{
				SlideIndex = ArrSlideShow.length-1;
			} else {
				SlideIndex --;	
			}
			
			

		document.getElementById('SlideShow').innerHTML = '<img src="../images/'+ArrSlideShow[SlideIndex]+'" width="270" height="172" hspace="40" style="border:2px #0099CC solid" />';
		document.getElementById('SlideShowTitle').innerHTML = ArrSlideShowTitle[SlideIndex];
	}
	


}



function ChangeCountry(country) 
{
			document.getElementById('changeflag').innerHTML = '<img src="images/flags/'+country+'.gif" alt="" width="45" height="25" style="position:absolute; margin-top:7px;margin-left:8px" />';
}

//function LastOffer() 
//{
//
//	if (confirm('Last Offer'))
//	{
//		window.location.href='http://bluesnews.com/';
//	}
//
//}

function CheckEmail(str) {
	
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid Email Address - Please Enter an Email to Begin Your Preliminary Search.")
		   return false
		}

		if (str.indexOf("@")==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address - Please Enter an Email to Begin Your Preliminary Search.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Enter a Valid Email Address to Begin Your Search")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Enter a Valid Email Address to Begin Your Search")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Enter a Valid Email Address to Begin Your Search")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Enter a Valid Email Address to Begin Your Search")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Enter a Valid Email Address to Begin Your Search")
		    return false
		 }

 		 return true					
	}



function StartLoading(formtype) 
{
	
	

	if (formtype == 'nameSearch')
	{

			if (document.nameSearch.searchFullName.value == '' || document.nameSearch.searchFullName.value == 'Enter the Person\'s Full Name')
			{
				
				alert ('Enter Full Name to Begin Your Search');
				document.nameSearch.searchFullName.focus();
				return false;
			
			} else {
				
				searchType = 'name';
			
				document.getElementById('loader_swf').style.display = '';						
				//reposition();
			}
	}
			
			
	
	if (formtype == 'phoneSearch')
	{			
			
			if (document.phoneSearch.searchPhoneNumber.value == '' || document.phoneSearch.searchPhoneNumber.value == 'Enter Phone Number')
			{
				
				alert ('Enter a Phone Number to Begin Your Search');
				document.phoneSearch.searchPhoneNumber.focus();
				return false;
			
			} else {
				
				document.getElementById('loader_swf').style.display = '';	
				//reposition();
			}
	}
	
	if (formtype == 'emailSearch')
	{			
			
			

			
			if (document.emailSearch.searchEmailAddress.value == '' || document.emailSearch.searchEmailAddress.value == 'Enter an Email Address')
			{
				
				alert ('Enter an Email Address to Begin Your Search');
				document.emailSearch.searchEmailAddress.focus();
				return false;
			
			} else {
				
				if (CheckEmail(document.emailSearch.searchEmailAddress.value)) 
				{
				
					document.getElementById('loader_swf').style.display = '';	
					//reposition();
				
				} else {
					//alert ('Enter an Email Address to Begin Your Search');
					document.emailSearch.searchEmailAddress.focus();
					return false;				
					
				
				}
				
			}
	}	
	
	displayMode = "search";
	
		if (displayModeCACHE == 1)
		{
		setTimeout('Send2F();', 200);
		}	
	
		displayModeCACHE = 1;

	
	
var getheight = document.body.offsetHeight;	
	
			//document.getElementById('whiteout').style.display = '';
			//document.getElementById('whiteout').style.height = getheight+'px';			
			//document.body.style.overflow = 'hidden'; 	
	
	
}



function BuyPop() 
{

window.location.hash="top"; 

	displayMode = "buy";
	document.getElementById('loader_swf').style.display = '';	
	reposition();

		if (displayModeCACHE == 1)
		{
		setTimeout('Send2F();', 200);
		}
	
		displayModeCACHE = 1;
		

		
}
	
	




function HideLoading() 
{
			document.getElementById('loader_swf').style.display = 'none';
}


	
function SearchBoxToggle(div) 
{


	if (div == 'search_fields_name')
	{
		
		searchType = 'name';
		
		//document.getElementById('bubble_caption_pos').style.paddingRight = '120px';		

		document.getElementById('search_fields_name').style.display = 'block';
		document.getElementById('search_fields_nameHL').style.borderBottom = '1px solid #7C9AA3';
		
		document.getElementById('search_fields_phone').style.display = 'none';
		document.getElementById('search_fields_phoneHL').style.borderBottom = '0px';

		document.getElementById('search_fields_email').style.display = 'none';
		document.getElementById('search_fields_emailHL').style.borderBottom = '0px';


		setTimeout("document.nameSearch.searchFullName.focus()",200);

				
			if (document.nameSearch.searchFullName.value != '') 
			{
				document.getElementById('nameSearchBG').style.display = 'none';
				document.nameSearch.searchFullName.style.color='black'; 
			}	

		
	} else if (div == 'search_fields_phone') {
		
		searchType = 'phone';


//document.getElementById('bubble_caption_pos').style.paddingRight = '320px';		
		
		document.getElementById('search_fields_name').style.display = 'none';
		document.getElementById('search_fields_nameHL').style.borderBottom = '0px';
		
		document.getElementById('search_fields_phone').style.display = 'block';
		document.getElementById('search_fields_phoneHL').style.borderBottom = '1px solid #7C9AA3';
		
		if (document.getElementById('search_fields_email') )
		{
			document.getElementById('search_fields_email').style.display = 'none';
			document.getElementById('search_fields_emailHL').style.borderBottom = '0px';
		}
		

		setTimeout("document.phoneSearch.searchPhoneNumber.focus()",200);

				
			if (document.phoneSearch.searchPhoneNumber.value != '') 
			{
				document.getElementById('phoneSearchBG').style.display = 'none';
				document.phoneSearch.searchPhoneNumber.style.color='black'; 
			}	
		
		
	} else if (div == 'search_fields_email') {

	//	document.getElementById('bubble_caption_pos').style.paddingRight = '280px';		

		searchType = 'email';

		document.getElementById('search_fields_name').style.display = 'none';
		document.getElementById('search_fields_nameHL').style.borderBottom = '0px';
		
		document.getElementById('search_fields_phone').style.display = 'none';
		document.getElementById('search_fields_phoneHL').style.borderBottom = '0px';
		
		document.getElementById('search_fields_email').style.display = 'block';
		document.getElementById('search_fields_emailHL').style.borderBottom = '1px solid #7C9AA3';
		
		

		setTimeout("document.emailSearch.searchEmailAddress.focus()",200);

				
			if (document.emailSearch.searchEmailAddress.value != '') 
			{
				document.getElementById('emailSearchBG').style.display = 'none';
				document.emailSearch.searchEmailAddress.style.color='black'; 
			}	
		
		
	}
}



function loadcontent() 
{


//document.getElementById("GuideSearchButtonOffset").offsetHeight;
//ScaleDIV("GuideSearchButton",0,220,0,0);
//document.getElementById("GuideSearchButton").style.border = '1px solid #e2e2e2';


//MoveDIV(	"PNGimage",		-300,		55,		-350,		0		);
		//	divid,			xstart,		xend,	ystart,		yend
}

// .MOVE

function MoveDIV(div,xstart,xend,ystart,yend) 
{

	var iy = ystart;

	for (ix=xstart;ix<=xend;ix++)
	{
		if (iy<=yend)
		{
			iy++;
		}
		
		eval('MoveDIVanim("'+div+'",'+iy+','+ix+',1)');
	}
	
}


function MoveDIVanim(div,xp,yp,anitime) 
{
	timevar = timevar+anitime;	
	setTimeout(function() { 
	document.getElementById(div).style.marginLeft = yp + "px";
	document.getElementById(div).style.marginTop = xp + "px";
	}, timevar);

}



// .SCALE

function ScaleDIV(div,xstart,xend,ystart,yend) 
{
	for (ix=xstart;ix<=xend;ix++)
	{
		eval('ScaleDIVanim("'+div+'",0,'+ix+',2)');
	}
	
}

function ScaleDIVanim(div,xp,yp,anitime) 
{
	timevar = timevar+anitime;	
	setTimeout(function() { document.getElementById(div).style.height = yp+"px";}, timevar);

}


function OpacityDIV(div) 
{
	
	var element=document.getElementById(div);
	
	for (ix=0;ix<=100;ix++)
	{
		OpacityDIVanim(element,ix);
	}
	
}

function OpacityDIVanim(object,opacityPct)
{
	timevar = timevar+10;	
	//setTimeout(function() { document.getElementById(div).style.MozOpacity = opacityPct/100; document.getElementById('DEBUG_var1').innerHTML = opacityPct/100;}, timevar);

	setTimeout(function() { object.style.filter = 'alpha(opacity=' + opacityPct + ')'; }, timevar);
	
	document.getElementById('DEBUG_var6').innerHTML = object.style.filter;
	document.getElementById('DEBUG_var6').innerHTML = object;
	
	//document.getElementById('DEBUG_var2').innerHTML = object.style.filter;
	//document.getElementById('DEBUG_var3').innerHTML = object.style.MozOpacity;
	document.getElementById('DEBUG_var4').innerHTML = object.style.opacity;


//	// IE.
//	object.style.filter = 'alpha(opacity=' + opacityPct + ')';

//	// Old mozilla and firefox
//	document.getElementById(div).style.MozOpacity = opacityPct/100;
	
	// Everything else.
//	document.getElementById(div).style.opacity = opacityPct/100;


}





loadcontent();


