var myWidth = 0, myHeight = 0;

	function alertSize() {
		
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		
	}

	function CssSwitcher(myAction, oObject, class1, class2) {
		
		
		switch (myAction) 
		{
			case 'swap':
			oObject.className =! CssSwitcher('check',oObject,class1) ? oObject.className.replace(class2,class1) : oObject.className.replace(class1,class2);
			break;

			case 'add':
			if(!CssSwitcher('check',oObject,class1))
			{
				oObject.className += oObject.className ? ' ' + class1 : class1; // get the class name, regardless if it's the control's second class
			}
			break;

			case 'remove':
			var rep = oObject.className.match(' ' + class1) ? ' ' + class1 : class1;
			oObject.className = oObject.className.replace(rep,'');
			break;

			case 'check':
				return new RegExp('\\b' + class1 + '\\b').test(oObject.className);
			break;
		}
	}

	var iCurrentHeight = 0;			
	window.onresize = function () 
	{
	
		var dMainContent = document.getElementById("MainContent");
		alertSize();
		if (myHeight < 620 || myWidth < 1000) 
		{

			if(!CssSwitcher('check',dMainContent,'mainContentMinHeight'))
				CssSwitcher('add',dMainContent,'mainContentMinHeight'); 

		}
		else
		{
			
		
			if(CssSwitcher('check',dMainContent,'mainContentMinHeight'))
				CssSwitcher('remove',dMainContent,'mainContentMinHeight');  
				
				
		}
		
		//alert(dMainContent.className);
		
	}