function openTVframe(url){
  if (top != window)  // is in frame
    if (top.location.href.toLowerCase().indexOf("specialk") != -1)
      window.parent.location = "/boards/main_frame.aspx?page="+url;
    else (window.location = url)
}

function chooseBrdFrame(thisselect) {

var currentFrame;
if (top != window)  // is in frame
  currentFrame = (top.location.href.toLowerCase().indexOf("specialk") != -1)? "specialk" : "default";
    
if (thisselect.selectedIndex > 0)
	{
		var url = thisselect.options[thisselect.selectedIndex].value;
    if (url != ''){
    
			if( (url.indexOf("talk.thenest.com",0) != -1) || (url.indexOf("redirect",0) != -1) )
			{
				window.parent.location = url;
			}
			
		  else if ( url.indexOf("ForumID",0) != -1 ){
			  FrameType = (url.indexOf("ForumID=238") != -1) ? "specialk" : "default";
			  
			  if (currentFrame == FrameType){
			    window.location = url;
			  }
			  else {
			    window.parent.location = (FrameType == "specialk") ? "/Boards/SpecialK_frame.aspx" : "/boards/main_frame.aspx?page="+url;
			  }
			  
			}
			
			else {
				window.open(url);
			}
		}

	}
}

var imgpathForums = "http://images.theknot.com/forums/"

function InitPreload() {
	var imgArray = new Array(
	'icon_mini_home_over.gif',
	'mb_nav_typ_index.gif',
	'icon_mini_search_over.gif',
	'mb_nav_typ_search.gif',
	'icon_mini_profile_over.gif',
	'mb_nav_typ_updprofile.gif',
	'icon_mini_faq_over.gif',
	'mb_nav_typ_help.gif',
	'icon_mini_logoff_over.gif',
	'mb_nav_typ_logout.gif',
	'icon_mini_logoff_over.gif',
	'mb_nav_typ_logout.gif',
	'btn_apply-over.gif',
	'mb_search_go_over.gif',
	'btn_markallread-over.gif',
	'btn_remember-over.gif',
	'forumoptions_over.gif',
	'newpost_over.gif',
	'newtopic_over.gif',
	'ratetopic_over.gif'
	);
	ImgPreloader(imgArray);
}

function ImgPreloader(imgArray) {
	var i;
	for(i=0; i < imgArray.length; i++)
	{
		var newImage = new Image();
		newImage.src = imgpathForums + imgArray[i];
	}
}

function threeDayPopup(){ 
    delaypop = open_popup('/boards/Msgs/popups.aspx?MessageID=91','375','275','1','1','co_joinmessage');
//    delaypop.focus();
}

function activePopup(){ 
    activepop = open_popup('/boards/Msgs/popups.aspx?MessageID=92','375','275','1','1','co_joinmessage_3');
//    activepop.focus();
}

function joinCommunity(){ 
   joinpop = open_popup('http://www.theknot.com/co_mbjoin.htm','525','600','1','1','co_mbjoin');
   joinpop.focus();
}

function bannedPopup(){ 
    bannedpop = open_popup('/boards/Msgs/popups.aspx?MessageID=94','375','275','1','1','co_mbbanned');
    bannedpop.focus();
}
   
function memproffPopup(){ 
    memprofpop = open_popup('/boards/Msgs/popups.aspx?MessageID=93','375','275','1','1','co_memproff');
    memprofpop.focus();
}

function DeletePopup(){ 
   deletepop = open_popup('/boards/Msgs/popups.aspx?MessageID=95','375','275','1','1','co_deletemessage');
   deletepop.focus();
}

function joinWeightLossClub(){
	joinkpop = open_popup('talk_k_stats.aspx','525','400','1','1','joinkpop');
	joinkpop.focus();
}
  