function handleErr(msg,url,l)
{
txt="There was an error on this page.\n\n"
txt+="Error: " + msg + "\n"
txt+="URL: " + url + "\n"
txt+="Line: " + l + "\n\n"
txt+="Click OK to continue.\n\n"
alert(txt)

return true

}



//onerror=handleErr

var currentHref = "";

if (window == top) 
  currentHref = top.location.href.toLowerCase();
else
  currentHref = location.href.toLowerCase();
	
if (currentHref.indexOf("thenestbaby") != -1) 
  cbrdtype = "NB";
else if (currentHref.indexOf("thenest") != -1) 
  cbrdtype = "N";
else if (currentHref.indexOf("travel") != -1) 
  cbrdtype = "TR";
else if (currentHref.indexOf("chineseweddings") != -1) 
  cbrdtype = "CW";
else if (currentHref.indexOf("beachweddings") != -1) 
  cbrdtype = "BW";
else
  cbrdtype = "K";
  


function openTVframe(url){
    if (top.location.href.toLowerCase().indexOf("gis_frame") != -1)
      window.parent.location = "/boards/main_frame.aspx?page="+url;
    if ((top.location.href.toLowerCase().indexOf("wdb") != -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 = (window.parent.location.href.toLowerCase().indexOf("gis") != -1)? "gis" : "default";
      currentFrame = (window.parent.location.href.toLowerCase().indexOf("brandframe") != -1)? "brandframe" : currentFrame;
    }
        
    if (thisselect.selectedIndex > 0) {

		var url = thisselect.options[thisselect.selectedIndex].value;
		    
        if (url != ''){
        
            if( (url.indexOf("Nest",0) != -1) || (url.indexOf("nest",0) != -1) || (url.indexOf("redirect",0) != -1) )
            {
                window.parent.location = url;
            }
            else if ( url.indexOf("ForumID",0) != -1 ){
                FrameType = (url.indexOf("ForumID=238") != -1) ? "gis" : "default";
                if (currentFrame == FrameType){
                    window.location = url;
                }
                else if (cbrdtype=="N"){
                    window.parent.location = url;
                }
                else if (cbrdtype=="NB"){
                    window.parent.location = url;
                }
                else {
                    window.parent.location = (FrameType == "gis") ? "/Boards/gis_frame.aspx" : (FrameType =="brandframe") ? "/boards/brandframe.aspx" :"/boards/main_frame.aspx?page="+url;
                }
            }
            else {
                window.open(url);
            }

        }//if (url != ''){
        
    } //if (thisselect.selectedIndex > 0) {

}



var imgpathForums;

 


function InitPreload() {

  
if (document.domain == "thenestbaby.com") 
  cbrdtype = "NB";


switch (cbrdtype){
 case "NB":
    imgpathForums = "http://images.thenestbaby.com/boards/"
		break;

  case "N":
    imgpathForums = "http://images.thenest.com/boards/"
		break;
	
	case "TR":
	  imgpathForums = "http://images.travel-romance.com/boards/"
    break;
    
	case "CW":
	  imgpathForums = "http://images.theknot.com/chineseweddings/boards/"
    break;

  case "K":
		imgpathForums = "http://images.theknot.com/boards/"

  	case "BW":
		imgpathForums = "http://images.theknot.com/BoardsNiche"

  default:
		imgpathForums = "http://images.theknot.com/BoardsNiche"

}

	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(){ 
  url = "/boards/Msgs/popups.aspx?MessageID=";
  url += (cbrdtype == 'N') ? 96 : 91;
  delaypop = open_popup(url,'375','275','1','1','co_joinmessage');
}

function activePopup(){ 
  url = "/boards/Msgs/popups.aspx?MessageID=";
  url += (cbrdtype == 'N') ? 97 : 92;
    activepop = open_popup(url,'375','275','1','1','co_joinmessage_3');
}

function joinCommunity(){ 
switch (cbrdtype){
  case "NB":
    url = "http://community.thenestbaby.com/cs/ks/user/profile.aspx"
		break;

  case "N":
    url = "http://community.thenest.com/cs/ks/user/profile.aspx"
		break;
	
	case "TR":
	  url = "http://community.theknot.com/cs/ks/user/profile.aspx?cobrand=TR"
    break;
    
	case "CW":
	  url = "http://community.theknot.com/cs/ks/user/profile.aspx?cobrand=CW"
    break;

	case "BW":
	  url = "http://community.theknot.com/cs/ks/user/profile.aspx?cobrand=BW"
    break;

  default:
		url = "http://community.theknot.com/cs/ks/user/profile.aspx"
}

   joinpop = open_popup(url,'990','700','1','1','join');
   if (joinpop != undefined)
      joinpop.focus();
}

function bannedPopup(){ 
  url = "/boards/Msgs/popups.aspx?MessageID=";
  url += (cbrdtype == 'N') ? 99 : 94;
    bannedpop = open_popup(url,'375','275','1','1','co_mbbanned');
    if (bannedpop != undefined)
       bannedpop.focus();
}
   
function memproffPopup(){ 
  url = "/boards/Msgs/popups.aspx?MessageID=";
  url += (cbrdtype == 'N') ? 98 : 93;
    memprofpop = open_popup(url,'375','275','1','1','co_memproff');
    if (memprofpop != undefined)
       memprofpop.focus();
}

function DeletePopup(){ 
  url = "/boards/Msgs/popups.aspx?MessageID=";
  url += (cbrdtype == 'N') ? 100 : 95;
   deletepop = open_popup(url,'375','275','1','1','co_deletemessage');
   if (deletepop != undefined)
    deletepop.focus();
}

function joinWeightLossClub(){
	joinkpop = open_popup('talk_k_stats.aspx','525','400','1','1','joinkpop');
	if (joinkpop != undefined)
	  joinkpop.focus();
}
  
