function forma(inval)
{
var outval = '<b class="ctitle"><a href="/cabinet.php" style="float:right; display:block; padding:0 4px; background-color:#0033CC; margin:0 2px; color:#CCCCFF" onclick="showe(\'dark\',0); return(false)">X </a>Объявление №<strong>'+inval+'</strong></b>';	
outval = outval + '<input type="hidden" name="adid" value="'+inval+'" />';	
return(outval);	
}

function wght($)
{
		var xScroll;

		if (window.innerWidth && window.scrollMaxX) {
			xScroll = window.innerWidth + window.scrollMaxX;
		} else if (document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
		}

		var windowWidth;

		if (self.innerWidth) { // all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth;
			} else {
				windowWidth = self.innerWidth;
			}
		} else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
		}

		// for small pages with total height less then height of the viewport
		// for small pages with total width less then width of the viewport
		if(xScroll > windowWidth){
			pageWidth = xScroll;
		} else {
			pageWidth = windowWidth;
		}
return pageWidth;
}


function hght($)
{
		var yScroll;

		if (window.innerHeight && window.scrollMaxY) {
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			yScroll = document.body.offsetHeight;
		}

		var windowHeight;

		if (self.innerHeight) { // all except Explorer
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowHeight = document.body.clientHeight;
		}

		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else {
			pageHeight = yScroll;
		}

		return pageHeight;
}

function showe(objname,payinput)
{
	
	var obj = document.getElementById( objname );
	if(obj.className == "hid")
		{
			var pageHeight = hght();	//document.documentElement.clientHeight;
			var pageWidth = wght();	//document.documentElement.clientHeight;
			obj.className = "vis";
			obj.style.height = pageHeight+"px";
			obj.style.width = pageWidth+"px";
			var obje = document.getElementById( 'innercont' );
					obje.style.left = (pageWidth - 460)/2 + 'px';
					obje.className = "vis";
			var objex = document.getElementById( 'innerformex' );
					objex.innerHTML = forma(payinput);
		}
		else
		{
			var hei = 0;
			obj.className = "hid";
			obj.style.height = 0+"px";
			obj.style.width = 0+"px";
			var obje = document.getElementById( 'innercont' );
					obje.className = "hid";
			var objex = document.getElementById( 'innerformex' );
					objex.innerHTML = '';
		}
return;}

butenabl = 0;

