
var BASEDIR='http://www.irrabagon.com/rivendale/';

//---------------------------------------------------------------------------------------------------------------------------------------------------
//#################
var DOMtype='';
if(document.getElementById){DOMtype='std';}
else if(document.all){DOMtype='ie4';}
else if(document.layers){DOMtype='ns4';}
var JSObjects=new Array();
function FetchObject(idname){
	if(typeof(JSObjects[idname])=='undefined'){
		switch(DOMtype){
			case 'std':{JSObjects[idname] = document.getElementById(idname);}break;
			case 'ie4':{JSObjects[idname] = document.all[idname];}break;
			case 'ns4':{JSObjects[idname] = document.layers[idname];}break;
		}
	}
	return JSObjects[idname];
}

//---------------------------------------------------------------------------------------------------------------------------------------------------
function f_Loadind(){
	FetchObject('idLoadingBlock').style.display='none';	
	FetchObject('idDocumentBoby').style.display='block';
}

//---------------------------------------------------------------------------------------------------------------------------------------------------
function f_Sending(){
	if(DOMtype=='std'){
		FetchObject('idDocumentBoby').style.display='none';
		FetchObject('idSendingBlock').style.display='block';	
	}
}

//---------------------------------------------------------------------------------------------------------------------------------------------------
function OpenWindow(url,target,width,height){
	if(DOMtype=='ie4' || DOMtype=='std'){
		var xMax=screen.width;
		var yMax=screen.height;
	}else if(DOMtype=='ns4'){
		var xMax = window.outerWidth;
		var yMax = window.outerHeight;
	}else{
		var xMax=800;
		var yMax=600;
	}
    var xOffset=(xMax-width)/2;
	var yOffset=(yMax-height)/3;
	jswindow=window.open(url,target,'width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',copyhistory=no,directories=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
	jswindow.focus();
	return false;
}

//#################
//---------------------------------------------------------------------------------------------------------------------------------------------------
function OpenCommentBox(mid,type,pid){
	var temp='<form action="./comment.add.php" method="post" onsubmit="return CheckFrom(this);"><input type="hidden" name="pid" value="'+mid+'">';
	if(type==1){
		FetchObject('idCB'+mid).innerHTML='<a href="#" onclick="return CloseCommentBox('+mid+',1);">не добавлять</a>';
	}else if(type==2){
		FetchObject('idCB'+mid).innerHTML='<a href="#" onclick="return CloseCommentBox('+mid+',2);"><b>не добавлять комментарий</b></a>';
	}else if(type==3){
		FetchObject('idCB'+mid).innerHTML=' <a href="#" onclick="return CloseCommentBox('+mid+',3);">не добавлять комментарий</a> ';
		temp+='<input type="hidden" name="fid" value="'+pid+'">'
	}
	temp+='<table border="0" cellpadding="4" cellspacing="0" class="box01b" width="100%"><tr class="msgbgcc"><td colspan="2"><b>Добавить комментарий</b></td></tr><tr class="msgbgcc"><td nowrap>Как:</td><td width="100%"><b>'+u_Login+'</b></td></tr><tr class="msgbgcc"><td valign="top" nowrap>Сообщение:</td><td><textarea name="message" style="width:100%;height:100px;"></textarea></td></tr><tr class="msgbgcc"><td align="right" colspan="2"><input type="submit" value="Добавить сообщение"></td></tr></table></form><br>';
	FetchObject('idBB'+mid).innerHTML=temp;
	return false;
}

//---------------------------------------------------------------------------------------------------------------------------------------------------
function CloseCommentBox(mid,type){
	if(type==1){
		FetchObject('idCB'+mid).innerHTML='<a href="#" onclick="return OpenCommentBox('+mid+',1);">добавить</a>';
	}else if(type==2){
		FetchObject('idCB'+mid).innerHTML='<a href="#" onclick="return OpenCommentBox('+mid+',2);"><b>добавить комментарий</b></a>';
	}else if(type==3){
		FetchObject('idCB'+mid).innerHTML=' <a href="#" onclick="return OpenCommentBox('+mid+',3);">добавить комментарий</a> ';
	}
	FetchObject('idBB'+mid).innerHTML='&nbsp;';
	return false;
}

//---------------------------------------------------------------------------------------------------------------------------------------------------
function Drop(){
	return confirm('Удалить?');
}