// JavaScript Document


var myHeight = 0;
var myWidth = 0;

function setRe()
{

	if( typeof( window.innerWidth ) == 'number' ) {
	  //Non-IE
	  myHeight = window.innerHeight;
	} else if( document.documentElement && (document.documentElement.clientWidth ||document.documentElement.clientHeight) ) {
	  //IE 6+ in 'standards compliant mode'
	  myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	  //IE 4 compatible
	  myHeight = document.body.clientHeight;
	}
	
	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;
	}
	
}

setRe();

if(myHeight > 900){
	myHeight = 900;
} 
if(myWidth > 1200){
	myWidth = 1200;
}

myHeight -= 65;
myWidth -= 65;
$(document).ready(function(){
	$("#webfeature a").each(function(){
			var url = $(this).attr("href"); // --- get the original url
			var widthre = /width=1000/; // --- regexp to get the width
			var heightre = /height=700/; // --- regexp to get the height
			url = url.replace(widthre, 'width=' + myWidth) // --- replace the width
			url = url.replace(heightre, 'height=' + myHeight) // --- replace the height
			
			$(this).attr("href", url);
	});
});
