var h 	= 	200;
var w 	= 	250;
var eH 	= 	320;
var eW 	=	600;
var sH	= 	248;
var eSH	=	320;
var RemoteProductID;
function relatedProductPreview(proId,url)
{
RemoteProductID = proId;
document.getElementById('frm_RelatedProSlideShow').style.display = 'none';
modelBox('RelatedPreviewBg',url);
scroll(0,0);
document.body.scroll="no";
}
function modelBox(id,url)
{
var divBG = document.getElementById(id).style;
var divSlideShow 	= document.getElementById('RelatedProShow').style;

	var browser = navigator.userAgent;
		if(browser.indexOf("MSIE") != -1)
		{
		divSlideShow.top = "30%"
		divSlideShow.left = "40%"
		}
		else if(browser.indexOf("Safari") != -1)
		{
		divSlideShow.top = "250%"; 
		divSlideShow.left = "400%"; 
		}
		else if(browser.indexOf("Firefox") != -1)
		{
		divSlideShow.top = "25%"; 
		divSlideShow.left = "30%"; 
		}
		else{
		divSlideShow.top = "25%"; 
		divSlideShow.left = "25%"; 
		}


/*divSlideShow.top 	= "30%";
divSlideShow.left 	= "45%";*/

divSlideShow.height = "200";
divSlideShow.width	= "250";
divBG.display = 'block';

setTimeout("showContainer('RelatedProShow','"+url+"')",500);
}
function showContainer(id,url)
{
var divContainer 		= 	document.getElementById(id).style;
divContainer.display 	= 	'block';

setTimeout("changeHeightElem('"+ id +"','"+ url +"')", 500);
}
function changeHeightElem(id,url)
{

var elem = document.getElementById(id).style;
if(h < eH)
{
h +=30;
elem.height = h + "px";
setTimeout("changeHeightElem('"+ id +"','"+ url +"')", 10);
changeTopPosElem(id);
}
else
{
h = 200;
setTimeout("changeWidthElem('"+ id+ "','"+ url +"')" , 400);
}
}
function changeWidthElem(id,url)
{
var elem = document.getElementById(id).style;
if(w < eW)
{
w +=20;
elem.width = w + "px";
setTimeout("changeWidthElem('"+ id +"','"+ url +"' )", 10);
changeLeftPosElem(id);
}
else
{
w = 250;
var frm = document.getElementById('frm_RelatedProSlideShow');
frm.style.display = 'block';
frm.src = "http://"+window.location.host+"/Enquiries.htm?product_id="+RemoteProductID+"&name="+url;
setTimeout("showSlider('frm_RelatedProSlideShow')", 800);
}
}
function changeLeftPosElem(id)
{
var elem = document.getElementById(id).style;
elem.posLeft = elem.posLeft - 1;
}
function changeTopPosElem(id)
{
var elem = document.getElementById(id).style;
elem.posTop = elem.posTop - 1;
}
function showSlider(id)
{
if(sH < eSH)
{
var elem = document.getElementById(id);
setTimeout("showSlider('"+ id +"' )", 10);
sH+=2;
elem.height = sH;
}
else
{
sH = 248;
}
}


function CloseRelatedPreview()
{
document.body.scroll="yes";
document.getElementById('RelatedProShow').style.display = "none";
document.getElementById('RelatedPreviewBg').style.display = "none";
}






function buttonClick(id,name)
{
	relatedProductPreview(id,name)
}


function Redirection()
			{
			var url="http://"+window.location.host+"/Redirect.htm";
		
					var req = null;
					try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
						 try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {
							try { req = new XMLHttpRequest(); } catch(e) {}
				 }
					}
						if (req == null) throw new Error('XMLHttpRequest not supported');
							    
								req.open("GET", url, false);
								req.send(null);
								top.location.href=req.responseText;
						
					}