document.write('<DIV CLASS="doff" ALIGN="center" ID="message2" STYLE="top: 0px; left: 0px; z-index: 5000;"><div id="divheight" class="hnew"><img src="/gifs-new/zero.gif" height="1" width="1"><br></div><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%" ID="tableheight"> <TR> <TD ALIGN="CENTER"><DIV CLASS="main4" ALIGN="CENTER"> <FORM METHOD="post" STYLE="margin:0px;" ACTION="/rakhi.php?action=add_update_product"> <DIV CLASS="up-heada-1" ALIGN="CENTER"><A HREF="javascript:blowup_off()"><IMG SRC="/gifs-new/close.gif" ALIGN="RIGHT" WIDTH="21" HEIGHT="18" BORDER="0"></A><B ID="prname"></B></DIV> <DIV CLASS="main-tab" ALIGN="LEFT"><IMG SRC="/gifs-new/zero.gif" WIDTH="1" HEIGHT="10"><BR> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ALIGN="CENTER"> <TR> <TD VALIGN="TOP"><IMG SRC="/gifs-new/zero.gif" WIDTH="10" HEIGHT="1"></TD> <TD VALIGN="TOP"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="418"> <TR> <TD><IMG SRC="/gifs-new/left-corner-top.gif" WIDTH="9" HEIGHT="8"></TD> <TD BACKGROUND="/gifs-new/top-center.gif" WIDTH="100%"></TD> <TD><IMG SRC="/gifs-new/top-right.gif" WIDTH="9" HEIGHT="8"></TD> </TR> <TR> <TD BACKGROUND="/gifs-new/center-left.gif"></TD> <TD WIDTH="400" HEIGHT="400" ALIGN="CENTER"> <DIV ID="loadimg" STYLE="font-family: arial; font-size: 15px;" CLASS="doon"><IMG SRC="/gifs-new/indicator-new.gif"><BR> <BR> Loading...</DIV> <DIV ID="imagediv" CLASS="doff" ALIGN="CENTER"></DIV></TD> <TD BACKGROUND="/gifs-new/center-right.gif"></TD> </TR> <TR> <TD><IMG SRC="/gifs-new/bottom-left.gif" WIDTH="9" HEIGHT="8"></TD> <TD BACKGROUND="/gifs-new/bottom-center.gif"></TD> <TD><IMG SRC="/gifs-new/bottom-right.gif" WIDTH="9" HEIGHT="8"></TD> </TR> </TABLE><BR> </TD> <TD VALIGN="TOP"><IMG SRC="/gifs-new/zero.gif" WIDTH="10" HEIGHT="1"></TD> <TD VALIGN="TOP" WIDTH="100%"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR> <TD><IMG SRC="/gifs-new/s-left.gif" WIDTH="9" HEIGHT="8"></TD> <TD BACKGROUND="/gifs-new/s-top-center.gif"></TD> <TD><IMG SRC="/gifs-new/s-top-right.gif" WIDTH="9" HEIGHT="8"></TD> </TR> <TR> <TD BACKGROUND="/gifs-new/s-center-left.gif"></TD> <TD WIDTH="100%"> <SPAN ID="size"></SPAN> <SPAN ID="weight"></SPAN> <DIV CLASS="txt-n22"><SPAN ID="price"></SPAN> <INPUT ALT=" Buy Now " SRC="/gifs-new/buy.gif" TYPE="image" VSPACE="2" BORDER="0" ALIGN="ABSMIDDLE" HSPACE="7"></DIV></TD> <TD BACKGROUND="/gifs-new/s-center-right.gif"></TD> </TR> <TR> <TD><IMG SRC="/gifs-new/s-bottom-left.gif" WIDTH="9" HEIGHT="8"></TD> <TD BACKGROUND="/gifs-new/s-bott-center.gif"></TD> <TD><IMG SRC="/gifs-new/s-botom-right.gif" WIDTH="9" HEIGHT="8"></TD> </TR> </TABLE><IMG SRC="/gifs-new/zero.gif" WIDTH="1" HEIGHT="8"><BR> <DIV CLASS="txt-n1" id="note1"></DIV> <DIV CLASS="txt-n1" id="note2"></DIV> <DIV CLASS="txt-n1" id="note3"></DIV> <DIV CLASS="txt" ALIGN="JUSTIFY" ID="desc"></DIV> <DIV><INPUT ALT=" Buy Now " SRC="/gifs-new/buy.gif" BORDER="0" TYPE="image" WIDTH="105" HEIGHT="26"></DIV> </TD> <TD VALIGN="TOP"><IMG SRC="/gifs-new/zero.gif" WIDTH="10" HEIGHT="1"></TD> </TR> </TABLE> <DIV CLASS="bgc" ALIGN="center"> <TABLE WIDTH="65%" ALIGN="CENTER" BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR> <TD WIDTH="27%" ALIGN="CENTER"> <DIV CLASS="next" ID="pre"></DIV></TD> <TD ALIGN="CENTER" WIDTH="50%"> <DIV ALIGN="CENTER" CLASS="viwe" ID="view"></DIV></TD> <TD WIDTH="23%" ALIGN="CENTER"> <DIV ID="next" CLASS="next"></DIV></TD> </TR> </TABLE> </DIV> </DIV><INPUT TYPE="hidden" NAME="products_id" ID="popup_proid" VALUE=""><INPUT TYPE="hidden" NAME="cart_quantity" VALUE="1"></FORM></DIV></TD> </TR> </TABLE> </DIV>');



var myWidth = 0, myHeight = 0;


function bhw() 
{

if( typeof( window.innerWidth ) == 'number' ) {
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
   myWidth = document.body.clientWidth;
   myHeight = document.body.clientHeight;
  }
var h = window.pageYOffset ||
document.body.scrollTop ||
document.documentElement.scrollTop;
var browserName=navigator.appName; 

var imagedivheight=myHeight-93;
var test = myWidth*24/100;
var divwidth = myWidth-test;
var widthformizilla = myWidth-538;
var mozillawidth = widthformizilla-divwidth;
var iewidth = myWidth-516;

var mozillawidth1 = mozillawidth/2;
var iewidth1 = iewidth/2;

var mtop = h+7;
var aboveheight = myHeight-584;
var aboveheight1 = aboveheight/2+h;

var tablew = myWidth-22;

var intElemScrollHeight = document.body.clientHeight;
var newh = intElemScrollHeight;

document.getElementById('message2').style.width="100%";
document.getElementById('message2').style.height=newh+'px';
document.getElementById('tableheight').style.width=tablew+'px';
document.getElementById('divheight').style.height=h+'px';

document.getElementById('tableheight').style.marginTop='0px';
document.getElementById('tableheight').style.height=myHeight+'px';

}




function blowup_show()
{
document.getElementById('message2').className="blowupshow";
bhw();
}




function urldecode (str) {

    var hash_map = {}, ret = str.toString(), unicodeStr='', hexEscStr='';
    
    var replacer = function (search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };
    
    // The hash_map is identical to the one in urlencode.
    hash_map["'"]   = '%27';
    hash_map['(']   = '%28';
    hash_map[')']   = '%29';
    hash_map['*']   = '%2A';
    hash_map['~']   = '%7E';
    hash_map['!']   = '%21';
    hash_map['%20'] = '+';
    hash_map['\u00DC'] = '%DC';
    hash_map['\u00FC'] = '%FC';
    hash_map['\u00C4'] = '%D4';
    hash_map['\u00E4'] = '%E4';
    hash_map['\u00D6'] = '%D6';
    hash_map['\u00F6'] = '%F6';
    hash_map['\u00DF'] = '%DF';
    hash_map['\u20AC'] = '%80';
    hash_map['\u0081'] = '%81';
    hash_map['\u201A'] = '%82';
    hash_map['\u0192'] = '%83';
    hash_map['\u201E'] = '%84';
    hash_map['\u2026'] = '%85';
    hash_map['\u2020'] = '%86';
    hash_map['\u2021'] = '%87';
    hash_map['\u02C6'] = '%88';
    hash_map['\u2030'] = '%89';
    hash_map['\u0160'] = '%8A';
    hash_map['\u2039'] = '%8B';
    hash_map['\u0152'] = '%8C';
    hash_map['\u008D'] = '%8D';
    hash_map['\u017D'] = '%8E';
    hash_map['\u008F'] = '%8F';
    hash_map['\u0090'] = '%90';
    hash_map['\u2018'] = '%91';
    hash_map['\u2019'] = '%92';
    hash_map['\u201C'] = '%93';
    hash_map['\u201D'] = '%94';
    hash_map['\u2022'] = '%95';
    hash_map['\u2013'] = '%96';
    hash_map['\u2014'] = '%97';
    hash_map['\u02DC'] = '%98';
    hash_map['\u2122'] = '%99';
    hash_map['\u0161'] = '%9A';
    hash_map['\u203A'] = '%9B';
    hash_map['\u0153'] = '%9C';
    hash_map['\u009D'] = '%9D';
    hash_map['\u017E'] = '%9E';
    hash_map['\u0178'] = '%9F';
    hash_map['\u00C6'] = '%C3%86';
    hash_map['\u00D8'] = '%C3%98';
    hash_map['\u00C5'] = '%C3%85';
 
    for (unicodeStr in hash_map) {
        hexEscStr = hash_map[unicodeStr]; // Switch order when decoding
        ret = replacer(hexEscStr, unicodeStr, ret); // Custom replace. No regexing
    }
    
    // End with decodeURIComponent, which most resembles PHP's encoding functions
    ret = decodeURIComponent(ret);
 
    return ret;
}


function blowup_off()
{
document.getElementById('message2').className="doff";
}


var path = '';
var imgid = "0";
var queryrfq = '';
function imageset(id)
{

// 	if(id == dataref.length)
// 	{
// 		document.getElementById('next').style.display='none';
// 		document.getElementById('pre').style.display='block';
// 	}
// 
// 
// 
// 	
// 	else if(id == 1)
// 	{
// 		document.getElementById('pre').style.display='none';
// 		document.getElementById('next').style.display='block';
// 	}
// 	else
// 	{
// 		document.getElementById('pre').style.display='block';
// 		document.getElementById('next').style.display='block';
// 	}
// 	
// // 	set_big_img_path(id);
// //alert(queryrfq);	
	imgid = id;

	var pic = document.getElementById(imgid);
	productName =pic.alt;
	productName = unescape(productName);
	if(productName.length > 40)
        {
		var c = productName.substring(0,40);
		c = c + "...";
		productName = c;
        }



var mysize='size'+id;
var myweight='weight'+id;
var myprice='price'+id;
var mybigdesc='bigdesc'+id;
var myimagebig='imagebig'+id;


var mydelivery_note1='delivery_note1_'+id;
var mydelivery_note2='delivery_note2_'+id;
var mydelivery_note3='delivery_note3_'+id;


var hisize = document.getElementById(mysize).value;
var hiweight = document.getElementById(myweight).value;
var hiprice = document.getElementById(myprice).value;
var hibigdesc = document.getElementById(mybigdesc).value;
var hiimagebig = document.getElementById(myimagebig).value;


var hidelivery_note1 = document.getElementById(mydelivery_note1).value;
var hidelivery_note2 = document.getElementById(mydelivery_note2).value;
var hidelivery_note3 = document.getElementById(mydelivery_note3).value;



var path=hiimagebig;
document.getElementById('imagediv').innerHTML='<img src="'+path+'" onload="loadimg()" id="bigimg">'; 
// document.getElementById('qry').href=queryrfq;
document.getElementById('prname').innerHTML=productName;


document.getElementById('desc').innerHTML=urldecode(hibigdesc);

if(hisize)
{
	document.getElementById('size').innerHTML='<DIV CLASS="txt-n"><B>Size</B> : '+hisize+'</DIV>';
}
if(hiweight)
{
	document.getElementById('weight').innerHTML='<DIV CLASS="txt-n"><B>Weight</B> : '+hiweight+'</DIV>';
}
document.getElementById('price').innerHTML='<B>Price</B> : '+hiprice;


if(hidelivery_note1)
{
	document.getElementById('note1').innerHTML='&#149; '+hidelivery_note1;
}
if(hidelivery_note2)
{
	document.getElementById('note2').innerHTML='&#149; '+hidelivery_note2;
}
if(hidelivery_note3)
{
	document.getElementById('note3').innerHTML='&#149; '+hidelivery_note3;
}

document.getElementById('popup_proid').value=id;

var allid = document.getElementById('allproducts_id').value;

var idarray = allid.split(",");
var array_length = idarray.length;
var k = '';
for (var i=0; i < array_length; i++) 
{
	if (idarray[i] == id)
	{
		k = i;
	}
}
if(k < array_length-1)
{
var l = k+1;
var h = idarray[l];
document.getElementById('next').innerHTML='<A HREF="javascript:imageset('+h+'); blowup_show()" TITLE="Use -> arrow key to view next product"><U>Next</U> <IMG SRC="/gifs-new/next-icon.gif" ALIGN="ABSMIDDLE" WIDTH="31" HEIGHT="31"></A>';
}
else
{
document.getElementById('next').innerHTML='';
}

if(k > 0)
{
var l = k-1;
var h = idarray[l];
document.getElementById('pre').innerHTML='<A HREF="javascript:imageset('+h+'); blowup_show()" TITLE="Use <- arrow key to view previous product"><IMG SRC="/gifs-new/previous-icon.gif" ALIGN="ABSMIDDLE" WIDTH="31" HEIGHT="31"> <U>Previous</U></A>';
}
else
{
document.getElementById('pre').innerHTML='';
}


var cur_pro = k+1;
document.getElementById('view').innerHTML='You are Viewing <B>'+cur_pro+'</B> of <B>'+array_length+' Products</B>';


}

function nextimg()
{
	if(imgid < dataref.length)
	{
	imgid++;
	}

	if(imgid < dataref.length)
	{
		var newImg = imgid;
		document.getElementById('next').style.display='block';
		document.getElementById('pre').style.display='block';	
	}
	else
	{
		var newImg = imgid;
		document.getElementById('next').style.display='none';
		document.getElementById('pre').style.display='block';
	}
	
	set_big_img_path(newImg);
	

	
	if (document.getElementById(newImg))
	{
		var pic = document.getElementById(newImg);
		productName =pic.alt;
		productName = unescape(productName);
		if(productName.length > 40)
        	{
			var c = productName.substring(0,40);
			c = c + "...";
			productName = c;
        	}


document.getElementById('imagediv').innerHTML='<img src="'+path+'" onload="loadimg()">'; 
document.getElementById('qry').href=queryrfq;
document.getElementById('prname').innerHTML=productName;
	}
	else
	{
		var newImg = --imgid;
	}



}

function previousimg()
{
if (imgid  > 1)
{
imgid--;
}


	if (imgid <= 1)
	{
		var newImg = imgid;
		document.getElementById('pre').style.display='none';
		document.getElementById('next').style.display='block';
	}
	else
	{
		var newImg = imgid;
		document.getElementById('pre').style.display='block';
		document.getElementById('next').style.display='block';	
	}
	
	set_big_img_path(newImg);
	

	
	var pic = document.getElementById(newImg);
	productName = pic.alt;
	productName = unescape(productName);
	if(productName.length > 40)
        {
		var c = productName.substring(0,40);
		c = c + "...";
		productName = c;
        }
	document.getElementById('imagediv').innerHTML='<img src="'+path+'" onload="loadimg()">';
	document.getElementById('qry').href=queryrfq;
	document.getElementById('prname').innerHTML=productName;
}


function set_big_img_path(imgid)
{
	document.getElementById('loadimg').className="don";
	document.getElementById('imagediv').className="doff";

	var k = dataref.length-1;
	if(k >= 0)
	{
		var i = imgid-1;
		path = eval("dataref["+i+"].img_path");

		queryrfq = eval("dataref["+i+"].queryrfq");
	}
}


function keyDown(e)
{var n = (window.Event) ? e.which : e.keyCode;

if(n==9 && document.getElementById('message2').className=="don")
	{
return false;
	}


else if(n==32 && document.getElementById('message2').className=="don")
	{
return false;
	}


else if(n==27 && document.getElementById('message2').className=="don")
	{
blowup_off();
	}

if((n==37 && document.getElementById('message2').className=="don") || (n==38 && document.getElementById('message2').className=="don"))
	{


if (imgid == 1)
{
return false;
}

previousimg();
}

else if((n==39 && document.getElementById('message2').className=="don") || (n==40 && document.getElementById('message2').className=="don"))
	{
if (imgid == dataref.length)
{
return false;
}
nextimg();
return false;
	}
}


function loadimg()
{
document.getElementById('loadimg').className="doff";
document.getElementById('imagediv').className="don";

}





