/* Error Display Functions*/

function dispError(errno) 
{
	var msg='';
	var obj=document.getElementById('errorBar');
	
	if(errno==1)
		msg = 'Please sign in to use the remote control';
	else if(errno==2)
		msg = 'Please insert your email address';
	else if(errno==3)
		msg = 'Please verify that your email address is valid.';
	else if(errno==4)
		msg = 'Please insert your password';
	else if(errno==5)
		msg = 'You account subscription has expired. Please renew your subscription';
	else if(errno==6)
		msg = 'Please sign in to view this news clip';
	else if(errno==7)
		msg = 'Please select news clip of choice to watch';
	else if(errno==8)
		msg = "Kindly subscribe for this country's broadcasts before watching";
	else if(errno==9)
		msg = "Please sign in to view your account";
	else if(errno==10)
		msg = "Error signing into account. Email address invalid. Please try again";
	else if(errno==11)
		msg = "Invalid email address or password";
	else if(errno==12)
		msg = "Account disabled. Please confirm your registration. If your account is already confirmed contact website@Habari.TV";
	else if(errno==13)
		msg = "Empty email address or password. Please try again";
	else if(errno==14)
		msg = "Error registering account. Please try again";
	else if(errno==15)
		msg = "Error registering account. Email address exists. Please try again";
	else if(errno==16)
		msg = "Account created successfully.";
	else if(errno==17)
		msg = "Error registering account. Please fill in form & try again";
	else if(errno==18)
		msg = "Error confirming account. Please try again";
	else if(errno==19)
		msg = "Error confirming registration. Please try again";
	else if(errno==20)
		msg = "The reCAPTCHA wasn't entered correctly. Please try again.";
	else if(errno==21)
		msg = "Error confirming account. Please try again";
	else if(errno==22)
		msg = "Congratulations! Your Habari.TV Account has been confirmed. Please Sign in to view.";
	else if(errno==23)
		msg = "Error confirming account. Please try again.";
	else if(errno==24)
		msg = "Please select a broadcast.";
	else if(errno==25)
		msg = "Please insert your name";
	else if(errno==26)
		msg = "Please insert your feedback";
	else if(errno==27)
		msg = "Error sending feedback. Please try again";
	else if(errno==28)
		msg = "Feedback sent successfully";
	else if(errno==29)
		msg = "Invalid function requested";
	else if(errno==30)
		msg = "Search query required.";
	else if(errno==31)
		msg = "Error renewing account. Please try again";
	else if(errno==32)
		msg = "Your Habari.TV account details have successfully been updated.";
	else if(errno==33)
		msg = "Error adding subscription to shopping cart. Please try again.";
	else if(errno==34)
		msg = "Subscription succesfully added to shopping cart.";
	else if(errno==35)
		msg = "Error adding subscription to cart. Please try again.";
	else if(errno==36)
		msg = "Successfully deleted subscription from shopping cart.";
	else if(errno==37)
		msg = "Error deleting subscription from shopping cart. Please try again.";
	else if(errno==38)
		msg = "Error emptying shopping cart. Please try again.";
	else if(errno==39)
		msg = "Error processing order. Please try again.";
	else if(errno==40)
		msg = "Invalid order number.";
	else if(errno==41)
		msg = "Order successfully cancelled.";
	else if(errno==42)
		msg = "Error cancelling order. Please try again.";
	else if(errno==43)
		msg = "Country subscription already added to shopping cart please select another country.";
	else if(errno==44)
		msg = "Country subscription currently not supported. Please select another country";
	else if(errno==45)
		msg = "Error updating your Habari.TV account details. Please try again";
	else if(errno==46)
		msg = "Invalid old password. Please try again";
	else if(errno==47)
		msg = "Password changed successfully!";
	else if(errno==48)
		msg = "Error changing password. Please try again";
	else if(errno==49)
		msg = "Error sending invites. Please try again";	
	else if(errno==50)
		msg = "Successfully sent invites!";	
	else if(errno==51)
		msg = "Invalid action.";	
	else if(errno==52)
		msg = "Please select your birth date";	
	else if(errno==53)
		msg = "Empty email address or birth date. Please try again";	
	else if(errno==54)
		msg = "Email address invalid. Please change and try again";
	else if(errno==55)
		msg = "Email address and birth date invalid. Please change and try again";
	else if(errno==56)
		msg = "Password successfully reset and sent to your email address";
	else if(errno==57)
		msg = "This broadcast is only available to trial subscribers";
	else if(errno==58)
		msg = "This broadcast is only available to paid up subscribers";
	else if(errno==59)
		msg = "You are already signed in on another computer";
	
		obj.style.display = "";
	obj.innerHTML=msg;		
}
function dispError2(error) 
{
	var msg=error;
	var obj=document.getElementById('errorBar');
	obj.style.display = "";
	obj.innerHTML=msg;	
}

function show(id)
{
	var obj=document.getElementById(id);
	obj.style.display = "";
}

function showhide(id)
{
	if (document.getElementById){
	obj = document.getElementById(id);
	if (obj.style.display == "none"){
	obj.style.display = "";
	} else {
	obj.style.display = "none";
	}
	}
} 


/******************************************
* Popup Box- By Jim Silver @ jimsilver47@yahoo.com
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//drag drop function for NS 4////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}	

function showbox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility=""
else if (ns4)
document.showimage.visibility="show"
}	