
function showSiteInfo(cId){
ajaxRequest2('index.php?act=show&shortInfo=true&cId='+cId,'dialogInfo',showSiteDialog);
}

function showSiteDialog(){
showIt();
}

function showLargeDialog(){
showIt('large');
}

function showContent(name){
	ajaxRequest('index.php?act='+name,'subContent');
}


function showWarning(content)
{
	if(content){dojo.byId('dialogInfo').innerHTML=content;}
	showIt('alert');
	//dijit.byId('dialog1').show();
}

function showNoButtonWarning(content)
{
	if(content){dojo.byId('dialogInfo').innerHTML=content;}
	showIt('smallPrev');
}

function hideWarning(){
hideIt();
//dojo.byId('dialog1').hide();
}

function showPreviewPopup(){
showIt('preview');
}

function showCalendarPopup(){
showIt('calendar');
}


function hideDialog2(){
hideIt();
//dojo.byId('dialog2').hide();
}


(document.getElementById) ? dom = true : dom = false;

function hideIt() {

  window.clearTimeout(window.dialogTimeout);

   if (dom && !document.all){
	    document.getElementById("bg_button").style.display='none';  
		document.getElementById("bg_full").style.display='none';
	}
   
   if(document.all){
    document.all["bg_button"].style.display='none';
    document.all["bg_full"].style.display='none';
   }
}

function showIt(style,button) {
  var button_display = 'none';
  var height = 520;
  var width   = 760;
  var align = 'left';	

	if(style == 'large'){
  	  var height = 552;
  	  var width = 1026;
  }

  if(style == 'calendar'){
  	  var height = 340;
  	  var width = 450;
  }

  if(style == 'smallPrev'){
  	  var height = 200;
  	  var width = 350;
  	  align = 'center';
  }

  if(style == 'alert'){
  	  var height = 200;
  	  var width = 350;
  	  button_display = 'block';
  	  align = 'center';
  	  
  }
  if(style == 'preview'){
  	  var height = 400;
  	  var width = 540;
  	  align = 'center';
  }
  
  if (dom && !document.all){
	  document.getElementById("bg_wnd").style.height= height + "px";
	  document.getElementById("bg_wnd").style.width= width + "px";
	  document.getElementById("bg_wnd").style.margin= ((window.innerHeight-height)/2) + "px auto auto auto";
	  document.getElementById("bg_button").style.display=button_display;
	  document.getElementById("bg_button").style.cursor="pointer";
	  document.getElementById("dialogInfo").style.textAlign=align;  
	  document.getElementById("bg_full").style.display='block';  
  }
  
  
   if(document.all){
	 document.all["bg_wnd"].style.height= height + "px";
	 document.all["bg_wnd"].style.width= width + "px";
	 document.all["bg_wnd"].style.margin= ((document.documentElement.clientHeight-height)/2) + "px auto auto auto";
     document.all["bg_button"].style.display=button_display;  
     document.all["dialogInfo"].style.textAlign=align;
	 document.all["bg_full"].style.display='block';	 
  }
  
 window.dialogTimeout = window.setTimeout("placeIt()", 5); 
}

function placeIt(){

if(window.dialogTimeout > 0){
//alert(window.dialogTimeout);
window.dialogTimeout = window.setTimeout("placeIt()", 5); 
}

  if(dom && !document.all) {
	  document.getElementById("bg_full").style.height = window.innerHeight;
	  document.getElementById("bg_full").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight )) + "px";
  }
  if(document.all) {
	  document.all["bg_full"].style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight)) + "px";
	  document.all["bg_full"].style.height = document.documentElement.clientHeight;
  	}
}
 
function progressInsert(){

  if(dom && !document.all) {
	  document.getElementById("pr_full").style.height = window.innerHeight;
	  document.getElementById("pr_full").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight )) + "px";
  }
  if(document.all) {
	  document.all["pr_full"].style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight)) + "px";
	  document.all["pr_full"].style.height = document.documentElement.clientHeight;
  	}


if(window.progressTimeout > 0){
window.progressTimeout = window.setTimeout("progressInsert()", 5); 
}
}
