var url = "http://www.modelsinternational.co.za"
//var url = "http://localhost:85/good kid new media 2007/modelsinc/"

function RemoveBigAddSmallProductResize(val) {
	val = val.replace(url,'')
    val = val.replace("thumbnail.aspx?width=420&filename=","")
    val = "thumbnail.aspx?width=60&filename="+ val
    return val
}

function RemoveSmallAddBigProductResize(val) {
    val = val.replace(url,'')
    val = val.replace("thumbnail.aspx?width=60&filename=","")
    val = "thumbnail.aspx?width=420&filename="+ val
    return val
}

function TargetImage(imageobject) {
	var oldmainimagesrc = String();
	oldmainimagesrc = document.forms[0].RepeatMainImage__ctl0_ModelImg.src;
	t = RemoveSmallAddBigProductResize(imageobject.src);
	document.forms[0].RepeatMainImage__ctl0_ModelImg.src = t;
	currentsrc2 = imageobject.src;
	oldmainimagesrc = RemoveBigAddSmallProductResize(oldmainimagesrc)
	imageobject.src = oldmainimagesrc;	
	
	fullurl=location.href.replace(/\?.*/,'') 
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	finalurl = fullurl.replace(sPage,'')
	
	currentsrc2 = currentsrc2.replace("thumbnail.aspx?width=60&filename=","")
	
	currentsrc2 = currentsrc2.replace(finalurl,'')
	document.getElementById("ImagePopUpLink").href = "javascript:pop('flashpreview.aspx?imageurl="+ currentsrc2 +"',800,600);"
}