/**
 *  File     : slidecallout.js
 *  Author(s)    : Naveen Kumar
 *  Creation Date: Oct 20, 2009
 *  Functionality: This file contains user releated functions.
 *  Dependencies : N/A
 *  Copyright    : P&G
 *  Modifications: <Author> <Date> <Description of Modification>
 */
var Hide = "";
var Ht = 225;
/* Set max expandable length  */
var Lt = 58;
/* Set min expandable length  */
var varHt = Lt;
var status = "close";
var Speed = 9; // speed 
var x = 0;  // please don't change
var y = 10;  //  default time
var z = 10;
var foo = new Array();
function setup() {
	x = 0;
	foo = document.getElementsByTagName("div");
	for (i = 0; i < foo.length; i = i + 1) {
		if (foo[i].className == "hidden") {
			Hide = foo[i].id;
		}
	}
	(document.getElementById(Hide)).style.width = Lt + "px";
}
if (Speed == 1) {
	y = 100;
	z = 1;
}
if (Speed == 2) {
	y = 70;
	z = 1;
}
if (Speed == 3) {
	y = 40;
	z = 1;
}
if (Speed == 4) {
	y = 20;
	z = 1;
}
if (Speed == 5) {
	y = 10;
	z = 1;
}
if (Speed == 6) {
	y = 10;
	z = 2;
}
if (Speed == 7) {
	y = 10;
	z = 4;
}
if (Speed == 8) {
	y = 10;
	z = 7;
}
if (Speed == 9) {
	y = 10;
	z = 10;
}
function toggle() {
	if (x === 0) {
		(document.getElementById(Hide)).style.width = varHt + "px";
		if (((Ht - varHt) < z) && (varHt !== Ht)) {
			varHt = Ht;
		} else {
			varHt = varHt + z;
		}
		if (varHt <= Ht) {
			setTimeout("toggle()", y);
		}
		if (varHt > Ht) {
			varHt = Ht;
			x = 1;
			(document.getElementById("form")).style.display = "block";
			imagePath = "data_root/en_US/breeders/images/common/expandablecallout/BTN-CALLOUT-CLOSE.png";
			(document.getElementById("ExpendBtn")).getElementsByTagName("img")[0].src = imagePath;
			status = "open";
		}
	} else {
		(document.getElementById(Hide)).style.width = varHt + "px";
		varHt = varHt - z;
		if ((varHt) >= Lt) {
			setTimeout("toggle()", y);
		}
		if ((varHt) < Lt) {
			varHt = Lt;
			(document.getElementById(Hide)).style.width = varHt + "px";
			(document.getElementById("form")).style.display = "none";
			imagePath = "data_root/en_US/breeders/images/common/expandablecallout/BTN-CALLOUT-OPEN.png";
			(document.getElementById("ExpendBtn")).getElementsByTagName("img")[0].src = imagePath;
			x = 0;
			status = "close";
		}
	}
}

// chnage image on mouse over
function changeImgOnOver() {
	var width = (document.getElementById(Hide)).style.width;
	if (status == "close") {
		imagePath = "data_root/en_US/breeders/images/common/expandablecallout/BTN-CALLOUT-OPEN-over.png";
		(document.getElementById("ExpendBtn")).getElementsByTagName("img")[0].src = imagePath;
	} else {
		imagePath = "data_root/en_US/breeders/images/common/expandablecallout/BTN-CALLOUT-CLOSE-over.png";
		(document.getElementById("ExpendBtn")).getElementsByTagName("img")[0].src = imagePath;
	}
}
// chnage image on mouse out
function changeImgOnOut() {
	var width = (document.getElementById(Hide)).style.width;
	if (status == "close") {
		imagePath = "data_root/en_US/breeders/images/common/expandablecallout/BTN-CALLOUT-OPEN.png";
		(document.getElementById("ExpendBtn")).getElementsByTagName("img")[0].src = imagePath;
	} else {
		imagePath = "data_root/en_US/breeders/images/common/expandablecallout/BTN-CALLOUT-CLOSE.png";
		(document.getElementById("ExpendBtn")).getElementsByTagName("img")[0].src = imagePath;
	}
}


