 function showrate(rate_value) {		
	var a = new Array();
	a = rate_value.split(";");
	var cName = a[0];
	var t_local = a[1];
		t_local= t_local/10000;
	var t_free = a[2];
		t_free = t_free /10000;

	if ((t_local!='') && (t_local!='-')){ 
		document.getElementById("localrate").innerHTML ="£ "+ t_local;
	}
	else
	{
		document.getElementById("localrate").innerHTML  = "£ 0."+t_local;
	}

	if ((t_free!='') && (t_free!='-')){
		document.getElementById("freerate").innerHTML ="£ "+ t_free;
	} 
	else
	{
		document.getElementById("freerate").innerHTML  = "£ 0."+t_free;
	}
	
	document.getElementById("countryName").innerHTML  = cName;
}

function moneyFormat(rate_value){
	return "£"+rate_value/10000;
}

function secureLoginOn(){
	var intervalId  = setInterval ( "secureLogin()", 3000 );
}
function secureLogin(){
	 window.location.href="https://u2call.online-manager.co.uk/";
	
}

function pageLoad(){
	document.getElementById("sliderhidden").value =0;
	var intervalId  = setInterval ( "slider()", 2000 );
	document.getElementById("intervalId").value = intervalId; 
 	//slider();
	//slider();
	//slider();
}

function stopSlider(){
	var intervalId = document.getElementById("intervalId").value;
	if(intervalId != null && intervalId !='') {
		//alert(intervalId);
		clearInterval(intervalId);
	}
} 					  

function slider(){
		 
		var i=0;
		 
	 	for(i=0;i<1000;i++)
		{
		  	var objectId = document.getElementById("specialTariff_"+i);	
			if(objectId== null) { 
				break;
			}else if(objectId != 'specialTariff_0'){
				objectId.style.display = 'none';
			}
			
			
		}
		
		//alert(i);
		var sliderCount = document.getElementById("sliderhidden").value;
		var sliderName = "specialTariff_"+sliderCount;
		//alert("sliderName : "+sliderName);
		for(var j=0;j<i;j++)
		{
		  	var objectId = document.getElementById("specialTariff_"+j);	
			//alert("objectId :  "+objectId.id);
			if(objectId != null) { 
				 if(objectId.id == sliderName){
					 objectId.style.display = 'none';
					 sliderCount++;
					
				 }
				 
				 
				  if(sliderCount >= i){
						 sliderCount = 0;
				  }
				 document.getElementById("sliderhidden").value = sliderCount;
				 document.getElementById("specialTariff_"+sliderCount).style.display='block';
				 //alert("sliderCount : "+sliderCount);
				  
			}
			
		}
}

function showAndHide(count){

	var countNo = "row_"+count;
	var object = document.getElementById(countNo);
	//alert(object);
	if(object != null) {
		var status = object.style.display;
		//alert(status);
		if(status == 'none'){
			object.style.display = 'block';
		}else{
			object.style.display = 'none';
		}
	}
	var i = 1;
	for(i = 1; i<=20; i++) {
		var idcount = "row_"+i;
		//alert(idcount);
		if(idcount != countNo) {
			var object = document.getElementById(idcount);
			object.style.display = 'none';
		}
		
	}
	
}

function showrateTariff(rate_value) {
	
		var a = rate_value.split(";");
		var country_no = a[1];
		var t_local_standard = a[2];
		    t_local_standard = t_local_standard / 10000;
		var t_free_standard = a[3];
		    t_free_standard = t_free_standard / 10000;
		var t_local_premium = a[4];
            t_local_premium = t_local_premium / 10000;		
		var t_free_premium = a[5];
		    t_free_premium = t_free_premium / 10000;
		var t_local_premium_plus = a[6];
		    t_local_premium_plus = t_local_premium_plus / 10000;
		var t_free_premium_plus = a[7];
		    t_free_premium_plus = t_free_premium_plus / 10000;

        if(country_no==1)
        {
		    // Standard 
		    if ((t_local_standard!='') && (t_local_standard!='-')){
			    document.getElementById('rateLocalStd_1').innerHTML ="£ "+ t_local_standard;
			    //document.getElementById('test_rate').innerHTML ="£ "+ t_local_standard;
		    }
		    else
		    {
			    document.getElementById('rateLocalStd_1').innerHTML = t_local_standard;
		    }
    	
		    if ((t_free_standard!='') && (t_free_standard!='-')){
			    document.getElementById('rateFreeStd_1').innerHTML ="£ "+ t_free_standard;
		    } 
		    else
		    {
			    document.getElementById('rateFreeStd_1').innerHTML = t_free_standard;
		    }

		    if ((t_local_premium!='') && (t_local_premium!='-')){
			    document.getElementById('rateLocalPre_1').innerHTML ="£ "+ t_local_premium;
		    }
		    else
		    {
			    document.getElementById('rateLocalPre_1').innerHTML = t_local_premium;
		    }
    	
		    if ((t_free_premium!='') && (t_free_premium!='-')){
			    document.getElementById('rateFreePre_1').innerHTML ="£ "+ t_free_premium;
		    } 
		    else
		    {
			    document.getElementById('rateFreePre_1').innerHTML = t_free_premium;
		    }

		    if ((t_local_premium_plus!='') && (t_local_premium_plus!='-')){
			    document.getElementById('rateLocalPreplus_1').innerHTML ="£ "+ t_local_premium_plus;
		    }
		    else
		    {
			    document.getElementById('rateLocalPreplus_1').innerHTML = t_local_premium_plus;
		    }
    	
		    if ((t_free_premium_plus!='') && (t_free_premium_plus!='-')){
			    document.getElementById('rateFreePreplus_1').innerHTML ="£ "+ t_free_premium_plus;
		    } 
		    else
		    {
			    document.getElementById('rateFreePreplus_1').innerHTML = t_free_premium_plus;
		    }
		    
		    
		}
		
		if(country_no==2)
		{
		    if ((t_local_standard!='') && (t_local_standard!='-')){
			    document.getElementById('rateLocalStd_2').innerHTML ="£ "+ t_local_standard;
			    //document.getElementById('test_rate').innerHTML ="£ "+ t_local_standard;
		    }
		    else
		    {
			    document.getElementById('rateLocalStd_2').innerHTML = t_local_standard;
		    }
    	
		    if ((t_free_standard!='') && (t_free_standard!='-')){
			    document.getElementById('rateFreeStd_2').innerHTML ="£ "+ t_free_standard;
		    } 
		    else
		    {
			    document.getElementById('rateFreeStd_2').innerHTML = t_free_standard;
		    }

		    if ((t_local_premium!='') && (t_local_premium!='-')){
			    document.getElementById('rateLocalPre_2').innerHTML ="£ "+ t_local_premium;
		    }
		    else
		    {
			    document.getElementById('rateLocalPre_2').innerHTML = t_local_premium;
		    }
    	
		    if ((t_free_premium!='') && (t_free_premium!='-')){
			    document.getElementById('rateFreePre_2').innerHTML ="£ "+ t_free_premium;
		    } 
		    else
		    {
			    document.getElementById('rateFreePre_2').innerHTML = t_free_premium;
		    }

		    if ((t_local_premium_plus!='') && (t_local_premium_plus!='-')){
			    document.getElementById('rateLocalPreplus_2').innerHTML ="£ "+ t_local_premium_plus;
		    }
		    else
		    {
			    document.getElementById('rateLocalPreplus_2').innerHTML = t_local_premium_plus;
		    }
    	
		    if ((t_free_premium_plus!='') && (t_free_premium_plus!='-')){
			    document.getElementById('rateFreePreplus_2').innerHTML ="£ "+ t_free_premium_plus;
		    } 
		    else
		    {
			    document.getElementById('rateFreePreplus_2').innerHTML = t_free_premium_plus;
		    }
		}
		
		if(country_no==3)
		{
		    if ((t_local_standard!='') && (t_local_standard!='-')){
			    document.getElementById('rateLocalStd_3').innerHTML ="£ "+ t_local_standard;
			    //document.getElementById('test_rate').innerHTML ="£ "+ t_local_standard;
		    }
		    else
		    {
			    document.getElementById('rateLocalStd_3').innerHTML = t_local_standard;
		    }
    	
		    if ((t_free_standard!='') && (t_free_standard!='-')){
			    document.getElementById('rateFreeStd_3').innerHTML ="£ "+ t_free_standard;
		    } 
		    else
		    {
			    document.getElementById('rateFreeStd_3').innerHTML = t_free_standard;
		    }

		    if ((t_local_premium!='') && (t_local_premium!='-')){
			    document.getElementById('rateLocalPre_3').innerHTML ="£ "+ t_local_premium;
		    }
		    else
		    {
			    document.getElementById('rateLocalPre_3').innerHTML = t_local_premium;
		    }
    	
		    if ((t_free_premium!='') && (t_free_premium!='-')){
			    document.getElementById('rateFreePre_3').innerHTML ="£ "+ t_free_premium;
		    } 
		    else
		    {
			    document.getElementById('rateFreePre_3').innerHTML = t_free_premium;
		    }

		    if ((t_local_premium_plus!='') && (t_local_premium_plus!='-')){
			    document.getElementById('rateLocalPreplus_3').innerHTML ="£ "+ t_local_premium_plus;
		    }
		    else
		    {
			    document.getElementById('rateLocalPreplus_3').innerHTML = t_local_premium_plus;
		    }
    	
		    if ((t_free_premium_plus!='') && (t_free_premium_plus!='-')){
			    document.getElementById('rateFreePreplus_3').innerHTML ="£ "+ t_free_premium_plus;
		    } 
		    else
		    {
			    document.getElementById('rateFreePreplus_3').innerHTML = t_free_premium_plus;
		    }
		}
		
		
	}

 
