/*
Parameters:
imagename, imagewidth, imageheight, bgcolor,closebuttonfontcolour, window loacation left, window location right,window title,img_description 

imagename		 : imagename
imagewidth		 : width of image
imageheight		 : height of image
bgcolor			 : background color e.g. "white","#11ff33"
closebuttonfontcolour	 : close buttons font colour color e.g. "white","#11ff33"
leftpositionofwindow	 : numeric value (provide '' for no effect)-- window position from left
rightpositionofwindow    	 : numeric value (provide '' for no effect) - window position from top
windowtitle 		 : title of window (provide '' for no title other than imagename)
img_description		 : Description of Image
desc_color		 : Font Color for Description of Image
height_increment		 : increase window height , default value keep 35 if no description is there, else set the value according to description of image

zoomimage(imagename,imagewidth,imageheight,bgcolor,closebuttonfontcolour,leftpositionofwindow,rightpositionofwindow,windowtitle,img_description,desc_color,height_increment) 
*/
function rand(){
	var tem = Math.round(100000000000 - (50000000000 * Math.random(1)));
	return tem;	
}

//function zoomimage(imagename,widthf,heightf,bgcol,closefontcol,t,b,titles,img_description,desc_color,height_increment)
function zoomimage(imagename,titles,img_description)
{
bgcol='#ffffff';			// Background color of page
closefontcol='#0000FF';		// Close font color
desc_color='#990099';		// Description Color
t='5';				// New window location from Left
b='5';				// New window location from Top
widthf=750;			// New window width
heightf=450;			// New window height
height_increment=5;		// Increment of window height

	var tempmit = eval(rand().toString());
	var winstr='';
	if(imagename==''){alert("Please Provide Imagename");return;}
	if (titles!=''){winstr='<title>'+titles+'</title>';}else{winstr='<title>'+imagename+'</title>'}
	if (bgcol!=''){bgcolin=bgcol;}else{bgcolin='white';}
	winstr= winstr+'<body bgcolor='+bgcolin+' topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>';

	// IMAGE
	winstr= winstr+"<br><center><img src="+imagename+" border=1  alt="+img_description+">";
	winstr = winstr+ '<P align=center><b><font face=arial color=#996633 size=2>' +img_description+ '</font></b></P>';
	
	winstr= winstr+ '<p><a href=javascript:window.close();><font color='+closefontcol+' face=Arial size=2><b>Close Window</b></font></a></p>';
	winstr= winstr+ '</center></body>';

//	if (height_increase!="){tempmit = window.open('',eval(rand().toString()),'width='+(widthf+30)+',height='+(heightf+eval(height_increase))+',scrollbars=no,resizable=no');}
//	else{

	winopen = window.open('',eval(rand().toString()),'width='+(widthf+30)+',height='+(heightf+eval(height_increment))+',scrollbars=yes,resizable=no');

//}

	if((t!=='') || (b=='')){
	winopen.moveTo(t,b);
	}
	winopen.document.writeln(winstr);
	
}

