function getAllSheets() {
  if( !window.ScriptEngine && navigator.__ice_version ) { return document.styleSheets; }
  if( document.getElementsByTagName ) { var Lt = document.getElementsByTagName('link'), St = document.getElementsByTagName('style');
  } else if( document.styleSheets && document.all ) { var Lt = document.all.tags('LINK'), St = document.all.tags('STYLE');
  } else { return []; } for( var x = 0, os = []; Lt[x]; x++ ) {
    var rel = Lt[x].rel ? Lt[x].rel : Lt[x].getAttribute ? Lt[x].getAttribute('rel') : '';
    if( typeof( rel ) == 'string' && rel.toLowerCase().indexOf('style') + 1 ) { os[os.length] = Lt[x]; }
  } for( var x = 0; St[x]; x++ ) { os[os.length] = St[x]; } return os;
}
function changeStyle() {
  for( var x = 0, ss = getAllSheets(); ss[x]; x++ ) {
    if( ss[x].title ) { ss[x].disabled = true; }
    for( var y = 0; y < arguments.length; y++ ) {
     if( ss[x].title == arguments[y] ) { ss[x].disabled = false; }
} } }

var textsizevar = 's';
function textsize(sizevar){
if (sizevar == 'small'){
	changeStyle('MainStyles');
	textsizevar = 's';
}
if (sizevar == 'medium'){
	changeStyle('MainStyles','MediumText');
	textsizevar = 'm';
}
if (sizevar == 'large'){
	changeStyle('MainStyles','LargeText');
	textsizevar = 'l';
}

}

function featpop(whereto){
	window.name = "photoeyemain";
	wherenext = whereto;
	var myHeight = ((screen.availHeight))-50;
	var myWidth = ((screen.availWidth))-10;
	settings = 'width='+myWidth+',height='+myHeight+',channelmode=yes,directories=no,fullscreen=yes,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no';
	featWindow=window.open(wherenext,'FeatureWin',settings);
	if(featWindow){
		featWindow.focus();
	}
	checkWin.delay(.75, whereto);
}
function checkWin(whereto){
	if(featWindow && (!featWindow.closed)){

	}
	else {
		window.location = whereto;
	}
}
	
var popupWin = null;
function popUp(myURL,myWindowName,w,h,scroll,menu){
var myLeft = ((screen.width-w)/2)-5;
var myTop = ((screen.height-h)/2)-40;
if ((screen.width) < w){ w = screen.width - 20; scroll = 'yes';}
if ((screen.height) < h){ h = screen.height - 60; scroll = 'yes';}
var settings='height='+h+',width='+w+',top='+myTop+',left='+myLeft+', resizable=no,menu='+menu + ', scrollbars='+scroll
popupWin=window.open(myURL,myWindowName,settings);
if(parseInt(navigator.appVersion) >= 4){popupWin.focus();}
}

var cheight = 0;
var dheight = 0;
var eheight = 0;

function resizeToContent(var1){

if($("MagLeft")){
	$("MagLeft").style.height = "auto";
	$("MagLeft").style.visibility = "visible";
}
if($("MagMain")){
	$("MagMain").style.height = "auto";
	$("MagMain").style.visibility = "visible";
	if($('MagAd')){
		$("MagMain").addClassName('MainAreaBG');
	}
	else $('MagLeft').setStyle({width:'980px'});
}
if($("MagAd")){
	$("MagAd").style.height = "auto";
	$("MagAd").style.visibility = "visible";
}
if($("LoadingDiv")){
	$("LoadingDiv").hide();
}
if($("footload")){
	$("footload").style.visibility = "visible";
}

if(var1 = 1) {
	if($("SiteContainer")){
	$("SiteContainer").style.visibility = "visible";
	}
}

}


var comtog = 0;
function HideFirstComment(optog){
	if (comtog == 0){
		if($('FirstComment')){
			$('FirstComment').hide();
		}
		if($('commentview')){
			$('commentview').hide();
		}
		if($('commenthide')){
			$('commenthide').show();
		}
		comtog = 1;
		if (optog == 1){
				CommentContainer.open();
		}
	}
	else {
		if($('FirstComment')){
			$('FirstComment').show();
		}
		if($('commentview')){
			$('commentview').show();
		}
		if($('commenthide')){
			$('commenthide').hide();
		}
			comtog = 0;
		if (optog == 1){
				CommentContainer.close();
		}
	}
}

function OpenIfNot(){
	if (CollapsiblePanel1.isOpen() == true) {
		return true;
		}
	else {
		CollapsiblePanel1.open();
	}
}