// Popup Windows

var newwindow;

function quiz(url)
{
	newwindow=window.open(url,'name','height=375,width=550');
	if (window.focus) {newwindow.focus()}
}

function popup(loc) {
  winPop = window.open(loc,"popped","height=475,width=575,location=no,menubar=no,personalbar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,left=100,top=25");
  }

function flvFPW1(){//v1.44
// Copyright 2002-2004, Marja Ribbers-de Vroed, FlevOOware (www.flevooware.nl/dreamweaver/)
var v1=arguments,v2=v1[2].split(","),v3=(v1.length>3)?v1[3]:false,v4=(v1.length>4)?parseInt(v1[4]):0,v5=(v1.length>5)?parseInt(v1[5]):0,v6,v7=0,v8,v9,v10,v11,v12,v13,v14,v15,v16;v11=new Array("width,left,"+v4,"height,top,"+v5);for (i=0;i<v11.length;i++){v12=v11[i].split(",");l_iTarget=parseInt(v12[2]);if (l_iTarget>1||v1[2].indexOf("%")>-1){v13=eval("screen."+v12[0]);for (v6=0;v6<v2.length;v6++){v10=v2[v6].split("=");if (v10[0]==v12[0]){v14=parseInt(v10[1]);if (v10[1].indexOf("%")>-1){v14=(v14/100)*v13;v2[v6]=v12[0]+"="+v14;}}if (v10[0]==v12[1]){v16=parseInt(v10[1]);v15=v6;}}if (l_iTarget==2){v7=(v13-v14)/2;v15=v2.length;}else if (l_iTarget==3){v7=v13-v14-v16;}v2[v15]=v12[1]+"="+v7;}}v8=v2.join(",");v9=window.open(v1[0],v1[1],v8);if (v3){v9.focus();}document.MM_returnValue=false;return v9;}
//-->



// Bookmark a page

function addToFavorites()
 {
  if (window.external)
  {
   window.external.AddFavorite(urlAddress,pageName)
  }
  else
  { 
   alert("Sorry! Your browser doesn't support this function.");
  }
 }

      function customImageLinks() {
              if (!document.getElementsByTagName) return;
              var anchors = document.getElementsByTagName('a');
              for (var i=0; i<anchors .length; i++) {
                   anchor = anchors[i];
                      var images = anchor.getElementsByTagName('img');
                      if (images[0] != null) {
                              anchor.className = "image";
                      }
              }
      }
       
      if (window.addEventListener)
              window.addEventListener("load", customImageLinks, false)
      else if (window.attachEvent)
              window.attachEvent("onload", customImageLinks)
      else if (document.getElementById)
              window.onload=customImageLinks
 
 // Email a friend
 
function e_friend()
{
var e_add= prompt('Enter your friend\'s email address:',' ');
var subj= prompt('Enter the subject of your message:',' ');
if ((subj==" ") || (subj==null))
 subj="W. W. Norton and Company: Introduction to Sociology, 6 ed. Website Referral";
u = window.location;
window.location="mailto:"+e_add+"?subject="+subj+"&body=Check out this W. W. Norton and Company: Introduction to Sociology, 6 ed. Website Page: "+u;
}

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 520;
defaultHeight = 420;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="Resource Image" src='+imageURL+' style="display:block"></body></html>');
close();		
}}

// toggle news arrow

function toggleMod(which) {
	var box = 'news_spacer';
	var arrow = 'news_arrow';
	if (document.getElementById(box).style.display == 'none') {
		document.getElementById(box).style.display = 'block'
		document.getElementById(arrow).style.backgroundImage = 'url(img/news_collapse.png)'
	} else {
		document.getElementById(box).style.display = 'none'
		document.getElementById(arrow).style.backgroundImage = 'url(img/news_collapse_f2.png)'
	}
}

function toggleMod2(which) {
	var box = 'news_spacer';
	var arrow = 'news_arrow';
	if (document.getElementById(box).style.display == 'none') {
		document.getElementById(box).style.display = 'block'
		document.getElementById(arrow).style.backgroundImage = 'url(img/news_collapse_f2.png)'
	} else {
		document.getElementById(box).style.display = 'none'
		document.getElementById(arrow).style.backgroundImage = 'url(img/news_collapse.png)'
	}
}

function toggleMod3(which) {
	var box = 'news_spacer';
	var arrow = 'news_arrow';
	if (document.getElementById(box).style.display == 'none') {
		document.getElementById(box).style.display = 'block'
		document.getElementById(arrow).style.backgroundImage = 'url(../../img/news_collapse_f2.png)'
	} else {
		document.getElementById(box).style.display = 'none'
		document.getElementById(arrow).style.backgroundImage = 'url(../../img/news_collapse.png)'
	}
}

function ebook(url)
{
	newwindow=window.open(url,'ebook','height=550,width=740,resizable=1');
	if (window.focus) {newwindow.focus()}
}


function ebookDemo1(theLink){
	ebook('http://www.wwnorton.com/college/anthro/oo_ebook/welcome.asp?'+theLink);
}

function ebookDemo(theLink){
	ebook('http://www.wwnorton.com/college/anthro/oo_ebook_demo/welcome.asp?'+theLink);
}


function popIt(loc) {
  winPop = window.open(loc,"popped","height=480,width=750,location=no,menubar=no,personalbar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,left=100,top=25");
  }
