
projectArray = new Array(
	"property-shop-investments",
	"egypt-property",
	"yadig",
	"mirage",
	"real-choice",
	"skps",
	"on-time",
	"yadig-mobile",
	"property-shop-investments-mobile",
	"damac",
	"gdi",
	"plusbrokers",
	"sorouh-mobile",
	"omran",
	"quality-tours",
	"ecommerce",
	"bafco",
	"lulu",
	"hh",
	"airbaltic",
	"smartworld",
	"bh-mobile",
	"elysian-uae",
	"adsf",
	"liveroute",
	"sorouh",
	"invest-bout",
	"halcon",
	"masterkey",
	"better-homes",
	"specialists",
	"dubai-polo",
	"property-store",
	"epic-properties",
	"raqmiyat",
	"independent-uae",
	"avenue",
	"omega-plus",
	"royal-flowers",
	"beast-nation",
	"seismology",
	"fmcs",
	"carrington-knight",
	"range-rover-hse",
	"orange-promo",
	"traffic-mobile"
);

// Read a page's GET URL variables and return them as an associative array.
function getUrlVars()
{
	var vars = [], hash;
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

	for(var i = 0; i < hashes.length; i++)
	{
		hash = hashes[i].split('=');
		vars.push(hash[0]);
		vars[hash[0]] = hash[1];
	}
	
	return vars;
}

function centerPages() {
	pgWidth = $('#sc_pages').width();
	$('#sc_pages').css({
		width: (1+pgWidth)+'px',
		float: 'none'
	});
}

$(document).ready(function() {
	singleProject();
	$('#singleProjectLoading').hide();
	$('#singleProject').fadeIn('slow', function() {
		centerPages()
	});
});

	
var lastScrn = 1;

function scrns(id) {
		
	if (lastScrn == id) return;
			
	$('#sc' + lastScrn).hide();	
	$('#sc_page' + lastScrn).removeClass('act');
			
	$('#sc' + id).show();
	$('#sc_page' + id).addClass('act');
		
	lastScrn = id;
		
}

var hash = getUrlVars();

function singleProject() {

	if (window.location.href.indexOf("pr")> 0) {
		
		if( (hash['pr'] == '') || (projectArray.indexOf(hash['pr'])==-1) ) {			
			window.location = "http://www.wewanttraffic.com/ebusiness/websitedesign/index.aspx";
		}
			
	} else {
		window.location = "http://www.wewanttraffic.com/ebusiness/websitedesign/index.aspx";
	}

}
