var __GetParamArr = new Array();
function parseLocationSearch() {
	var searchStr = location.search;
	if (searchStr == "") {return;}
	
	
	//* let's take out the first "?"
	if (searchStr.substring(0, 1) == "?") {
		searchStr = searchStr.substring(1);
	}
//	alert(searchStr)

	var tempArr = searchStr.split("&");
	for (var i = 0; i < tempArr.length; i++) {
		var pairArr = tempArr[i].split("=");
		//alert(pairArr[0] + " : " + pairArr[1])
		__GetParamArr[pairArr[0]] = pairArr[1];
	}
}

//* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//To Search the whole values inside the argument and save it in array
function parseLocationSearchArg(arg) {
	var searchStr = arg;
	if (searchStr == "") {return;}
	//* let's take out the first "?"
	if (searchStr.substring(0, 1) == "?") {
		searchStr = searchStr.substring(1, searchStr.legnth)
	}
	var tempArr = searchStr.split("&");
	for (var i = 0; i < tempArr.length; i++) {
		var pairArr = tempArr[i].split("=");
		//alert(pairArr[0] + " : " + pairArr[1])
		__GetParamArr[pairArr[0]] = pairArr[1];
	}
}
//* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

function GetParam(arg) {
	var tempVar = __GetParamArr[arg];
	
	if (!tempVar) {tempVar = null;}

	return tempVar;
}

var _animationWin = null;
function showAnimationWindow(fname, ftype) {
	if(_animationWin==null || _animationWin.closed) {
		var tempWidth = 720;//182;
		var tempHeight = 500;//140;
		var tempLeft = (screen.availWidth - tempWidth)/2
		var tempTop = (screen.availHeight - tempHeight)/2
		_animationWin = window.open("movies.html?fname=" + fname + "&ftype=" + ftype, "_animationWin", "resizable=no,statusbar=no,scrollbars=auto,status=no,location=no,directories=no,toolbar=no,menubar=no,width=" + tempWidth + ",height=" + tempHeight + ",top=" + tempTop + ",left=" + tempLeft + "");
	} else {
		_animationWin.location.href = "movies.html?fname=" + fname + "&ftype=" + ftype;
		_animationWin.focus();
	}
}


var _imageWin = null;
var pic; 
var tempWidth, tempHeight , tempLeft , tempTop ;

function showImageWindow(fname, ftype){
	pic = new Image();
	pic.src = "repository/" + fname + "." + ftype;
	Controlla (pic.src);
}
function Controlla(img){
  if((pic.width!=0)&&(pic.height!=0)){
	tempWidth =  pic.width;
	tempHeight = pic.height;
	tempLeft = (screen.availWidth - tempWidth)/2
	tempTop = (screen.availHeight - tempHeight)/2
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(picURL){
	if(_imageWin==null || _imageWin.closed) {
      		var picURL=pic.src
	      	//_imageWin = window.open(picURL,'_imageWin','toolbar=no,width='+pic.width+',height='+pic.height+ ",top=" + tempTop + ",left=" + tempLeft);
	      	_imageWin = window.open("",'_imageWin','toolbar=no,width='+pic.width+',height='+pic.height+ ",top=" + tempTop + ",left=" + tempLeft);
      		_imageWin.document.write('<html><head><title>purva mande . images <\/title><\/head><body topmargin=0, leftmargin=0> <img src="'+picURL+'" border=0><\/body><\/html>')
      		_imageWin.focus();
		_imageWin.resizeBy(pic.width-_imageWin.document.body.clientWidth, pic.height-_imageWin.document.body.clientHeight)
	}
}


var picURL;
function showMImageWindow(fname, ftype, totnum, mapleft, mapright){
	if (typeof(mapleft) == "undefined") mapleft = 200;
	if (typeof(mapright) == "undefined") mapright = 300;

	if (totnum ==1){
		showImageWindow(fname, ftype)
		return;
	}

	pic = new Image();
	pic.src = "repository/" + fname + "-1." + ftype;
	picURL="pprint.html?fname=" +fname+ "&ftype=" + ftype + "&mapleft=" + mapleft + "&mapright=" + mapright + "&totnum=" + totnum ;
	alert(picURL)
	if(_imageWin==null || _imageWin.closed) {
      		if (totnum > 1 ){
			ControllaMulti(pic.src);
      		}		

	}
}
function ControllaMulti(img){
  if((pic.width!=0)&&(pic.height!=0)){
	tempWidth =  pic.width;
	tempHeight = pic.height;
	tempLeft = (screen.availWidth - tempWidth)/2
	tempTop = (screen.availHeight - tempHeight)/2
    viewFotoMulti(img);
  }
  else{
    funzione="ControllaMulti('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFotoMulti(img){//we dont use img

				
	      		_imageWin = window.open(picURL,'_imageWin','toolbar=no,width='+pic.width+',height='+(pic.height+100)+ ",top=" + tempTop + ",left=" + tempLeft);
      			_imageWin.focus();
			//_imageWin.resizeBy(pic.width-_imageWin.document.body.clientWidth, pic.height-_imageWin.document.body.clientHeight)
}





var str_footer = "";
//str_footer += '<font color="#FFFFFF" face="Courier New, Courier, mono" size="2"> <font color="#FFFF33"><a href="index.html" STYLE="TEXT-DECORATION:NONE">home</a></font> ';
//str_footer += '. <a href="illustrations.html" STYLE="TEXT-DECORATION: NONE">illustrations</a> ';
//tr_footer += '. <a href="print.html" STYLE="TEXT-DECORATION: NONE">print design</a> ';
//str_footer += '. <a href="photography.html" STYLE="TEXT-DECORATION: NONE">photography</a> ';
//str_footer += '. <a href="animations.html" STYLE="TEXT-DECORATION: NONE">animations</a> ';
//str_footer += '. <a href="paintings.html" STYLE="TEXT-DECORATION: NONE">paintings </a> </font> ';


