//***************************** BOX/TITLE*************************************

	


var newTitle;
function boxTitle(){
	if (url != 'HOME'){ //not on homepage
		if(ref == 'BUSINESSMOBILES' ){
			$('.strap h1').html('Business mobiles');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_1colour.jpg');
		}
		if(ref == 'CONTACTUS' ){
			$('.strap h1').html('Contact us');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_1colour.jpg');
		}
		if(ref == 'FIXEDLINESOLUTIONS' ){
			$('.strap h1').html('Fixed line solutions');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_5colour.jpg');
		}
		if(ref == 'MOBILEAPPLICATIONS' ){
			$('.strap h1').html('Mobile applications');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_4colour.jpg');
		}
		if(ref == 'MOBILEBROADBAND' ){
			$('.strap h1').html('Mobile broadband');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_3colour.jpg');
		}
		if(ref == 'MOBILEEMAIL' ){
			$('.strap h1').html('Mobile email');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_2colour.jpg');
		}
		if(ref == 'CONTACTUS' ){
			$('.strap h1').html('Contact us');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_6colour.gif');
		}
		if(ref == 'COMMUNITY' ){
			$('.strap h1').html('Community');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_7colour.gif');
		}
		if(ref == 'WHYQUALITEL' ){
			$('.strap h1').html('About us');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_8colour.gif');
		}
		if(ref == 'PARTNER' ){
			$('.strap h1').html('Partner programme');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_9colour.jpg');
		}
		if(ref == 'RECYCLE' ){
			$('.strap h1').html('Recycle');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_10colour.jpg');
		}
		if(ref == 'TESTIMONIALS' ){
			$('.strap h1').html('Case study');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_11colour.jpg');
		}
		if(ref == 'BLOG' ){
			//$('.strap h1').html('Blog');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_11colour.jpg');
		}
		if(ref == 'OTHER' ){
			//$('.strap h1').html('Blog');
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_11colour.jpg');
		}
		
	}
	//get rest title/box
	if(url == 'CONTACTUS'){
		$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_6colour.gif');
		newTitle = 'Contact us';
	}
	if(url == 'COMMUNITY'){
		$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_7colour.gif');
		newTitle = 'Community';
	}
	if(url == 'WHYQUALITEL'){
		$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_8colour.gif');
		newTitle = 'About us';
	}
	if(url == 'PARTNER'){
		$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_9colour.jpg');
		newTitle = 'Partner programme';
	}
	if(url == 'RECYCLE'){
		$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_10colour.jpg');
		newTitle = 'Recycle';
	}
	if(url == 'TESTIMONIALS'){
		$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_11colour.jpg');
		newTitle = 'Case study';
	}
	if(url == 'BLOG'){
		$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_11colour.jpg');
		newTitle = 'Blog';
	}
	if(url == 'OTHER'){
		$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_11colour.jpg');
		//newTitle = 'Blog';
	}
	if(ref=="HOME"){
		if(url == 'CONTACTUS' || url == 'COMMUNITY' || url == 'WHYQUALITEL' || url == 'PARTNER' || url == 'RECYCLE' || url == 'TESTIMONIALS'|| url == 'BLOG'|| url == 'OTHER'){
			$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_5.gif');
		}
	}
	
}
	
//************************************* HOME *****************************
function homestart(){
	$(".boxes li").hide();
	var className = 5;
	$(".boxes li").each(function(){
		$(this).addClass("box"+className);
		className--;
	});
	setTimeout("$(\'.boxes li\').fadeIn(\'slow\')",2500); 
}
function homeother(){
	$(".boxes li").hide();
	var className = 5;
	$(".boxes li").each(function(){
		$(this).addClass("box"+className);
		className--;
	});
	//setTimeout("$(\'.boxes li\').fadeIn(\'slow\')",2000);
	$('.box5').show();
	$('.box4').fadeIn();
	$('.box3').fadeIn();
	$('.box2').fadeIn();
	$('.box1').fadeIn();
}
//********************************* BUSINESS MOBILES**********************

function businessmobileFromhome(){
	//DONE
	//$('#image3').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_1colour.jpg');
	var className = 5;
	$(".boxes li").each(function(){
		$(this).addClass("box"+className);
		className--;
	});
	$('#image1').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_1colour.jpg');
	$('.boxes li div').show();
	$('.strap h1').html('Business mobiles');
	$('.box1').css({backgroundImage:'none'});
	$('.box5').fadeTo("slow", 0);
	$('.box4').fadeTo("slow", 0);
	$('.box3').fadeTo("slow", 0);
	$('.box2').fadeTo("slow", 0);
	$('.box5').animate({width:'0'},2000);
	$('.box4').animate({width:'0'},2000);
	$('.box3').animate({width:'0'},2000);
	$('.box2').animate({width:'0'},2000);
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',3000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',3100);/**/
}
function businessmobileFromother(){
	//DONE
	var className = 5;
	$(".boxes li").each(function(){
		if(className > 1){
			$(this).hide();
		}
		className--;
	});
	$('.box1').css({backgroundImage:'none'});
	$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_1colour.jpg');
	$('.boxes li div').show();
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',90);
	//setTimeout('$(\'.strap h1\').show()',110);
	//setTimeout('$(\'.strap h1\').fadeOut(\'slow\')',120);
	$('#defaultCube').imagecube({noShading: true,repeat:true,speed:1000});
	setTimeout('$(\'#defaultCube\').imagecube(\'stop\')',4000);
	setTimeout('$(\'.strap h1\').html(\'Business mobiles\')',2000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',2000);/**/
}
//********************************* MOBILE EMAIL**********************
function mobileemailFromhome(){
	$('#image3').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_2colour.jpg');
	//DONE
	var className = 5;
	$(".boxes li").each(function(){
		$(this).addClass("box"+className);
		className--;
	});
	$('.boxes li div').show();
	$('.strap h1').html('Mobile email');
	$('.box2').css({backgroundImage:'none'});
	$('.box5').fadeTo("slow", 0);
	$('.box4').fadeTo("slow", 0);
	$('.box1').fadeTo("slow", 0);
	$('.box3').fadeTo("slow", 0);
	$('.box5').animate({width:'0'},1300);
	$('.box4').animate({width:'0'},1300);
	$('.box3').animate({width:'0'},1300);
	$('.box1').hide();
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',3000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',3100);/**/	
}
function mobileemailFromother(){
	//DONE
	var className = 5;
	$(".boxes li").each(function(){
		if(className > 1){
			$(this).hide();
		}
		className--;
	});
	$('.box1').css({backgroundImage:'none'});
	$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_2colour.jpg');
	$('.boxes li div').show();
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',90);
	//setTimeout('$(\'.strap h1\').show()',110);
	//setTimeout('$(\'.strap h1\').fadeOut(\'slow\')',120);
	$('#defaultCube').imagecube({noShading: true,repeat:true,speed:1000});
	setTimeout('$(\'#defaultCube\').imagecube(\'stop\')',4000);
	setTimeout('$(\'.strap h1\').html(\'Mobile email\')',2000);
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',2000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',2000);/**/
}
//********************************* MOBILE BROADBAND**********************
function mobilebroadbandFromhome(){
	//DONE
	$('#image3').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_3colour.jpg');
	var className = 5;
	$(".boxes li").each(function(){
		$(this).addClass("box"+className);
		className--;
	});
	$('.boxes li div').show();
	$('.strap h1').html('Mobile broadband');
	$('.box3').css({backgroundImage:'none'});
	$('.box5').fadeTo("slow", 0);
	$('.box4').fadeTo("slow", 0);
	$('.box1').fadeTo("slow", 0);
	$('.box2').fadeTo("slow", 0);
	$('.box5').animate({width:'0'},1000);
	$('.box4').animate({width:'0'},1000);
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',3000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',3100);/**/
}
function mobilebroadbandFromother(){
	//DONE
	var className = 5;
	$(".boxes li").each(function(){
		if(className > 1){
			$(this).hide();
		}
		className--;
	});
	$('.box1').css({backgroundImage:'none'});
	$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_3colour.jpg');
	$('.boxes li div').show();
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',90);
	//setTimeout('$(\'.strap h1\').show()',110);
	//setTimeout('$(\'.strap h1\').fadeOut(\'slow\')',120);
	$('#defaultCube').imagecube({noShading: true,repeat:true,speed:1000});
	setTimeout('$(\'#defaultCube\').imagecube(\'stop\')',4000);
	setTimeout('$(\'.strap h1\').html(\'Mobile broadband\')',2000);
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',2000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',2000);/**/
}
//********************************* MOBILE APPLICATIONS**********************
function mobileapplicationsFromhome(){
	//DONE
	$('#image3').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_4colour.jpg');
	var className = 5;
	$(".boxes li").each(function(){
		$(this).addClass("box"+className);
		className--;
	});
	$('.boxes li div').show();
	$('.strap h1').html('Mobile applications');
	$('.box4').css({backgroundImage:'none'});
	$('.box5').fadeTo("slow", 0);
	$('.box3').fadeTo("slow", 0);
	$('.box1').fadeTo("slow", 0);
	$('.box2').fadeTo("slow", 0);
	$('.box3').hide();
	$('.box1').hide();
	$('.box2').hide();
	$('.box5').animate({width:'0'});
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',3000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',3100);/**/
}
function mobileapplicationsFromother(){
	//DONE
	var className = 5;
	$(".boxes li").each(function(){
		if(className > 1){
			$(this).hide();
		}
		className--;
	});
	$('.box1').css({backgroundImage:'none'});
	$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_4colour.jpg');
	$('.boxes li div').show();
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',90);
	//setTimeout('$(\'.strap h1\').show()',110);
	//setTimeout('$(\'.strap h1\').fadeOut(\'slow\')',120);
	$('#defaultCube').imagecube({noShading: true,repeat:true,speed:1000});
	setTimeout('$(\'#defaultCube\').imagecube(\'stop\')',4000);
	setTimeout('$(\'.strap h1\').html(\'Mobile applications\')',2000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',2000);/**/
}
//********************************* FIXED LINE SOLUTIONS**********************
function fixedlinesolutionsFromhome(){
	//
	$('#image3').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_5colour.jpg');
	var className = 5;
	$(".boxes li").each(function(){
		$(this).addClass("box"+className);
		className--;
	});
	$('.boxes li div').show();
	$('.strap h1').html('Fixed line solutions');
	$('.box5').css({backgroundImage:'none'});
	$('.box1').fadeOut("slow");
	$('.box2').fadeOut("slow");
	$('.box3').fadeOut("slow");
	$('.box4').fadeOut("slow");
	
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',1000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',1100);/**/
}
function fixedlinesolutionsFromother(){
	//DONE
	var className = 5;
	$(".boxes li").each(function(){
		if(className > 1){
			$(this).hide();
		}
		className--;
	});
	$('.box1').css({backgroundImage:'none'});
	$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_5colour.jpg');
	$('.boxes li div').show();
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',90);
	//setTimeout('$(\'.strap h1\').show()',110);
	//setTimeout('$(\'.strap h1\').fadeOut(\'slow\')',120);
	$('#defaultCube').imagecube({noShading: true,repeat:true,speed:1000});
	setTimeout('$(\'#defaultCube\').imagecube(\'stop\')',4000);
	setTimeout('$(\'.strap h1\').html(\'Fixed line solutions\')',2000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',2000);/**/
}
//***************************** OTHERS ***************************************
function restFromhome(){
	//
	$('#image3').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_5colour.jpg');
	var className = 5;
	$(".boxes li").each(function(){
		$(this).addClass("box"+className);
		className--;
	});
	$('.box1').fadeOut("slow");
	$('.box2').fadeOut("slow");
	$('.box3').fadeOut("slow");
	$('.box4').fadeOut("slow");
	$('.strap h1').html(newTitle);
	$('.box5').css({backgroundImage:'none'});
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',500);
	$('#defaultCube').imagecube({noShading: true,repeat:true,speed:1000});
	setTimeout('$(\'#defaultCube\').imagecube(\'stop\')',4000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',2000);/**/
}




function restFromother(){
	//DONE
	var className = 4;
	$(".boxes li").each(function(){
		if(className > 4){
			$(this).hide();
		}
		className--;
	});
	$('.box1').css({backgroundImage:'none'});
	//$('#image2').attr('src','http://www.qualitelecom.co.uk/wp-content/themes/Qualitel/images/box_5colour.jpg');
	$('.boxes li div').show();
	setTimeout('$(\'.boxes\').css({width:\'190px\'})',90);
	//setTimeout('$(\'.strap h1\').show()',110);
	//setTimeout('$(\'.strap h1\').fadeOut(\'slow\')',120);
	
	
	
	$('#defaultCube').imagecube({noShading: true,repeat:true,speed:1000});
	setTimeout('$(\'#defaultCube\').imagecube(\'stop\')',4000);
	setTimeout('$(\'.strap h1\').html(newTitle)',2000);
	setTimeout('$(\'.strap h1\').fadeIn(\'slow\')',2000);/**/
}

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
