function setupAlert(){
	 divtxt = '';
	 divtxt = '<div id="alertdiv" style="position:absolute;left:100px; border:2px solid #012F9A; background-color:#A7C1FE;'; 
	 divtxt += 'padding:0px; font-size:150%; text-align:center; display:none">';
divtxt += '<div id="alertdiv_title" style="border-bottom:2px solid #012F9A; background-color:#709AFE; padding:2px;"></div>';
	 divtxt += '<div id="alertdiv_msg" style="vertical-align:top; padding:2px;"> </div>';
	 divtxt += '<div id="alertdiv_buttons" style="vertical-align:top; padding:2px;"> </div>';	
	 divtxt += '</div>';
 //alert(divtxt);
	 document.write(divtxt);
}

function hideflash()
{ 
        /* hide all flash in the page */		
        flash = document.getElementsByTagName('embed');
        for (var i = 0; i < flash.length; i++) 
        { 
                flash[i].style.visibility = 'hidden';
        }
}
function showflash()
{
        /* show all flash */
        flash = document.getElementsByTagName('embed')
        for (var i = 0; i < flash.length; i++) 
        { 
                flash[i].style.visibility = 'visible';
        }
}
function showAlert(title, msg, style, popAlertControlName){ 
		//shortcut.remove('Enter');
		//shortcut.add('Enter',function() {Popup.hide('alertdiv');  }  );
		$('alertdiv_title').innerHTML = "<div class='i_regsmb' style='text-align:center'>"+title+"</div>";
	   $('alertdiv_msg').innerHTML = "<div class='i_regsm' style='width:300px; text-align:center'>"+msg+"</div>";
		$('alertdiv_buttons').innerHTML = "<input id='okButton' type='button' value='&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;' onClick=\"Popup.hide('alertdiv');"+popAlertControlName+".focus();\">";	
		
		Popup.showModal('alertdiv', 'firstname');
		
		return false;
}

function setupConfirm(){
	 divtxt = '';
	 divtxt = '<div id="confirmdiv" style="position:absolute;left:100px; border:2px solid #012F9A; background-color:#A7C1FE; padding:0px; font-size:150%; text-align:center; display:none">';
	 divtxt += "<div id='confirmdiv_title' style='border-bottom:2px solid #012F9A;background-color:#709AFE;padding:2px;'><div class='i_regsmb' style='text-align:left'>Infodoro Confirmation</div></div><br>";
	 divtxt += "<div id='confirmdiv_msg' style='vertical-align:top; padding:2px;'> </div><br>";
	 divtxt += "<div id='confirmdiv_buttons' style='vertical-align:top; padding:2px;'> </div>";
	 divtxt += "</div>";
//	 alert(divtxt);
	 document.write(divtxt);
}

function showConfirm(msg, style, callFunction){	
	$('confirmdiv_msg').innerHTML = "<div class='i_regsm' style='left:10px;top:0px; width:300px; text-align:left'>"+msg+"</div>";	
	$('confirmdiv_buttons').innerHTML = "<input type='button' value='&nbsp;&nbsp;&nbsp;Yes&nbsp;&nbsp;&nbsp;' onClick=\""+callFunction+";\">&nbsp;&nbsp;&nbsp;<input type='button' value='&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;' onClick=\"Popup.hide('confirmdiv');\">";
	/*	
	if(defined(style)){
		$('confirmdiv').style = style;	
	}
	*/
	Popup.showModal('confirmdiv', 'firstname');
	//return false;
	
}

function AKUtils()
{
}

/* Replace quotes by html entities */
AKUtils.prototype.cleanForHtml = function(str){	
	return str
		.replace(/'/g, "&#039;")
		.replace(/"/g, "&quot;");
}

AKUtils.prototype.removeEntities = function(str){	
	return str
		.replace(/&#039;/g, "'")
		.replace(/&quot;/g, '"');
}


AKUtils.prototype.addOffset = function (pos1, pos2){
	alert('x='+pos1.x+" y=" + pos1.y);
	alert('x='+pos2.x+" y=" + pos2.y);
	return {x:(pos1.x+pos2.x), y:(pos1.y+pos2.y)};
}
AKUtils.prototype.getPosition = function(oElement){
  if( typeof( oElement.offsetParent ) != 'undefined' ) {
    for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
      posX += oElement.offsetLeft;
      posY += oElement.offsetTop;
    }
    return {x:posX, y:posY };
  } else {
    return {x:oElement.x, y:oElement.y };
  }
}


String.prototype.escapeHTML= function() {
   	return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;')
		.replace(/'/g,'&#039;').replace(/"/g,'&quot;');
	
  },
String.prototype.unescapeHTML= function() {
    return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>')
	.replace(/&#039;/g,"'").replace(/&quot;/g,'"');
  }
  
  function setSpaceForDefaultKeywords(){
	 divtxt = '';
	 divtxt = '<div id="defaultMetaKeywords" style="position:absolute;left:100px;'; 
	 divtxt += 'padding:0px;text-align:center; display:none">';	
	 divtxt += '</div>';
 //alert(divtxt);
	 document.write(divtxt);
}
