var d = document;
var winIE = (navigator.userAgent.indexOf('Opera')==-1 && (d.getElementById && d.documentElement.behaviorUrns)) ? true : false;

var bodySize = function (){
	
	if(winIE && d.documentElement.clientWidth) {
		
		sObj = $("#container");
		sObj.css('width', (d.documentElement.clientWidth < 1000 ? '1000px' : (d.documentElement.clientWidth > 1400 ? '1400px' : (d.documentElement.clientWidth - 0) + 'px')));
	}
	sObj = $("#content-regular");
	if(sObj) 
	sObj.css('width', (d.documentElement.clientWidth < 1024 ? '470px' : (d.documentElement.clientWidth > 1400 ? '848px' : (d.documentElement.clientWidth - 552) + 'px')));
}

var bodySize2 = function (){
	
	
	mesObj = document.getElementById('measurer');//$("#measurer");
	
	
	
	
	
	if(mesObj)
	{
		MaxWidth = mesObj.clientWidth;
		
		sObj = $("#container");
		if(sObj)
			sObj.css('width', (MaxWidth < 1000 ? '1000px' : (MaxWidth > 1400 ? '1400px' : (MaxWidth - 0) + 'px')));
		
		crObj = $('#content-regular');
		if(crObj) 
			crObj.css('width', (MaxWidth < 1000 ? '448px' : (MaxWidth > 1400 ? '848px' : (MaxWidth - 552) + 'px')));
			
		tmObj = $("#top-menu");
		if(tmObj ) 
			tmObj.css('width', (MaxWidth < 1000 ? '1000px' : (MaxWidth > 1400 ? '1400px' : (MaxWidth - 0) + 'px')));
	
		pmObj = $('#popup-2');
		if(pmObj)
			pmObj.css('left', (MaxWidth < 1000 ? '500px' : (MaxWidth > 1400 ? '700px' : Math.round(MaxWidth/2) + 'px')));
		
		/*pmObj =  document.getElementById('popup-2');
		if(pmObj)
			pmObj.style.left = (MaxWidth < 1000 ? '500px' : (MaxWidth > 1400 ? '700px' : Math.round(MaxWidth/2) + 'px'));
		*/
	}
}

/*$(document).ready( //sava
	function(){ bodySize2(); }
);*/

/*$(document).change(
	function(){ bodySize(); }
);*/

//if(winIE) { onresize = bodySize; }

/* //sava
if(window.addEventListener)
{ // Mozilla, Netscape, Firefox
	window.addEventListener('load',bodySize2, false);
	window.addEventListener('resize',bodySize2, false);
} 
else 
{ // IE
	window.attachEvent('onload', bodySize2);
	window.attachEvent('onresize', bodySize2);
}
*/


var IE = document.all?true:false;

function SetPrintCSS(isPrint)
{
   var link;

   if (document.getElementsByTagName)
      link = document.getElementsByTagName('link');
   else if (document.all)
      link = document.all.tags('link');
   else
      return;

   for (var index=0; index < link.length; index++)
   {
   	
      if (link[index].title == 'print')
      {
      	/*alert ("rrr");*/
      	if(IE) link[index].disabled="true";
      	if(isPrint) link[index].disabled = "";
      	else link[index].disabled = "disabled";
      }
   }
}

if (document.location.hash == '#print')
   SetPrintCSS(true);

   
