Location: PHPKode > projects > DataDivisions > includes/funcDisplayLog.php
<?
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# DataDivisions, Build 1.0, 12/11/2003                                      #
# FileName: funcDisplayLog.php                                              #
# File Description:                                                         #
#   Provides functions for website statistic displays (back-end, middle and #
#   front-end functionality)                                                #
#   Functions Included In This File:                                        #
#     globalLogEreg(), visitsDayOfMonth(), pagesDayOfMonth()                #
#     hitsDayOfMonth(), visitsDayOfWeek(), pagesDayOfWeek()                 #
#     hitsDayOfWeek(), visitsHourOfDay(), pagesHourOfDay(), hitsHourOfDay() #
#     visitorsFromDomain(), visitorsFromCountry()                           #
#     visitorsFromWorldRegion(), hostAddresses(), lastHostAddresses()       #
#     earliestHostAddresses(), robotHits(), durationIndivVisits()           #
#     fileTypesHit(), fileTypesHitBandwidth(), pagesHit(), pagesHitByName() #
#     operatingSystems(), browsers(), incomingPageReferrer()                #
#     incomingServerReferrer(), incomingSearchPhrases()                     #
#     incomingSearchWords(), errorCodes()                                   #
#                                                                           #
# +-----------------------------------------------------------------------+ #
# | DataDivisions - Website Statistic Visualization Software              | #
# | Copyright (c) 2003, Brian Willison                                    | #
# +-----------------------------------------------------------------------+ #
# | The contents of this file are subject to the GNU General Public       | #
# | License version 2 (June 1991). This file and all its contents (incl.  | #
# | functions, methods, etc.) are free for general use within any         | #
# | community. This software is distributed with the intent to allow      | #
# | developers the opportunity to copy, manipulate and revamp this        | #
# | application in part or whole for best use cases.                      | #
# |                                                                       | #
# | This software is distributed "AS-IS" with no warranties of any kind   | #
# | either expressed or implied.                                          | #
# |                                                                       | #
# | Please refer to the GPL license document for more information:        | #
# | (_docs/gplLicense.pdf)                                                | #
# +-----------------------------------------------------------------------+ #
# | Developer, Designer, Initial Creator:                                 | #
# | Brian Willison (hide@address.com)                       | #
# +-----------------------------------------------------------------------+ #
# | Initial Download Reference:                                           | #
# | http://datadivisions.sourceforge.net                                  | #
# +-----------------------------------------------------------------------+ #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

require_once(funcDisplayCommonFile);

// Common Ereg For All Log File Functions
function globalLogEreg($start,$end) {
	$rawDataArray = array();									// initialize return value
	$rawData = file(logFile);									// open log file and put into array
	$lineCheck = 0;												// initialize line check (determines if to read next array values)
	foreach ($rawData as $lineNum=>$lineValue) {				// go through each value within log file array
		if (preg_match("/\b$start\b/",$lineValue)) {			// check for start of what is needed, sent from orig. display function
			$lineCheck = 1;										// declare start, so next time through read
		} else {
			if ($lineCheck == 1) {								// start declared, so line needs to be read
				if (!ereg($end,$lineValue))						// if line isn't terminating line continue
					array_push($rawDataArray,$lineValue);		// add to return value each good line
				else
					break;										// break out of loop when reached terminating line
			}
		}
	}
	return $rawDataArray;										// return string of contents to orig. display function
}

// Function: Visits Day Of Month - refNum = 001
function visitsDayOfMonth($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Day Of Month x Number Of Visitors";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Visits By Day Of Month",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_DAY","END_DAY");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[substr($dataArray[0],4,2)."/".substr($dataArray[0],6,2)."/".substr($dataArray[0],0,4)] = $dataArray[4];
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Pages Day Of Month - refNum = 002
function pagesDayOfMonth($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Day Of Month x Number Of Pages Served";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Pages By Day Of Month",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_DAY","END_DAY");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[substr($dataArray[0],4,2)."/".substr($dataArray[0],6,2)."/".substr($dataArray[0],0,4)] = $dataArray[1];
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Hits Day Of Month - refNum = 003
function hitsDayOfMonth($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Day Of Month x Number Of Page Hits";
	$dataArray = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Hits By Day Of Month",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_DAY","END_DAY");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[substr($dataArray[0],4,2)."/".substr($dataArray[0],6,2)."/".substr($dataArray[0],0,4)] = $dataArray[2];
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Visits Day Of Week - refNum = 004
function visitsDayOfWeek($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Day Of Week x Number Of Visitors";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Visits By Day Of Week",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$monArray = array();$tuesArray = array();$wedArray = array();$thurArray = array();$friArray = array();$satArray = array();$sunArray = array();
	$monTotal = 0;$tuesTotal = 0;$wedTotal = 0;$thurTotal = 0;$friTotal = 0;$satTotal = 0;$sunTotal = 0;
	$htmlReturnArray = globalLogEreg("BEGIN_DAY","END_DAY");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		switch(getTextDayOfWeek($dataArray[0])) {
			case "Monday":array_push($monArray,$dataArray[4]);break;
			case "Tuesday":array_push($tuesArray,$dataArray[4]);break;
			case "Wednesday":array_push($wedArray,$dataArray[4]);break;
			case "Thursday";array_push($thurArray,$dataArray[4]);break;
			case "Friday";array_push($friArray,$dataArray[4]);break;
			case "Saturday";array_push($satArray,$dataArray[4]);break;
			case "Sunday";array_push($sunArray,$dataArray[4]);break;
		}
	}
	for ($i=0; $i<sizeof($monArray); $i++) $monTotal += $monArray[$i];
	for ($i=0; $i<sizeof($tuesArray); $i++) $tuesTotal += $tuesArray[$i];
	for ($i=0; $i<sizeof($wedArray); $i++) $wedTotal += $wedArray[$i];
	for ($i=0; $i<sizeof($thurArray); $i++) $thurTotal += $thurArray[$i];
	for ($i=0; $i<sizeof($friArray); $i++) $friTotal += $friArray[$i];
	for ($i=0; $i<sizeof($satArray); $i++) $satTotal += $satArray[$i];
	for ($i=0; $i<sizeof($sunArray); $i++) $sunTotal += $sunArray[$i];
	$dataArrayFull["Monday"] = $monTotal;
	$dataArrayFull["Tuesday"] = $tuesTotal;
	$dataArrayFull["Wednesday"] = $wedTotal;
	$dataArrayFull["Thursday"] = $thurTotal;
	$dataArrayFull["Friday"] = $friTotal;
	$dataArrayFull["Saturday"] = $satTotal;
	$dataArrayFull["Sunday"] = $sunTotal;
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Pages Day Of Week - refNum = 005
function pagesDayOfWeek($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Day Of Week x Number Of Pages Served";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Pages By Day Of Week",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$monArray = array();$tuesArray = array();$wedArray = array();$thurArray = array();$friArray = array();$satArray = array();$sunArray = array();
	$monTotal = 0;$tuesTotal = 0;$wedTotal = 0;$thurTotal = 0;$friTotal = 0;$satTotal = 0;$sunTotal = 0;
	$htmlReturnArray = globalLogEreg("BEGIN_DAY","END_DAY");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		switch(getTextDayOfWeek($dataArray[0])) {
			case "Monday":array_push($monArray,$dataArray[1]);break;
			case "Tuesday":array_push($tuesArray,$dataArray[1]);break;
			case "Wednesday":array_push($wedArray,$dataArray[1]);break;
			case "Thursday";array_push($thurArray,$dataArray[1]);break;
			case "Friday";array_push($friArray,$dataArray[1]);break;
			case "Saturday";array_push($satArray,$dataArray[1]);break;
			case "Sunday";array_push($sunArray,$dataArray[1]);break;
		}
	}
	for ($i=0; $i<sizeof($monArray); $i++) $monTotal += $monArray[$i];
	for ($i=0; $i<sizeof($tuesArray); $i++) $tuesTotal += $tuesArray[$i];
	for ($i=0; $i<sizeof($wedArray); $i++) $wedTotal += $wedArray[$i];
	for ($i=0; $i<sizeof($thurArray); $i++) $thurTotal += $thurArray[$i];
	for ($i=0; $i<sizeof($friArray); $i++) $friTotal += $friArray[$i];
	for ($i=0; $i<sizeof($satArray); $i++) $satTotal += $satArray[$i];
	for ($i=0; $i<sizeof($sunArray); $i++) $sunTotal += $sunArray[$i];
	$dataArrayFull["Monday"] = $monTotal;
	$dataArrayFull["Tuesday"] = $tuesTotal;
	$dataArrayFull["Wednesday"] = $wedTotal;
	$dataArrayFull["Thursday"] = $thurTotal;
	$dataArrayFull["Friday"] = $friTotal;
	$dataArrayFull["Saturday"] = $satTotal;
	$dataArrayFull["Sunday"] = $sunTotal;
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Hits Day Of Week - refNum = 006
function hitsDayOfWeek($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Day Of Week x Number Of Page Hits";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Hits By Day Of Week",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$monArray = array();$tuesArray = array();$wedArray = array();$thurArray = array();$friArray = array();$satArray = array();$sunArray = array();
	$monTotal = 0;$tuesTotal = 0;$wedTotal = 0;$thurTotal = 0;$friTotal = 0;$satTotal = 0;$sunTotal = 0;
	$htmlReturnArray = globalLogEreg("BEGIN_DAY","END_DAY");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		switch(getTextDayOfWeek($dataArray[0])) {
			case "Monday":array_push($monArray,$dataArray[2]);break;
			case "Tuesday":array_push($tuesArray,$dataArray[2]);break;
			case "Wednesday":array_push($wedArray,$dataArray[2]);break;
			case "Thursday";array_push($thurArray,$dataArray[2]);break;
			case "Friday";array_push($friArray,$dataArray[2]);break;
			case "Saturday";array_push($satArray,$dataArray[2]);break;
			case "Sunday";array_push($sunArray,$dataArray[2]);break;
		}
	}
	for ($i=0; $i<sizeof($monArray); $i++) $monTotal += $monArray[$i];
	for ($i=0; $i<sizeof($tuesArray); $i++) $tuesTotal += $tuesArray[$i];
	for ($i=0; $i<sizeof($wedArray); $i++) $wedTotal += $wedArray[$i];
	for ($i=0; $i<sizeof($thurArray); $i++) $thurTotal += $thurArray[$i];
	for ($i=0; $i<sizeof($friArray); $i++) $friTotal += $friArray[$i];
	for ($i=0; $i<sizeof($satArray); $i++) $satTotal += $satArray[$i];
	for ($i=0; $i<sizeof($sunArray); $i++) $sunTotal += $sunArray[$i];
	$dataArrayFull["Monday"] = $monTotal;
	$dataArrayFull["Tuesday"] = $tuesTotal;
	$dataArrayFull["Wednesday"] = $wedTotal;
	$dataArrayFull["Thursday"] = $thurTotal;
	$dataArrayFull["Friday"] = $friTotal;
	$dataArrayFull["Saturday"] = $satTotal;
	$dataArrayFull["Sunday"] = $sunTotal;
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Visits Hour Of Day - refNum = 007
function visitsHourOfDay($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Hour Of Day x Number Of Visits";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Visits By Hour Of Day",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_TIME","END_TIME");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[get12HourTime($dataArray[0])] = $dataArray[1];
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Pages Hour Of Day - refNum = 008
function pagesHourOfDay($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Hour Of Day x Number Of Pages Served";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Pages By Hour Of Day",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_TIME","END_TIME");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[get12HourTime($dataArray[0])] = $dataArray[1];
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Hits Hour Of Day - refNum = 009
function hitsHourOfDay($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Hour Of Day x Number Of Page Hits";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Hits By Hour Of Day",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_TIME","END_TIME");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[get12HourTime($dataArray[0])] = $dataArray[2];
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Visitors From Domain - refNum = 010
function visitorsFromDomain($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Domain Name x Number Of Visits";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Top 25 Domains Hitting Website",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_DOMAIN","END_DOMAIN");
	for ($i=0; $i<25; $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[strtoupper($dataArray[0])] = $dataArray[1];
	}
	// Shuffle Associative Array For Excitement
	if ($displayType == "plot") {
		$dataArrayFull = genShuffleAssoc($dataArrayFull);
	} else {
		natsort($dataArrayFull);
		$dataArrayFull = array_reverse($dataArrayFull);
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Visitors From Country - refNum = 011
function visitorsFromCountry($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	// Set To Nothing As Self-Explanatory & Disrupts Spacing Due To Text Already Included
	$displayDescription = ""; //Number Of Visitors x Country
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Top Visitors By Country",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_DOMAIN","END_DOMAIN");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		switch($dataArray[0]) {
			// Add All United States Info (.com,.edu,.mil...) Together
			case "arpa":
				if ($displayType!="plot") {
					if (isset($dataArrayFull["United States"])) $dataArrayFull["United States"] += $dataArray[1];
					else $dataArrayFull["United States"] = $dataArray[1];
				} else {
					if (isset($dataArrayFull["us"])) $dataArrayFull["us"] += $dataArray[1];
					else $dataArrayFull["us"] = $dataArray[1];
				}
			break;
			case "net":
				if ($displayType!="plot") {
					if (isset($dataArrayFull["United States"])) $dataArrayFull["United States"] += $dataArray[1];
					else $dataArrayFull["United States"] = $dataArray[1];
				} else {
					if (isset($dataArrayFull["us"])) $dataArrayFull["us"] += $dataArray[1];
					else $dataArrayFull["us"] = $dataArray[1];
				}
			break;
			case "org":
				if ($displayType!="plot") {
					if (isset($dataArrayFull["United States"])) $dataArrayFull["United States"] += $dataArray[1];
					else $dataArrayFull["United States"] = $dataArray[1];
				} else {
					if (isset($dataArrayFull["us"])) $dataArrayFull["us"] += $dataArray[1];
					else $dataArrayFull["us"] = $dataArray[1];
				}
			break;
			case "edu":
				if ($displayType!="plot") {
					if (isset($dataArrayFull["United States"])) $dataArrayFull["United States"] += $dataArray[1];
					else $dataArrayFull["United States"] = $dataArray[1];
				} else {
					if (isset($dataArrayFull["us"])) $dataArrayFull["us"] += $dataArray[1];
					else $dataArrayFull["us"] = $dataArray[1];
				}
			break;
			case "gov":
				if ($displayType!="plot") {
					if (isset($dataArrayFull["United States"])) $dataArrayFull["United States"] += $dataArray[1];
					else $dataArrayFull["United States"] = $dataArray[1];
				} else {
					if (isset($dataArrayFull["us"])) $dataArrayFull["us"] += $dataArray[1];
					else $dataArrayFull["us"] = $dataArray[1];
				}
			break;
			case "mil":
				if ($displayType!="plot") {
					if (isset($dataArrayFull["United States"])) $dataArrayFull["United States"] += $dataArray[1];
					else $dataArrayFull["United States"] = $dataArray[1];
				} else {
					if (isset($dataArrayFull["us"])) $dataArrayFull["us"] += $dataArray[1];
					else $dataArrayFull["us"] = $dataArray[1];
				}
			break;
			case "ip":
				if ($displayType!="plot") {
					if (isset($dataArrayFull["United States"])) $dataArrayFull["United States"] += $dataArray[1];
					else $dataArrayFull["United States"] = $dataArray[1];
				} else {
					if (isset($dataArrayFull["us"])) $dataArrayFull["us"] += $dataArray[1];
					else $dataArrayFull["us"] = $dataArray[1];
				}
			break;
			case "us":
				if ($displayType!="plot") {
					if (isset($dataArrayFull["United States"])) $dataArrayFull["United States"] += $dataArray[1];
					else $dataArrayFull["United States"] = $dataArray[1];
				} else {
					if (isset($dataArrayFull["us"])) $dataArrayFull["us"] += $dataArray[1];
					else $dataArrayFull["us"] = $dataArray[1];
				}
			break;
			// Gather All Country Data
			case "ad":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Andorra",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ae":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"United Arab Emirates",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ag":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Antigua and Barbuda",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ai":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Anguilla",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "al":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Albania",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "am":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Armenia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "an":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Netherland Antilles",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ao":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Angola",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "aq":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Antartica",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ar":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Argentina",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "as":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"American Samoa",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "at":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Austria",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "au":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Australia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "aw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Aruba",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "az":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Azerbijan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ba":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bosnia & Herzegovina",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bb":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Barbados",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bd":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bangladesh",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "be":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Belgium",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bf":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Burkina Faso",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bulgaria",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bh":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bahrain",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bi":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Barundi",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bj":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Benin",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bermuda",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Brunei Darussalam",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bo":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bolivia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "br":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Brazil",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bs":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bahamas",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bt":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bhutan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bv":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Bouvet Island",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Botswana",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "by":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Belarus",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "bz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Belize",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ca":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Canada",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cf":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Central African Republic",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Congo",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ch":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Switzerland",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ci":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Cote d'Ivoire",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ck":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Cook Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cl":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Chile",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Cameroon",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"China",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "co":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Colombia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Costa Rica",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cu":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Cuba",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cv":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Cape Verde",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cx":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Christmas Island",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cy":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Cyprus",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "cz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Czech Republic",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "de":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Germany",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "dj":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Djibouti",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "dk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Denmark",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "dm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Dominica",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "do":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Dominican Republic",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "dz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Algeria",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ec":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Ecuador",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ee":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Estonia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "eg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Egypt",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "eh":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Western Sahara",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "er":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Eritrea",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "es":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Spain",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "et":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Ethiopia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "fi":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Finland",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "fj":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Fiji",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "fk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Falkland Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "fm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Micronesia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "fo":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Faroe Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "fr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"France",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ga":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Gabon",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gb":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"United Kingdom",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gd":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Grenada",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ge":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Georgia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gf":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"French Guinea",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Guernsey",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gh":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Ghana",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gi":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Gibraltar",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gl":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Greenland",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Gambia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Guinea",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gp":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Guadeloupe",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gq":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Equitorial Guinea",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Greece",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gs":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Southern Georgia & South Sandwich Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gt":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Guatemala",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gu":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Guam",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Guinea Bissau",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "gy":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Guyana",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "hk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Hong Kong",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "hm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Heard & McDonald Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "hn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Honduras",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "hr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Croatia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ht":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Haiti",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "hu":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Hungary",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "id":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Indonesia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ie":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Ireland",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "il":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Israel",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "im":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Isle of Man",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "in":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"India",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "io":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"British Indian Ocean Territory",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "iq":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Iraq",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ir":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Iran",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "is":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Iceland",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "it":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Italy",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "je":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Jersey",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "jm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Jamaica",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "jo":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Jordan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "jp":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Japan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ke":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Kenya",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "kg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Kyrgyzstan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "kh":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Cambodia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ki":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Kiribati",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "km":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Comoros",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "kn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"St. Kitts & Nevis",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "kp":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"South Korea",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "kr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"North Korea",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "kw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Kuwait",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ky":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Cayman Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "kz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Kazakhstan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "la":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Laos",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "lb":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Lebanon",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "lc":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"St. Lucia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "li":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Lichtenstein",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "lk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Sri Lanka",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "lr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Liberia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ls":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Lesotho",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "lt":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Lithuania",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "lu":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Luxemburg",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "lv":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Latvia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ly":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Libyan Arab Jamahiriya",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ma":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Morocco",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mc":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Monaco",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "md":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Moldova",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Madagascar",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mh":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Marshall Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Macedonia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ml":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Mali",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Mayanmar",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Mongolia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mo":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Macau",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mp":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Northern Marina Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mq":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Martinique",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Mauritania",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ms":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Monserrat",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mt":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Malta",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mu":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Mauritius",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mv":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Maldives",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Malawi",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mx":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Mexico",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "my":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Malaysia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "mz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Mozambique",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "na":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Namibia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "nc":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"New Calcedonia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ne":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Niger",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "nf":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Norfolk Island",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ng":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Nigeria",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ni":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Nicaragua",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "nl":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Netherlands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "no":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Norway",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "np":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Nepal",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "nr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Nauru",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "nu":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Niue",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "nz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"New Zealand",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "om":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Oman",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pa":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Panama",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pe":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Peru",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pf":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"French Polynesia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Papa New Guinea",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ph":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Phillipines",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Pakistan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pl":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Poland",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"St. Pierre & Miquelon",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Pitcairn",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Puerto Rico",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ps":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Palestine",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pt":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Portugal",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "pw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Palau",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "py":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Paraguay",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "qa":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Qatar",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "re":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Reunion",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ro":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Romania",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ru":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Russian Federation",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "rw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Rwanda",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sa":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Saudi Arabia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sb":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Soloman Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sc":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Seychelles",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sd":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Sudan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "se":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Sweden",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Singapore",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sh":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"St. Helena",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "si":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Slovenia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Slovak Republic",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sl":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Sierra Leone",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"San Marino",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Senegal",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "so":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Somalia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Surinam",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "st":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Sao Tome & Principe",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sv":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"El Salvador",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sy":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Syrian Arab Republic",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "sz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Swaziland",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tc":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Turks & Caicos Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "td":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Chad",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tf":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"French Southern Territories",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Togo",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "th":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Thailand",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tj":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Tajikistan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Tokelau",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Turkmenistan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Tunisia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "to":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Tongo",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tp":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"East Timor",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tr":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Turkey",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tt":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Trinidad & Tobago",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tv":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Tuvalu",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Taiwan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "tz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Tanzania",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ua":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Ukraine",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ug":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Uganda",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "uk":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"United Kingdom",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "us":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"United States",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "uy":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Uraguay",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "uz":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Uzbekistan",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "va":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Vatican City",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "vc":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"St. Vincent & the Grenadines",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ve":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Venezuela",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "vg":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"British Virgin Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "vi":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"American Virgin Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "vn":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Vietnam",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "vu":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Vanuatu",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "wf":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Wallis & Futuna Islands",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ws":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Samoa",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "ye":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Yemen",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "yt":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Mayotte",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "yu":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Yugoslavia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "za":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"South Africa",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "zm":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Zambia",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			case "zw":if($displayType!="plot")$dataArrayFull[ereg_replace($dataArray[0],"Zimbabwe",$dataArray[0])]=$dataArray[1];else$dataArrayFull[$dataArray[0]]=$dataArray[1];break;
			default:break;
		}
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Visitors From World Region - refNum = 012
function visitorsFromWorldRegion($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Number Of Visitors x Geographic Location";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Visitors From World Region",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$northAmericaArray = array();$centralAmericaArray = array();$southAmericaArray = array();$northernEuropeArray = array();$westernEuropeArray = array();$easternEuropeArray = array();$africaArray = array();$middleEastArray = array();$asiaArray = array();$oceaniaArray = array();$unknownArray = array();
	$northAmericaTotal = 0;$centralAmericaTotal = 0;$southAmericaTotal = 0;$northernEuropeTotal = 0;$westernEuropeTotal = 0;$easternEuropeTotal = 0;$africaTotal = 0;$middleEastTotal = 0;$asiaTotal = 0;$oceaniaTotal = 0;$unknownTotal = 0;
	$htmlReturnArray = globalLogEreg("BEGIN_DOMAIN","END_DOMAIN");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		switch ($dataArray[0]) {
			// North American
			case "ag":array_push($northAmericaArray,$dataArray[1]);break;
			case "bb":array_push($northAmericaArray,$dataArray[1]);break;
			case "bs":array_push($northAmericaArray,$dataArray[1]);break;
			case "ca":array_push($northAmericaArray,$dataArray[1]);break;
			case "ip":array_push($northAmericaArray,$dataArray[1]);break;
			case "kn":array_push($northAmericaArray,$dataArray[1]);break;
			case "lc":array_push($northAmericaArray,$dataArray[1]);break;
			case "vc":array_push($northAmericaArray,$dataArray[1]);break;
			case "us":array_push($northAmericaArray,$dataArray[1]);break;
			case "com":array_push($northAmericaArray,$dataArray[1]);break;
			case "edu":array_push($northAmericaArray,$dataArray[1]);break;
			case "gov":array_push($northAmericaArray,$dataArray[1]);break;
			case "mil":array_push($northAmericaArray,$dataArray[1]);break;
			case "net":array_push($northAmericaArray,$dataArray[1]);break;
			case "org":array_push($northAmericaArray,$dataArray[1]);break;
			// Central American
			case "bz":array_push($centralAmericaArray,$dataArray[1]);break;
			case "cr":array_push($centralAmericaArray,$dataArray[1]);break;
			case "cu":array_push($centralAmericaArray,$dataArray[1]);break;
			case "dm":array_push($centralAmericaArray,$dataArray[1]);break;
			case "do":array_push($centralAmericaArray,$dataArray[1]);break;
			case "gd":array_push($centralAmericaArray,$dataArray[1]);break;
			case "gt":array_push($centralAmericaArray,$dataArray[1]);break;
			case "hn":array_push($centralAmericaArray,$dataArray[1]);break;
			case "ht":array_push($centralAmericaArray,$dataArray[1]);break;
			case "jm":array_push($centralAmericaArray,$dataArray[1]);break;
			case "mx":array_push($centralAmericaArray,$dataArray[1]);break;
			case "ni":array_push($centralAmericaArray,$dataArray[1]);break;
			case "pa":array_push($centralAmericaArray,$dataArray[1]);break;
			case "py":array_push($centralAmericaArray,$dataArray[1]);break;
			case "sv":array_push($centralAmericaArray,$dataArray[1]);break;
			case "tt":array_push($centralAmericaArray,$dataArray[1]);break;
			// South American
			case "ar":array_push($southAmericaArray,$dataArray[1]);break;
			case "bo":array_push($southAmericaArray,$dataArray[1]);break;
			case "br":array_push($southAmericaArray,$dataArray[1]);break;
			case "cl":array_push($southAmericaArray,$dataArray[1]);break;
			case "co":array_push($southAmericaArray,$dataArray[1]);break;
			case "ec":array_push($southAmericaArray,$dataArray[1]);break;
			case "gy":array_push($southAmericaArray,$dataArray[1]);break;
			case "pe":array_push($southAmericaArray,$dataArray[1]);break;
			case "py":array_push($southAmericaArray,$dataArray[1]);break;
			case "sr":array_push($southAmericaArray,$dataArray[1]);break;
			case "uy":array_push($southAmericaArray,$dataArray[1]);break;
			case "ve":array_push($southAmericaArray,$dataArray[1]);break;
			// Northern Europe
			case "ch":array_push($northernEuropeArray,$dataArray[1]);break;
			case "dk":array_push($northernEuropeArray,$dataArray[1]);break;
			case "fi":array_push($northernEuropeArray,$dataArray[1]);break;
			case "is":array_push($northernEuropeArray,$dataArray[1]);break;
			case "no":array_push($northernEuropeArray,$dataArray[1]);break;
			case "se":array_push($northernEuropeArray,$dataArray[1]);break;
			// Western Europe
			case "be":array_push($westernEuropeArray,$dataArray[1]);break;
			case "de":array_push($westernEuropeArray,$dataArray[1]);break;
			case "es":array_push($westernEuropeArray,$dataArray[1]);break;
			case "fr":array_push($westernEuropeArray,$dataArray[1]);break;
			case "ge":array_push($westernEuropeArray,$dataArray[1]);break;
			case "gr":array_push($westernEuropeArray,$dataArray[1]);break;
			case "ie":array_push($westernEuropeArray,$dataArray[1]);break;
			case "it":array_push($westernEuropeArray,$dataArray[1]);break;
			case "li":array_push($westernEuropeArray,$dataArray[1]);break;
			case "lu":array_push($westernEuropeArray,$dataArray[1]);break;
			case "mc":array_push($westernEuropeArray,$dataArray[1]);break;
			case "md":array_push($westernEuropeArray,$dataArray[1]);break;
			case "mk":array_push($westernEuropeArray,$dataArray[1]);break;
			case "mt":array_push($westernEuropeArray,$dataArray[1]);break;
			case "nl":array_push($westernEuropeArray,$dataArray[1]);break;
			case "pt":array_push($westernEuropeArray,$dataArray[1]);break;
			case "sm":array_push($westernEuropeArray,$dataArray[1]);break;
			case "uk":array_push($westernEuropeArray,$dataArray[1]);break;
			case "va":array_push($westernEuropeArray,$dataArray[1]);break;
			// Eastern Europe
			case "al":array_push($easternEuropeArray,$dataArray[1]);break;
			case "am":array_push($easternEuropeArray,$dataArray[1]);break;
			case "an":array_push($easternEuropeArray,$dataArray[1]);break;
			case "at":array_push($easternEuropeArray,$dataArray[1]);break;
			case "az":array_push($easternEuropeArray,$dataArray[1]);break;
			case "ba":array_push($easternEuropeArray,$dataArray[1]);break;
			case "by":array_push($easternEuropeArray,$dataArray[1]);break;
			case "cz":array_push($easternEuropeArray,$dataArray[1]);break;
			case "ee":array_push($easternEuropeArray,$dataArray[1]);break;
			case "hr":array_push($easternEuropeArray,$dataArray[1]);break;
			case "hu":array_push($easternEuropeArray,$dataArray[1]);break;
			case "lt":array_push($easternEuropeArray,$dataArray[1]);break;
			case "lv":array_push($easternEuropeArray,$dataArray[1]);break;
			case "pl":array_push($easternEuropeArray,$dataArray[1]);break;
			case "ro":array_push($easternEuropeArray,$dataArray[1]);break;
			case "ru":array_push($easternEuropeArray,$dataArray[1]);break;
			case "sk":array_push($easternEuropeArray,$dataArray[1]);break;
			case "si":array_push($easternEuropeArray,$dataArray[1]);break;
			case "ua":array_push($easternEuropeArray,$dataArray[1]);break;
			case "yu":array_push($easternEuropeArray,$dataArray[1]);break;
			// Middle East
			case "ae":array_push($middleEastArray,$dataArray[1]);break;
			case "bn":array_push($middleEastArray,$dataArray[1]);break;
			case "il":array_push($middleEastArray,$dataArray[1]);break;
			case "ir":array_push($middleEastArray,$dataArray[1]);break;
			case "iq":array_push($middleEastArray,$dataArray[1]);break;
			case "lb":array_push($middleEastArray,$dataArray[1]);break;
			case "om":array_push($middleEastArray,$dataArray[1]);break;
			case "pk":array_push($middleEastArray,$dataArray[1]);break;
			case "qa":array_push($middleEastArray,$dataArray[1]);break;
			case "sa":array_push($middleEastArray,$dataArray[1]);break;
			case "sy":array_push($middleEastArray,$dataArray[1]);break;
			// Africa
			case "ao":array_push($africaArray,$dataArray[1]);break;
			case "bj":array_push($africaArray,$dataArray[1]);break;
			case "bf":array_push($africaArray,$dataArray[1]);break;
			case "bi":array_push($africaArray,$dataArray[1]);break;
			case "bw":array_push($africaArray,$dataArray[1]);break;
			case "cf":array_push($africaArray,$dataArray[1]);break;
			case "cg":array_push($africaArray,$dataArray[1]);break;
			case "ci":array_push($africaArray,$dataArray[1]);break;
			case "cm":array_push($africaArray,$dataArray[1]);break;
			case "cv":array_push($africaArray,$dataArray[1]);break;
			case "dj":array_push($africaArray,$dataArray[1]);break;
			case "dz":array_push($africaArray,$dataArray[1]);break;
			case "eg":array_push($africaArray,$dataArray[1]);break;
			case "er":array_push($africaArray,$dataArray[1]);break;
			case "et":array_push($africaArray,$dataArray[1]);break;
			case "ga":array_push($africaArray,$dataArray[1]);break;
			case "gh":array_push($africaArray,$dataArray[1]);break;
			case "gm":array_push($africaArray,$dataArray[1]);break;
			case "gn":array_push($africaArray,$dataArray[1]);break;
			case "gq":array_push($africaArray,$dataArray[1]);break;
			case "gw":array_push($africaArray,$dataArray[1]);break;
			case "ke":array_push($africaArray,$dataArray[1]);break;
			case "km":array_push($africaArray,$dataArray[1]);break;
			case "lr":array_push($africaArray,$dataArray[1]);break;
			case "ls":array_push($africaArray,$dataArray[1]);break;
			case "ly":array_push($africaArray,$dataArray[1]);break;
			case "ma":array_push($africaArray,$dataArray[1]);break;
			case "mg":array_push($africaArray,$dataArray[1]);break;
			case "mr":array_push($africaArray,$dataArray[1]);break;
			case "mu":array_push($africaArray,$dataArray[1]);break;
			case "mw":array_push($africaArray,$dataArray[1]);break;
			case "mz":array_push($africaArray,$dataArray[1]);break;
			case "ne":array_push($africaArray,$dataArray[1]);break;
			case "ng":array_push($africaArray,$dataArray[1]);break;
			case "rw":array_push($africaArray,$dataArray[1]);break;
			case "sc":array_push($africaArray,$dataArray[1]);break;
			case "sd":array_push($africaArray,$dataArray[1]);break;
			case "sl":array_push($africaArray,$dataArray[1]);break;
			case "sn":array_push($africaArray,$dataArray[1]);break;
			case "so":array_push($africaArray,$dataArray[1]);break;
			case "st":array_push($africaArray,$dataArray[1]);break;
			case "sz":array_push($africaArray,$dataArray[1]);break;
			case "td":array_push($africaArray,$dataArray[1]);break;
			case "tg":array_push($africaArray,$dataArray[1]);break;
			case "tn":array_push($africaArray,$dataArray[1]);break;
			case "tz":array_push($africaArray,$dataArray[1]);break;
			case "ug":array_push($africaArray,$dataArray[1]);break;
			case "za":array_push($africaArray,$dataArray[1]);break;
			case "zm":array_push($africaArray,$dataArray[1]);break;
			case "aw":array_push($africaArray,$dataArray[1]);break;
			// Asia
			case "af":array_push($asiaArray,$dataArray[1]);break;
			case "bd":array_push($asiaArray,$dataArray[1]);break;
			case "bh":array_push($asiaArray,$dataArray[1]);break;
			case "bn":array_push($asiaArray,$dataArray[1]);break;
			case "bt":array_push($asiaArray,$dataArray[1]);break;
			case "cn":array_push($asiaArray,$dataArray[1]);break;
			case "hk":array_push($asiaArray,$dataArray[1]);break;
			case "id":array_push($asiaArray,$dataArray[1]);break;
			case "in":array_push($asiaArray,$dataArray[1]);break;
			case "jp":array_push($asiaArray,$dataArray[1]);break;
			case "kh":array_push($asiaArray,$dataArray[1]);break;
			case "kr":array_push($asiaArray,$dataArray[1]);break;
			case "kz":array_push($asiaArray,$dataArray[1]);break;
			case "la":array_push($asiaArray,$dataArray[1]);break;
			case "lk":array_push($asiaArray,$dataArray[1]);break;
			case "mm":array_push($asiaArray,$dataArray[1]);break;
			case "mn":array_push($asiaArray,$dataArray[1]);break;
			case "mv":array_push($asiaArray,$dataArray[1]);break;
			case "my":array_push($asiaArray,$dataArray[1]);break;
			case "np":array_push($asiaArray,$dataArray[1]);break;
			case "ph":array_push($asiaArray,$dataArray[1]);break;
			case "sg":array_push($asiaArray,$dataArray[1]);break;
			case "th":array_push($asiaArray,$dataArray[1]);break;
			case "tj":array_push($asiaArray,$dataArray[1]);break;
			case "tm":array_push($asiaArray,$dataArray[1]);break;
			case "tp":array_push($asiaArray,$dataArray[1]);break;
			case "tr":array_push($asiaArray,$dataArray[1]);break;
			case "tw":array_push($asiaArray,$dataArray[1]);break;
			case "vn":array_push($asiaArray,$dataArray[1]);break;
			case "ye":array_push($asiaArray,$dataArray[1]);break;
			// Oceania
			case "au":array_push($oceaniaArray,$dataArray[1]);break;
			case "fj":array_push($oceaniaArray,$dataArray[1]);break;
			case "fm":array_push($oceaniaArray,$dataArray[1]);break;
			case "ki":array_push($oceaniaArray,$dataArray[1]);break;
			case "mh":array_push($oceaniaArray,$dataArray[1]);break;
			case "nr":array_push($oceaniaArray,$dataArray[1]);break;
			case "nz":array_push($oceaniaArray,$dataArray[1]);break;
			case "pw":array_push($oceaniaArray,$dataArray[1]);break;
			case "pg":array_push($oceaniaArray,$dataArray[1]);break;
			case "sb":array_push($oceaniaArray,$dataArray[1]);break;
			case "to":array_push($oceaniaArray,$dataArray[1]);break;
			case "tv":array_push($oceaniaArray,$dataArray[1]);break;
			case "vu":array_push($oceaniaArray,$dataArray[1]);break;
			case "ws":array_push($oceaniaArray,$dataArray[1]);break;
			// Unknown
			default: array_push($unknownArray,$dataArray[1]);break;
		}
	}
	for ($i=0; $i<sizeof($northAmericaArray); $i++) $northAmericaTotal += $northAmericaArray[$i];
	for ($i=0; $i<sizeof($centralAmericaArray); $i++) $centralAmericaTotal += $centralAmericaArray[$i];
	for ($i=0; $i<sizeof($southAmericaArray); $i++) $southAmericaTotal += $southAmericaArray[$i];
	for ($i=0; $i<sizeof($northernEuropeArray); $i++) $northernEuropeTotal += $northernEuropeArray[$i];
	for ($i=0; $i<sizeof($westernEuropeArray); $i++) $westernEuropeTotal += $westernEuropeArray[$i];
	for ($i=0; $i<sizeof($easternEuropeArray); $i++) $easternEuropeTotal += $easternEuropeArray[$i];
	for ($i=0; $i<sizeof($middleEastArray); $i++) $middleEastTotal += $middleEastArray[$i];
	for ($i=0; $i<sizeof($africaArray); $i++) $africaTotal += $africaArray[$i];
	for ($i=0; $i<sizeof($asiaArray); $i++) $asiaTotal += $asiaArray[$i];
	for ($i=0; $i<sizeof($oceaniaArray); $i++) $oceaniaTotal += $oceaniaArray[$i];
	for ($i=0; $i<sizeof($unknownArray); $i++) $unknownTotal += $unknownArray[$i];
	$dataArrayFull["North America"] = $northAmericaTotal;
	$dataArrayFull["Central America"] = $centralAmericaTotal;
	$dataArrayFull["South America"] = $southAmericaTotal;
	$dataArrayFull["Northern Europe"] = $northernEuropeTotal;
	$dataArrayFull["Western Europe"] = $westernEuropeTotal;
	$dataArrayFull["Eastern Europe"] = $easternEuropeTotal;
	$dataArrayFull["Middle East"] = $middleEastTotal;
	$dataArrayFull["Africa"] = $africaTotal;
	$dataArrayFull["Asia"] = $asiaTotal;
	$dataArrayFull["Oceania"] = $oceaniaTotal;
	$dataArrayFull["Unknown"] = $unknownTotal;
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Host Addresses - refNum = 013
function hostAddresses($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "List Of Hosts Accessing Website";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Top 50 Hosts Hitting Website",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_VISITOR","END_VISITOR");
	for ($i=0; $i<50; $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[$dataArray[0]] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Last Host Addresses - refNum = 014
function lastHostAddresses($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "List of Most Recent Hosts Accessing Website";
	$dataArray = array();
	$htmlReturn = genDisplayHeader($whichPage,"Most Recent Hosts Hitting Website",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_VISITOR","END_VISITOR");
	for ($i=0; $i<25; $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[$dataArray[0]] = getRealServerTime($dataArray[4]);
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Earliest Host Addresses - refNum = 015
function earliestHostAddresses($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "List Of Earliest Hosts Accessing Website";
	$dataArray = array();
	$htmlReturn = genDisplayHeader($whichPage,"Earliest Hosts Hitting Website",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_VISITOR","END_VISITOR");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFullInit[$dataArray[0]] = $dataArray[4];
	}
	natsort($dataArrayFullInit);
	$limitCounter = 0;
	foreach ($dataArrayFullInit as $key=>$val) {
		if ($limitCounter != 25) {
			if (checkdate(substr($val,4,2),substr($val,6,2),substr($val,0,4)) == TRUE) {
				$dataArrayFull[$key] = getRealServerTime($val);
				$limitCounter++;
			}
		} else {
			break;
		}
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Robot Hits - refNum = 016
function robotHits($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Robot Names x Number Of Robot Hits";
	$dataArray = array();
	$dataFullArray = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Robot Hits",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_ROBOT","END_ROBOT");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[ucfirst($dataArray[0])] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Duration Of Individual Visits - refNum = 017
function durationIndivVisits($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Duration Of Visits x Quantity Of Each";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Duration Of Individual Visits To Website",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_SESSION","END_SESSION");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[$dataArray[0]] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: File Types Hit - refNum = 018
function fileTypesHit($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "File Types Served x Quantity";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total File Types Hit",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_FILETYPES","END_FILETYPES");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[strtoupper($dataArray[0])] = $dataArray[1];
	}
	// Don't Sort Plot As It Resembles Bar Too Closely
	if ($displayType != "plot") {
		natsort($dataArrayFull);
		$dataArrayFull = array_reverse($dataArrayFull);
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: File Types Hit Bandwidth - refNum = 019
function fileTypesHitBandwidth($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "File Types Served x Total Bandwidth";
	$dataArray = array();
	$dataFullArray = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total File Types Hit By Bandwidth",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_FILETYPES","END_FILETYPES");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[strtoupper($dataArray[0])] = $dataArray[1]."kb";
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Pages Hit - refNum = 020
function pagesHit($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "List Of Pages Accessed By Visitors";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Page Names Hit",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_SIDER","END_SIDER");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[$dataArray[0]] = "";
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Pages Hit By Name - refNum = 021
function pagesHitByName($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "List Of Pages Accessed By Visitors";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Pages Hit By Name",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_SIDER","END_SIDER");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[$dataArray[0]] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Operating Systems - refNum = 022
function operatingSystems($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Operating Systems x Number Of Hits";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Top Operating Systems Hitting Website",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_OS","END_OS");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[strtoupper($dataArray[0])] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Browsers - refNum = 023
function browsers($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Browsers x Number Of Hits";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Top Browser Hits To Website",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_BROWSER","END_BROWSER");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[strtoupper($dataArray[0])] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Incoming Page Referrer - refNum = 024
function incomingPageReferrer($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "List Of Out-Of-Domain Pages Referring To Website";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Incoming Page Referrers",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_PAGEREFS","END_PAGEREFS");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[$dataArray[0]] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Incoming Server Referrer - refNum = 025
function incomingServerReferrer($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "List Of Servers Referring To Website";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Incoming Server Referrers",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_PAGEREFS","END_PAGEREFS");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$serverParsedArray = parse_url($dataArray[0]);
		$serverParsed = $serverParsedArray['host'];
		$serverParsedLink = "<a href='http://".$serverParsed;
		$serverParsedLink .= "' target='new'>http://".$serverParsed."</a>";
		$dataArrayFull[$serverParsedLink] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Incoming Search Phrases - refNum = 026
function incomingSearchPhrases($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Visitor's Search Phrases Leading To Website";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Incoming Search Phrases",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_SEARCHWORDS","END_SEARCHWORDS");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[ereg_replace("\+"," ",$dataArray[0])] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Incoming Search Words - refNum = 027
function incomingSearchWords($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "User's Search Words Leading To Website";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Incoming Search Keywords",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_KEYWORDS","END_KEYWORDS");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		$dataArrayFull[$dataArray[0]] = $dataArray[1];
	}
	natsort($dataArrayFull);
	$dataArrayFull = array_reverse($dataArrayFull);
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
// Function: Error Codes - refNum = 032
function errorCodes($whichPage,$refNum,$displayType,$displayParam,$displayIndivLoc,$limit,$username) {
	$displayDescription = "Error Codes Reported x Quantity";
	$dataArray = array();
	$dataArrayFull = array();
	$htmlReturn = genDisplayHeader($whichPage,"Total Error Codes From Website Accesses",$refNum,$displayType,$displayParam,$displayIndivLoc,$username);
	$htmlReturnArray = globalLogEreg("BEGIN_ERRORS","END_ERRORS");
	for ($i=0; $i<sizeof($htmlReturnArray); $i++) {
		$rawData = $htmlReturnArray[$i];
		$dataArray = explode(" ",$rawData);
		// Switch Codes To Text Description
		switch($dataArray[0]) {
			case "202":$dataArray[0] = "Request Accepted - Will Be Executed Later";break;
			case "203":$dataArray[0] = "Non-Authoritative Information";break;
			case "205":$dataArray[0] = "Document Reset";break;
			case "206":$dataArray[0] = "Document Contains Only Partial Content";break;
			case "301":$dataArray[0] = "Document Moved Permanent (redirection)";break;
			case "302":$dataArray[0] = "Document Moved Temporarily (redirection)";break;
			case "400":$dataArray[0] = "Bad Request";break;
			case "401":$dataArray[0] = "Unauthorized Request";break;
			case "402":$dataArray[0] = "Payment Required";break;
			case "403":$dataArray[0] = "Access Forbidden";break;
			case "404":$dataArray[0] = "Document Not Found";break;
			case "405":$dataArray[0] = "Request Method Not Allowed";break;
			case "406":$dataArray[0] = "Document Not Acceptable To Client";break;
			case "407":$dataArray[0] = "Proxy Authentication Required";break;
			case "408":$dataArray[0] = "Request Timeout";break;
			case "409":$dataArray[0] = "Request Conflicts With State Of Resource";break;
			case "410":$dataArray[0] = "Document Moved Permanently";break;
			case "411":$dataArray[0] = "Length Required";break;
			case "412":$dataArray[0] = "Precondition Failed";break;
			case "413":$dataArray[0] = "Request Too Long";break;
			case "414":$dataArray[0] = "Request Filename Too Long";break;
			case "415":$dataArray[0] = "Unsupported Media Type";break;
			case "416":$dataArray[0] = "Requested Range Not Valid";break;
			case "417":$dataArray[0] = "Undocumented Failed Attempt";break;
			case "500":$dataArray[0] = "Internal Server Error";break;
			case "501":$dataArray[0] = "Process Not Implemented";break;
			case "502":$dataArray[0] = "Received Bad Response From Server";break;
			case "503":$dataArray[0] = "Server Busy";break;
			case "504":$dataArray[0] = "Gateway Timeout";break;
			case "505":$dataArray[0] = "HTTP Version Not Supported";break;
			case "506":$dataArray[0] = "Redirection Failed";break;
			default:$dataArray[0] = "Unknown Client/Server Error";break;
		}
		$dataArrayFull[$dataArray[0]] = $dataArray[1];
	}
	$htmlReturn .= startGenHTMLReturn($dataArrayFull,$refNum,$displayDescription,$displayType,$displayParam,$limit,$username);
	$htmlReturn .= templateEndHTML;
	return $htmlReturn;
}
?>
Return current item: DataDivisions