var _CBUrl;var _CBDiv;var _CBB=0;var _toRefreshPage=0;function revealModal(d){window.onscroll=function(){document.getElementById(d).style.top=document.body.scrollTop;};document.getElementById(d).style.display="block";document.getElementById(d).style.top=document.body.scrollTop;}
function hideModal(d){document.getElementById(d).style.display="none";if(_toRefreshPage==1){window.location.reload();}else if(_toRefreshPage==2){}else if(_CBUrl.substring(0,11)=="javascript:"){eval(_CBUrl);}else{aget(_CBUrl,_CBDiv);}}
function reposition(s,i,h){var x=screen.width;ix=(x-100)/2-(s/2);if(i){i.style.left=x+'pt';i.style.top=h+'pt';}}
function dorepo(h){return;}
function getScreenWidth(){if (document.all){t=(document.body.clientWidth-15);}else if(document.documentElement && document.documentElement.clientWidth){t=document.documentElement.clientWidth-15;}else{t=(window.innerWidth-15);}return t;}
function resizePtS2(){var id=document.getElementById('__conmodm');var id2=document.getElementById('__conmod');if(id){w=parseInt(id.style.width);h=parseInt(id.style.height);t=parseInt(id2.style.top);l=parseInt(id2.style.left);if(w=='NaN')w=0;if(h=='NaN')h=0;if(t=='NaN')t=0;if(l=='NaN')l=0;if(w!=420||h!=580||t!=170||l!=550){if(w<420){w++;}else if(w>420){w--;}if(h<580){h++;}else if(h>580){h--;}if(t<170){t++;}else if(t>170){t--;}if(l<550){l++;}else if(l>550){l--;}id.style.width=w+"px";id.style.height=h+"px";id2.style.top=t+"px";id2.style.left=l+"px";resizePtS();}else{id.style.width="420px";id.style.height="580px";id2.style.top="170px";id2.style.left="550px";}}}
function resizePtM(){var i=document.getElementById('__conmodm');if(i){i.style.width="560px";i.style.height="590px";i=document.getElementById('__conmod');i.style.top="150px";i.style.left="500px";}}
function resizePtL(){var i=document.getElementById('__conmodm');if(i){i.style.width="1000px";i.style.height="580px";i=document.getElementById('__conmod');i.style.top="170px";i.style.left="280px";}}
function resizeNB2(){
	var id=document.getElementById('__conmodm');
	var id2=document.getElementById('__conmod');
	if(id)
	{
		w=parseInt(id.style.width);
		h=parseInt(id.style.height);
		t=parseInt(id2.style.top);
		l=parseInt(id2.style.left);
		if(w=='NaN')w=0;
		if(h=='NaN')h=0;
		if(t=='NaN')t=0;
		if(l=='NaN')l=0;
		if(w!=810&&h!=680)
		{
			if(w<810)
			{
				w++;
			}else if(w>810){w--;}
			if(h<680){h++;}
			else if(h>680){h--;}
			if(t<150){t++;}
			else if(t>150){t--;}
			if(l<370){l++;}
			else if(l>370){l--;}
			id.style.width=w+"px";
			id.style.height=h+"px";
			id2.style.top=t+"px";
			id2.style.left=l+"px";
			resizeNB();
		}
		else{
			id.style.width="810px";
			id.style.height="680px";
			id2.style.top="150px";
			id2.style.left="370px";
		}
	}
}
function resizeNB(){setCenter();_t=150;_l=370;_w=810;_h=680;_inv=setInterval('doScreenSetup()',10);}
function resizePtfpt(){setCenter();_w=620;_h=580;_t=170;_l=450;_inv=setInterval('doScreenSetup()',10);}
function resizePtS(){setCenter();_w=420;_h=580;_t=170;_l=550;_inv=setInterval('doScreenSetup()',10);}
var _t=0;var _l=0;var _w=0;var _h=0;var _inv;
function setCenter(){var id=document.getElementById('__conmodm');var id2=document.getElementById('__conmod');id.style.width="0px";id.style.height="1000px";id2.style.top="300px";id2.style.left="400px";}
function doScreenSetup()
{
var id=document.getElementById('__conmodm');
var id2=document.getElementById('__conmod');
if(id&&id2)
{
w=parseInt(id.style.width);
h=parseInt(id.style.height);
t=parseInt(id2.style.top);
l=parseInt(id2.style.left);
if(w=='NaN')w=0;
if(h=='NaN')h=0;
if(t=='NaN')t=0;
if(l=='NaN')l=0;
iMax=50;
iMin=1;
if(w!=_w&&h!=_h&&1==2)
{
if(w<_w){w=w+((_w-w)>=iMax ? iMax :iMin);}
			else if(w>_w)
			{
				w=w-((w-_w)>=iMax ? iMax :iMin);
			}
			if(h<_h)
			{
				
				h=h+((_h-h)>=iMax ? iMax :iMin);
			}
			else if(h>_h)
			{
				h=h-((h-_h)>=iMax ? iMax :iMin);
			}
			if(t<_t)
			{
				
				t=t+((_t-t)>=iMax ? iMax :iMin);
			}
			else if(t>_t)
			{
				t=t-((t-_t)>=iMax ? iMax :iMin);
			}
			if(l<_l)
			{
				
				l=l+((_l-l)>=iMax ? iMax :iMin);
			}
			else if(l>_l)
			{
				l=l-((l-_l)>=iMax ? iMax :iMin);
			}
			id.style.width=w+"px";
			id.style.height=h+"px"
			id2.style.top=t+"px";
			id2.style.left=l+"px";
		}
		else
		{
			clearInterval(_inv);
			id.style.width=_w+"px";
			id.style.height=_h+"px";
			id2.style.top=_t+"px";
			id2.style.left=_l+"px";
		}
	}
}



function popNoreload(rfUrl,ldUrl,hideme,bval)
{
	var id=document.getElementById(hideme);
	if(id)
	{
		id.style.visibility = 'hidden';
	}
	if(bval!="")
	{
		if(document.fpopupaction.btnPUSave)document.fpopupaction.btnPUSave.value=bval;
	}

	resizePtL();

	//dorepo(10);

	_toRefreshPage=2;
	_CBDiv='';
	_CBUrl=rfUrl;
	_RQ_elements=_RQ_elements;
	_RQ_msg=_RQ_msg;
	document.fpopupaction.action=ldUrl;
	revealModal('modalPage');
	aget(ldUrl,'popbody');
}
function popUpreload(rfUrl,ldUrl,hideme,bval)
{
	var id=document.getElementById(hideme);
	if(id)
	{
		id.style.visibility = 'hidden';
	}
	if(bval!="")
	{
		if(document.fpopupaction.btnPUSave)document.fpopupaction.btnPUSave.value=bval;
	}

	resizePtS();
	//dorepo(100);

	_toRefreshPage=1;
	_CBDiv='';
	_CBUrl=rfUrl;
	_RQ_elements=_RQ_elements;
	_RQ_msg=_RQ_msg;
	document.fpopupaction.action=ldUrl;
	revealModal('modalPage');
	aget(ldUrl,'popbody');
}

function popUp(rfDivID,rfUrl,ldUrl,el,msg)
{
	_CBDiv=rfDivID;
	_CBUrl=rfUrl;
	_RQ_elements=el;
	_RQ_msg=msg;
	document.fpopupaction.action=ldUrl;
	revealModal('modalPage');
	aget(ldUrl,'popbody');
}


function popUp(rfDivID,rfUrl,ldUrl,el,msg,db)
{
	_CBDiv=rfDivID;
	_CBUrl=rfUrl;
	_RQ_elements=el;
	_RQ_msg=msg;
	_CBB=db;
	document.fpopupaction.action=ldUrl;
	revealModal('modalPage');
	aget(ldUrl,'popbody');
}



function onPUCancel()
{
	hideModal('modalPage');
}
function needToValidate(fld)
{
	var bo=-1;
	for(var i=0;i<_RQ_elements.length;i++)
	{
		if(_RQ_elements[i]==fld.name)
		{
			return i;
		}
	}
	return bo;
}
function getmsg(i)
{
	return _RQ_msg=_RQ_elements[i];
}
function ValidateForm()
{
	var formElements = document.fpopupaction.elements;
	var msg="";
	for (var i=0; i<formElements.length; i++)
	{
		var x=needToValidate(formElements[i]);
		if(x>-1)
		{
			if(formElements[i].value=='')
				msg=msg+getmsg(x)+"<br>";
		}
	}
	return msg;
}
function onPUSave()
{
	var msg=ValidateForm();
	if(msg=='')
	{
		fr=document.fpopupaction;
		fr.setAttribute('target', doCreatePrivateDiv(fr));
		fr.submit();
	}
	else
	{
		alert(msg);
	}
}
function onLoadDone(id)
{
		var i = document.getElementById(id);

		if (i.contentDocument) {
			var d = i.contentDocument;
		} else if (i.contentWindow) {
			var d = i.contentWindow.document;
		} else {
			var d = window.frames[id].document;
		}

		if (d.location.href == "about:blank") {
			return;
		}

		if(_CBB==1)
		{
			alert(d.body.innerHTML);
		}
		hideModal('modalPage');
}
function doCreatePrivateDiv(c)
{
	var n = 'f' + Math.floor(Math.random() * 99999);
	var d = document.createElement('DIV');
	d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="onLoadDone(\''+n+'\')"></iframe>';
	document.body.appendChild(d);
	var i = document.getElementById(n);
	if (c && typeof(c.onComplete) == 'function')
	{
		i.onComplete = c.onComplete;
	}
	return n;
}


function onPUSave2()
{
	var pdata='';
	var formElements = document.fpopupaction.elements;

	for (i=0; i<formElements.length; i++)
	{
		var tmp='';
		if(i!=0)
		{
			tmp='&';
		}
		tmp=tmp+formElements[i].name+'='+escape(encodeURI(formElements[i].value));
		pdata=pdata+tmp;
	}
	alert(pdata);
	//document.fpopupaction.submit();
}
var _RQ_elements=new Array();
var _RQ_msg=new Array();

var _RQ_elements_TL=new Array("ftlText","ftlUrl");
var _RQ_msg_TL=new Array("Please enter complete the Text field!","Please complete the URL field!");

var _RQ_elements_FL=new Array("ftlTitle","ftlupload");
var _RQ_msg_FL=new Array("Please enter in a Title for your file!","Please select a file!");

var _RQ_elements_LG=new Array();
var _RQ_msg_LG=new Array();





