
function getWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}

function transform(){
	windowWidth = getWidth();
	
	if(windowWidth > 1100){ 					// LARGE
		
		
		if($(".submenu").eq(0).html() == '')
			$(".submenu").eq(0).html($('.submenu').eq(1).html());		// submenu goes up
		
		$('.news2').eq(0).html($('.news').eq(0).html());							// first news goes up
		
		$('.news2').eq(1).html($('.news').eq(1).html());								// second news goes up
		
		$('.hide').show();
		
		$('.news').hide(); 																				// hide old news
		
		
		$('td.icq').prepend($('div.icq'));											// move ICQ right
		
		
	} else {													// SMALL
		
		if($('.submenu').eq(0).html())
			$('.submenu').eq(1).html($('.submenu').eq(0).html());								// submenu goes down
		
		
		$('.news').show();																				// show old news
		
		$('.hide').hide();
		
		$('.email').after($('div.icq'));											// move ICQ back left
		
	}
	
}

function svs_transform() {
	windowWidth = getWidth();
	if (windowWidth > 1200) {
		$("td.news").show();
		$("#work5").show();
		$("#kill_width").width("530px");
		$(".blog_content .process div.post-wrapper").eq(1).show();
		$(".blog_content .process div.post-wrapper").eq(0).find("div.post-left").css({"float": "left"});
		//$(".blog_content .column3 .post2").show();
		//$(".blog_content .column3 .post1 .post-image").css("float", "left");

	} else {
		$("td.news").hide();
		$("#work5").hide();
		$("#kill_width").width("400px");
		$(".blog_content .process div.post-wrapper").eq(1).hide();
		$(".blog_content .process div.post-wrapper").eq(0).find("div.post-left").css({"float": "none"});
		//$(".blog_content .column3 .post2").hide();
		//$(".blog_content .column3 .post1 .post-image").css("float", "none");
		
	}
	
}


$(window).resize(function(){
	svs_transform();
	// transform();
});


$(document).ready(function(){
	svs_transform();
//	transform();
});
