/***********************************************
* Amazon style Drop-in content box- Â© Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
* Go to http://www.dynamicdrive.com/ for full source code
***********************************************/

var dropboxleft=1 //set left position of box (in %)\par
var dropboxtop=0 //set top position of box (in px)\par
var dropspeed=30 //set speed of drop animation (larger=faster)\par


//var displaymode="always"
var displaymode="oncepersession"

if (parseInt(displaymode)!=NaN)
var random_num=Math.floor(Math.random()*displaymode)
var ie=document.all
var dom=document.getElementById
var myWidth = 0, myHeight = 0;

function GetScreenSize() {
    myWidth = 640;
    myHeight = 480;

/*if (parseInt(navigator.appVersion)>3) {
 myWidth = screen.width;
 myHeight = screen.height;
}
else if (navigator.appName == "Netscape" 
    && parseInt(navigator.appVersion)==3
    && navigator.javaEnabled()
   ) 
{
 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize = jToolkit.getScreenSize();
 myWidth = jScreenSize.width;
 myHeight = jScreenSize.height;
}
else*/ 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;
  }
//  window.alert( 'Width = ' + myWidth );
//  window.alert( 'Height = ' + myHeight );
}



var screenW = 640, screenH = 480;
if (parseInt(navigator.appVersion)>3) {
 screenW = screen.width;
 screenH = screen.height;
}
else if (navigator.appName == "Netscape" 
    && parseInt(navigator.appVersion)==3
    && navigator.javaEnabled()
   ) 
{
 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize = jToolkit.getScreenSize();
 screenW = jScreenSize.width;
 screenH = jScreenSize.height;
}



function InitLiveChatBox(){
if (!dom&&!ie)
return
GetScreenSize();
crossboxcover=(dom)?document.getElementById("dropinboxv2cover") : document.all.dropinboxv2cover
crossbox=(dom)?document.getElementById("dropinboxv2"): document.all.dropinboxv2
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossbox.height=crossbox.offsetHeight
crossboxcover.style.height=parseInt(crossbox.height)+"px"
crossbox.style.top=parseInt(crossbox.height-200)+"px"
crossboxcover.style.left=parseInt(myWidth-200) +"px"
crossboxcover.style.top=dropboxtop+"px"
//crossboxcover.style.visibility=(dom||ie)? "visible" : "show"
//DropChatBoxStart=setInterval("DropinvChatBox()",10)

// show the message box only once per session
MsgBoxcover=(dom)?document.getElementById("ShowMsgBoxcover") : document.all.ShowMsgBoxcover
if ( get_cookie("DismissMsgBox")=="" ){
	
	//document.cookie="DismissMsgBox=yes"
	// show the message box after 20 seconds on he page
//	PopMsgstart=setInterval("PopupMsgBox()",60000)
}

}

function DropinvChatBox(){
//scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
scroll_top=0
if (parseInt(crossbox.style.top)<-10){
crossboxcover.style.top=scroll_top+dropboxtop+"px"
crossbox.style.top=parseInt(crossbox.style.top)+dropspeed+"px"
}
else{
clearInterval(DropChatBoxStart)
crossbox.style.top=-10

}
}

function PopupMsgBox(){
	clearInterval(PopMsgstart)
	MsgBoxcover.style.visibility="Visible"
}

function DismissboxChatBox(){
if (window.dropstart) clearInterval(dropstart)
crossboxcover.style.visibility="hidden"
document.cookie="droppedinv2=yes"
}


function DismissMsgBox(){

// do not show the msg box again in this page
if (window.PopMsgstart) clearInterval(PopMsgstart)
MsgBoxcover.style.visibility="hidden"
document.cookie="DismissMsgBox=yes"

}


function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

if (displaymode=="oncepersession" && get_cookie("droppedinv2")=="" || displaymode=="always" || parseInt(displaymode)!=NaN && random_num==0){
if (window.addEventListener)
window.addEventListener("load", InitLiveChatBox, false)
else if (window.attachEvent)
window.attachEvent("onload", InitLiveChatBox)
else if (document.getElementById || document.all)
window.onload=InitLiveChatBox
/* // we set cookies when they close the window
if (displaymode=="oncepersession")
document.cookie="droppedinv2=yes"*/
}




/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
/*
var delay = 3000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: normal 14px Arial; padding: 5px;">'; //set opening tag, such as font declarations

//fcontent[0]='<embed src="http://twitter.com/flash/twitter_badge.swf"  flashvars="color1=3381504&type=user&id=31128440"  quality="high" width="176" height="176" name="twitter_badge" align="middle" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /><br><a  rel="nofollow"  id="_TwitterBtn" href="http://twitter.com/brides2b" target="_blank"  style="font-size: 10px; color: #339900; text-decoration: none" title="Go to Twitter">follow brides2b at http://twitter.com</a>';
fcontent[0]='<a  rel="nofollow"  id="_TwitterBtn" href="http://twitter.com/brides2b" target="_blank"  style="font-size: 10px; color: #339900; text-decoration: none" title="Go to Twitter"><img alt="See us on Twitter" title="Twitter Logo" src="/collection/images/twitter-main.jpg" ></a>';
fcontent[0]=fcontent[0] + '<a style="font-size: 10px; color: #339900; text-decoration: none; no-margin;text-align: center "  href="javascript:DropInSecondBoxToFullView();"  title="Close">Click Here To View/Hide!</a>';
fcontent[0]=fcontent[0] + '<a style="font-size: 10px; color: #339900; text-decoration: none; no-margin;text-align: right "  href="javascript:dismissdropinSecondBox();"  title="Close">Close [x]</a>';


//fcontent[0]="<b>What\'s new?</b><br>New scripts added to the Scroller category!<br><br>The MoreZone has been updated. <a href='../morezone/index.htm'>Click here to visit</a>";
fcontent[1]="<a  href='http://www.romanticgowns.com/collection/usweekly.asp' title='US Weekly'><img src='/collection/images/UsWeekly-twitter.jpg' alt='US Weekly' title='US Weekly' width='176' height='176' class='image-link' /></a>";
fcontent[1]=fcontent[1] + '<a style="font-size: 10px; color: #339900; text-decoration: none; no-margin;text-align: center "  href="javascript:DropInSecondBoxToFullView();"  title="Close">Click Here To View/Hide!</a>';
fcontent[1]=fcontent[1] + "<a style='font-size: 10px; color: #339900; text-decoration: none; no-margin;text-align: right '  href='javascript:dismissdropinSecondBox();'  title='Close'>Close [x]</a>"
fcontent[2]="<a  href='http://wedding101.bridalonlinestore.com' target='_blank'   title='Wedding 101'><img src='/collection/images/wedding101.jpg' alt='Wedding 101' title='Learn Everything you need to know' width='176' height='176' class='image-link' /></a>";
fcontent[2]=fcontent[2] + '<a style="font-size: 10px; color: #339900; text-decoration: none; no-margin;text-align: center "  href="javascript:DropInSecondBoxToFullView();"  title="Close">Click Here To View/Hide!</a>';
fcontent[2]=fcontent[2] + "<a style='font-size: 10px; color: #339900; text-decoration: none; no-margin;text-align: right '  href='javascript:dismissdropinSecondBox();'  title='Close'>Close [x]</a>"
closetag='</div>';

var fwidth='150px'; //set scroller width
var fheight='150px'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;


//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=0
  if (DOM2){
    document.getElementById("dropinSecondBox").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("dropinSecondBox").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.dropinSecondBox.innerHTML=begintag+fcontent[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("dropinSecondBox").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

var fadecounter;
function colorfade(step) {
  if(step<=maxsteps) {	
    document.getElementById("dropinSecondBox").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("dropinSecondBox").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);
	
  }   
}

function getstepcolor(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}


 // change content for the 2nd drop down
if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
*/



