function loadSite(url) {
  document.getElementById('siteview').src = url;
  var toggle = toggleOpenLink('on');
  document.getElementById('openlink').setAttribute('onclick','openWindow(\''+url+'\')');
  return false;
}

function makeOpenLink(url) {
  document.getElementById('openlink').setAttribute('onclick','openWindow(\''+url+'\')');
  return true;
}

function toggleOpenLink(condition) {
 if (condition == 'on') {
   document.getElementById('openlink').style.visibility = "visible";
 } else {
   document.getElementById('openlink').style.visibility = "hidden"; 
 }
  return true;
}

function confirmSubmit(message) {
	var agree = confirm(message);
	if (agree) {
		return true;
	} else {
		return false;
	}
}

function openWindow(url) {
	window.open(url,'','scrollbars=yes,menubar=yes,height=600,width=800,resizable=yes,toolbar=yes,location=yes,status=yes');
	return false;
}

function screenCookie() {
	
	var windim = winSize();
	document.getElementById('siteview').style.height = windim[1]-175 + "px";

	return true;
}

function winSize() {
  var myWidth = 0, myHeight = 0;
  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;
  }
  return new Array(myWidth,myHeight);
}

