var msgInicio = 'Preparado';

function get(obj){
	return document.getElementById(obj);
}
function showFlash(){
	get(idFlashButton).height = 140;
	get(idFlashButton).width = 220;
	showHelpWdw();
}
function hideFlash(){
	get(idFlashButton).height = 1;
	get(idFlashButton).width = 1;
	hideHelpWdw();
}
function showStatus(msg){
	get('msgCall').innerHTML = msg;
}
function showHungUpButton(){
	get('btnHungUp').style.display = 'block';
	get('btnCall').style.display = 'none';
}
function showCallButton(){
	get('btnCall').style.display = 'block';
	get('btnHungUp').style.display = 'none';
	get('btnHungUp').disabled = false;
	showStatus(msgInicio);
	hideFlash();
	switchBg = true;
}
function endCall(){
	try{
		get('btnHungUp').disabled = true;
		get('clickandcall').hungUpCall();
	}catch(ex){
		;
	}
}
function beginCall(){
	/*switchBg = false;
	get('msgCall').style.backgroundColor = '#7E7E7E';
	get('clickandcall').initCall();
	showHungUpButton();*/
	if(hasRequestedVersion){
		switchBg = false;
		get('msgCall').style.backgroundColor = '#7E7E7E';
		get('clickandcall').initCall();
		showHungUpButton();
	}else{
		get('containerButtonsClickAndCallToHide').style.display = 'none';
		get('txtNoFlash').innerHTML = alternateContent;
	}
}

function hideHelpWdw(){
  get('helpWdw').style.display='none';
}
function showHelpWdw(){
  get('helpWdw').style.display='block';
}

function autoCall(){
	 if( valid.noEmpty(get('clickandcall')['initCall']) ){
	 	//alert(get('clickandcall')['initCall']);
	 	beginCall();
	 	clearInterval(autoCaller);
	}
}

