// Open Pop-Up Window
function openWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}


// Open Pop-Up Send to friend
    function popitup(url) {
	newwindow=window.open(url,'name','resizable=1,scrollbars=1,height=450,width=550');
	if (window.focus) {newwindow.focus()}
	return false;
}

function size_guide(sPicURL) {
    window.open(sPicURL, "",
    "resizable=1,scrollbars=1,height=650,width=800");
}

function form(sPicURL) {
    return window.open(sPicURL, "", "resizable=1,scrollbars=1,height=500,width=500");
}


function showPic(whichpic,whichurl) {
  if (!document.getElementById("placeholder")) return true;
  var source = whichpic.getAttribute("href");
  var placeholder = document.getElementById("placeholder");
  var placeholderlink = document.getElementById("placeholderlink");
  placeholder.setAttribute("src",source);
  placeholderlink.setAttribute("href",whichurl);
  if (!document.getElementById("description")) return false;
  if (whichpic.getAttribute("title")) {
    var text = whichpic.getAttribute("title");
  } else {
    var text = "";
  }
  var description = document.getElementById("description");
//  if (description.firstChild.nodeType == 3) {
//    description.firstChild.nodeValue = text;
//  }
//  return false;
}


// Bookmarking
function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  	window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

// Read Cookie
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

	
function bookmarkPage(title, url){
	if (document.all)
	window.external.AddFavorite(url, title);
	else if (window.sidebar)
	window.sidebar.addPanel(title, url, "");
}


window.addEvent('domready',function() {

	// tips
	var Tips2 = new Tips($$('.Tips2'), {
		initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
		},
		onShow: function(toolTip) {
		this.fx.start(1);
		},
		onHide: function(toolTip) {
		this.fx.start(0);
		}
	});
    
    var Tips4 = new Tips($$('.Tips4'), {
	    className: 'custom'
    });

});

