/*==================================================================================================================*/
function clearme(FormField) {
	if (FormField.defaultValue==FormField.value) FormField.value="";
}//end function
/*==================================================================================================================*/
function resetme(FormField) {
	FormField.value=FormField.defaultValue;
}//end function
/*==================================================================================================================*/
var xSkewClassName="skew";//the first class name of any image you want to skew
/*==================================================================================================================*/
function getImages(xImageClass){
	var i=0;
	var j=0;
	var arrImages=document.getElementsByTagName('img'); 
	var xResult=new Array();
	var xImage;
var xImageClasses;
	for (i=0;i<arrImages.length;i++) {
		xImage=arrImages[i];
		xImageClasses=xImage.className.split(' ');
		for (j=0; j<xImageClasses.length; j++) {
			if (xImageClasses[j]==xImageClass) {
				xResult.push(xImage);
				break;
			}//end if (xImageClasses[j]==xImageClass)
		}//next j<xImageClasses.length
	}//next i<arrImages.length
	return xResult;
}//end function
/*==================================================================================================================*/
function getClasses(xImageClasses,xClassName){
	var xResult='';
	for (i=0;i<xImageClasses.length;i++) {
		if (xImageClasses[i] != xClassName) {
			if (xResult!='') {
				xResult+=' '
			}//end if (xResult!='')
			xResult+=xImageClasses[i];
		}//end if (xImageClasses[i] != xClassName)
	}//next i<xImageClasses.length
	return xResult;
}//end function
/*==================================================================================================================*/
function getClassValue(xImageClasses,xClassName){
	var xResult=0;
	for (var i=0;i<xImageClasses.length;i++) {
		if (xImageClasses[i].indexOf(xClassName)==0) {
			xResult=Math.min(xImageClasses[i].substring(xClassName.length),100);
			break;
		}//end if (xImageClasses[i].indexOf(xClassName)==0)
	}//next i<xImageClasses.length
	return Math.max(0,xResult);
}//end function
/*==================================================================================================================*/
function getClassColor(xImageClasses,xClassName){
	var xColour='';
	for (var i=0;i<xImageClasses.length;i++) {
		if (xImageClasses[i].indexOf(xClassName)==0) {
			xColour='#'+xImageClasses[i].substring(xClassName.length).toLowerCase();
			break;
		}//end if (xImageClasses[i].indexOf(xClassName)==0)
	}//next i<xImageClasses.length
	if (xColour.match(/^#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i)) {
		return xColour;
	} else {
		return 0;
	}//end if (xColour.match(/^#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i))
}//end function
/*==================================================================================================================*/
function getClassAttribute(xImageClasses,xClassName){
	var xResult=0;
	for (var i=0;i<xImageClasses.length;i++) {
		if (xImageClasses[i].indexOf(xClassName)==0) {
			xResult=1; 
			break;
		}//end if (xImageClasses[i].indexOf(xClassName)==0)
	}//next i<xImageClasses.length
	return xResult;
}//end function
/*==================================================================================================================*/
function clipRight(ctx,x,y,w,h,t,d,s) {
	var z=(h-t-t)/h;
	ctx.beginPath();
	ctx.moveTo(x,y);
	ctx.lineTo(w,y+t);
	ctx.lineTo(w,y+h-t);
	ctx.lineTo(x,y+h);
	if (d>0) {
		ctx.lineTo(x,y+h-s);
		ctx.lineTo(w,y+h-t-(z*s));
		ctx.lineTo(w,y+h-t-(z*(s+d)));
		ctx.lineTo(x,y+h-s-d);
	}//end if (d>0)
	ctx.closePath();
}//end function
/*==================================================================================================================*/
function clipLeft(ctx,x,y,w,h,t,d,s) {
	var z=(h-t-t)/h;
	ctx.beginPath();
	ctx.moveTo(x,y+t);
	ctx.lineTo(w,y+1);
	ctx.lineTo(w,y+h);
	ctx.lineTo(x,y+h-t);
	if (d>0) {
		ctx.lineTo(x,y+h-t-(z*s));
		ctx.lineTo(w,y+h-s);
		ctx.lineTo(w,y+h-s-d);
		ctx.lineTo(x,y+h-t-(z*(s+d)));
	}//end if (d>0)
	ctx.closePath();
}//end function
/*==================================================================================================================*/
function strokeRight(ctx,x,y,w,h,t,d,s,b) {
	var z=(h-t-t)/h;
	var n=(b>=1?1:0);
	ctx.beginPath();
	ctx.moveTo(x+b,y+b);
	ctx.lineTo(w-b,y+t+b-n);
	ctx.lineTo(w-b,y+h-t-(z*(s+d))-b);
	ctx.lineTo(x+b,y+h-s-d-b);
	ctx.closePath();
}//end function
/*==================================================================================================================*/
function strokeLeft(ctx,x,y,w,h,t,d,s,b) {
	var z=(h-t-t)/h;
	var n=(b>=1?1:0);
	ctx.beginPath();
	ctx.moveTo(x+b,y+t+b-n);
	ctx.lineTo(w-b,y+b);
	ctx.lineTo(w-b,y+h-s-d-b);
	ctx.lineTo(x+b,y+h-t-(z*(s+d))-b);
	ctx.closePath();
}//end function
/*==================================================================================================================*/
function clipReflex(ctx,x,y,w,h,t,d,s,o) {
	var z=(h-t-t)/h;
	ctx.beginPath();
	if (o=='r') {
		ctx.moveTo(x,y+h-s);
		ctx.lineTo(w,y+h-t-(z*s));
		ctx.lineTo(w,y+h-t+2);
		ctx.lineTo(x,y+h+2);
	} else {
		ctx.moveTo(w,y+h+2);
		ctx.lineTo(w,y+h-s);
		ctx.lineTo(x,y+h-t-(z*s));
		ctx.lineTo(x,y+h-t+2);
	}//end if (o=='r')
	ctx.closePath();
}//end function
/*==================================================================================================================*/
function clearReflex(ctx,x,y,w,h,t,d,s,o) {
	var z=(h-t-t)/h;
	ctx.beginPath();
	if (o=='r') {
		ctx.moveTo(x,y+h-1);
		ctx.lineTo(w,y+h-t-1);
		ctx.lineTo(w,y+h-t+1);
		ctx.lineTo(x,y+h+1);
	} else {
		ctx.moveTo(w,y+h-1);
		ctx.lineTo(x,y+h-t-1);
		ctx.lineTo(x,y+h-t+1);
		ctx.lineTo(w,y+h+1);
	}//end if (o=='r')
	ctx.closePath();
}//end function
/*==================================================================================================================*/
function addIEReflex() {
	var theimages=getImages(xSkewClassName);
	var image, object, vml, display, flt, classes, newClasses, head, fill, flex, foot;  
	var i, j, z, q, p, dist, xStyle, iter, rest, radi, higt, divs, opac, colr, bord, wide, half, ih, iw, ww, hh, fb, xb;  
	var pushRight, pushNone, pushLeft, iheight, refOpac, refOffset, iborder, icolor, iradius;
	var xImages=document.getElementsByTagName('img');
	var tilt='r';
	for(i=0;i<theimages.length;i++) {	
		image=theimages[i];
		object=image.parentNode;
		j=0;
		pushRight=0;
		pushNone=0;
		pushLeft=0;
		iheight=33;
		refOpac=33;
		refOffset=0;
		iborder=0;
		icolor='#ff0000';
		iradius=0;
		if (image.width>=32 && image.height>=32) {
			classes=image.className.split(' ');
			iradius=getClassValue(classes,"iradius");
			iborder=getClassValue(classes,"iborder");
			iheight=getClassValue(classes,"iheight");
			refOpac=getClassValue(classes,"refOpac");
			refOffset=getClassValue(classes,"refOffset");
			icolor=getClassColor(classes,"icolor");
			pushLeft=getClassAttribute(classes,"pushLeft");
			pushRight=getClassAttribute(classes,"pushRight");
			pushNone=getClassAttribute(classes,"pushNone");
			if (pushRight==true) {
				tilt='r';
			}//end if (pushRight==true)
			if (pushNone==true) {
				tilt='n';
			}//end if (pushNone==true)
			if (pushLeft==true) {
				tilt='l';
			}//end if (pushLeft==true)
			newClasses=getClasses(classes,xSkewClassName);	
			ih=image.height;
			iw=image.width;
			dist=refOffset;
			radi=Math.min(iradius,Math.max(iw,ih)/10);
			colr=(icolor!=0?icolor:'#ff0000');
			opac=(refOpac>0?refOpac:33);
			divs=100/(iheight>=10?iheight:33);
			p=(iheight>=10?iheight:33)/100;
			higt=Math.floor(ih/divs);
			wide=12;
			if (iborder==1) {
				bord=0;
			} else {
				iborder=Math.floor(Math.round(Math.min(Math.min(iborder,higt/4),Math.max(iw,ih)/20))/2)*2;
				bord=(iborder>0?iborder/2:0);
			}//end if (iborder==1)
			ww=parseInt(iw/20);
			q=1;
			iter=Math.floor((iw-ww-ww)/wide);
			rest=((iw-ww-ww)%wide);
			half=(((iw-ww-ww)/wide)-1)/2;
			hh=iter+(rest>0?1:0);
			z=(ih-hh-hh)/ih;
			display=(image.currentStyle.display.toLowerCase()=='block')?'block':'inline-block';
			vml=document.createElement(['<var style="overflow:hidden;display:'+display+';width:'+iw+'px;height:'+(ih+higt+dist)+'px;padding:0;">'].join(''));
			flt=image.currentStyle.styleFloat.toLowerCase();
			display=(flt=='left'||flt=='right')?'inline':display;
			head='<v:group';
			head+=' style="';
			head+=' zoom:1;';
			head+=' display:' + display + ';';
			head+=' margin:-1px 0 0 -1px;';
			head+=' padding:0;';
			head+=' position:relative;';
			head+=' width:' + iw + 'px;';
			head+=' height:' + (ih+higt+dist) + 'px;"';
			head+=' coordsize="' + iw + ',' + (ih+higt+dist);
			head+=' ">';
			if (tilt=='n') {
				fill='<v:rect';
				fill+=' strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff"';
				fill+=' style="position:absolute; margin:-1px 0 0 -1px; padding:0; top:0px;';
				fill+=' left:0px; width:'+iw+'px;height:'+ih+'px;">';
				fill+='<v:fill src="'+image.src+'" type="frame" />';
				fill+='</v:rect>';
				fb='<v:rect';
				fb+=' strokeweight="'+iborder+'"';
				fb+=' strokecolor="'+colr+'"';
				fb+=' filled="f" stroked="'+(bord>0||iborder>0?'t':'f')+'"';
				fb+=' fillcolor="#ffffff"';
				fb+=' style="position:absolute; margin:-1px 0 0 -1px;';
				fb+=' padding:0; top:'+bord+'px; left:'+bord+'px;';
				fb+=' width:'+(iw-bord-bord)+'px;height:'+(ih-bord-bord)+'px;">';
				fb+='</v:rect>';
				xb='<v:rect';
				xb+=' strokeweight="'+iborder+'"';
				xb+=' strokecolor="'+colr+'"';
				xb+=' filled="f" stroked="'+(bord>0||iborder>0?'t':'f')+'"';
				xb+=' fillcolor="#ffffff"';
				xb+=' style="position:absolute; margin:-1px 0 0 -1px; padding:0;';
				xb+=' top:'+(ih+dist+bord)+'px;';
				xb+=' left:'+bord+'px;';
				xb+=' width:'+(iw-bord-bord)+'px;';
				xb+=' height:'+(higt-bord-bord)+'px;';
				xb+=' filter: progid:DXImageTransform.Microsoft.Alpha(opacity='+opac+',style=1,finishOpacity=0,startx=0,starty=0,finishx=0,finishy='+parseInt(ih*0.66)+');">';
				xb+='</v:rect>';
				flex='<v:rect';
				flex+=' strokeweight="0" filled="t"';
				flex+=' stroked="f" fillcolor="#ffffff"';
				flex+=' style="position:absolute; margin:-1px 0 0 -1px;';
				flex+=' padding:0; top:'+(ih+dist)+'px; left:0px;';
				flex+=' width:'+iw+'px;height:'+higt+'px;';
				flex+=' filter:flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+opac+',style=1,finishOpacity=0,startx=0,starty=0,finishx=0,finishy='+ih+');">';
				flex+='<v:fill origin="0,0"';
				flex+=' position="0,-'+(divs/2-0.5)+'"';
				flex+=' size="1,'+(1*divs)+'"';
				flex+=' src="'+image.src+'"';
				flex+=' type="frame"/>';
				flex+='</v:rect>';
			} else if (tilt=='r') {
				fill='<v:rect';
				fill+=' strokeweight="0" filled="t"';
				fill+=' stroked="f" fillcolor="#808080"';
				fill+=' style="position:absolute; margin:-1px 0 0 -1px;';
				fill+=' padding:0; width:'+iw+'px;height:'+(ih+higt+dist)+'px;">';
				fill+='<v:fill color="#808080" opacity="0.0" />';
				fill+='</v:rect>';
				fill+='<v:shape';
				fill+=' strokeweight="0" filled="t"';
				fill+=' stroked="f" fillcolor="#ffffff"';
				fill+=' coordorigin="0,0" coordsize="'+iw+','+ih+'"';
				fill+=' path="m '+ww+',0 l '+ww+','+ih+','+(iw-ww)+','+(ih-hh)+','+(iw-ww)+','+hh+' x e"';
				fill+=' style="position:absolute; margin:-1px 0 0 -1px;';
				fill+=' padding:0; top:0px; left:0px; width:'+iw+'px;height:'+ih+'px;">';
				fill+='<v:fill src="'+image.src+'" type="frame" />';
				fill+='</v:shape>';
				for(j=0;j<iter;j++) {
					if (j==(iter-1)) {
						q=(rest>0?1:0);
					}//end if (j==(iter-1))
					fill+='<v:shape';
					fill+=' strokeweight="0" filled="t"';
					fill+=' stroked="f" fillcolor="#808080"';
					fill+=' coordorigin="0,0"';
					fill+=' coordsize="'+iw+','+ih+'"';
					fill+=' path="m '+(ww+(j*wide))+','+j+' l '+(q+ww+((j+1)*wide))+','+(j+1)+','+(q+ww+((j+1)*wide))+','+(ih-1-j)+','+(ww+(j*wide))+','+(ih-j)+' x e"';
					fill+=' style="position:absolute; margin: -1px 0 0 -1px;';
					fill+=' padding:0px; top:0px; left:0px; width:'+iw+'px;';
					fill+=' height:'+ih+'px;">';
					fill+='<v:fill';
					fill+=' origin="0,0" position="'+(half-j)+',0"';
					fill+=' size="'+((iw-ww-ww)/wide)+',1"';
					fill+=' type="frame" src="'+image.src+'" />';
					fill+='</v:shape>';
				}//next j<iter
				if (rest>0) {
					fill+='<v:shape';
					fill+=' strokeweight="0" filled="t"';
					fill+=' stroked="f" fillcolor="#808080"';
					fill+=' coordorigin="0,0" coordsize="'+iw+','+ih+'"';
					fill+=' path="m '+(ww+(j*wide))+','+j+' l '+(ww+((j+1)*wide))+','+(j+1)+','+(ww+((j+1)*wide))+','+(ih-1-j)+','+(ww+(j*wide))+','+(ih-j)+' x e"';
					fill+=' style="position:absolute; margin: -1px 0 0 -1px; padding:0px;';
					fill+=' top:0px; left:0px; width:'+iw+'px; height:'+ih+'px;">';
					fill+='<v:fill';
					fill+=' origin="0,0" position="'+(half-j)+',0"';
					fill+=' size="'+((iw-ww-ww)/wide)+',1"';
					fill+=' type="frame" src="'+image.src+'" />';
					fill+='</v:shape>';
				}//end if (rest>0)
				q=((iter*z)/(ih/100))/2; 
				if (bord>0||iborder>0) {
					fb='<v:shape';
					fb+=' strokeweight="'+iborder+'"';
					fb+=' strokecolor="'+colr+'"';
					fb+=' filled="f" stroked="'+(bord>0||iborder>0?'t':'f')+'"';
					fb+=' coordorigin="0,0" coordsize="'+iw+','+ih+'"';
					fb+=' path="m '+(ww+bord)+','+bord+' l '+(ww+bord)+','+(ih-bord)+','+(iw-ww-bord)+','+(ih-hh-bord)+','+(iw-ww-bord)+','+(hh+bord)+' x e"';
					fb+=' style="position:absolute; margin:-1px 0 0 -1px;';
					fb+=' padding:0; top:0px; left:0px; width:'+iw+'px;height:'+ih+'px;">';
					fb+='</v:shape>';
					xb='<v:shape';
					xb+=' strokeweight="'+iborder+'"';
					xb+=' strokecolor="'+colr+'" stroked="'+(bord>0||iborder>0?'t':'f')+'"';
					xb+=' filled="f" coordorigin="0,0"';
					xb+=' coordsize="'+iw+','+(hh+higt+dist)+'"';
					xb+=' path="m '+(ww+bord)+','+(hh+dist+bord)+' l '+(ww+bord)+','+(higt+hh+dist-bord)+','+(iw-ww-bord);
					xb+=','+(parseInt((higt+dist)*z)-bord)+','+(iw-ww-bord)+','+(parseInt(dist*z)+bord)+' x e"';
					xb+=' style="position:absolute; margin:-1px 0 0 -1px;';
					xb+=' padding:0; top:'+(ih-hh+dist)+'px;';
					xb+=' left:0px; width:'+iw+'px;';
					xb+=' height:'+(hh+higt+dist)+'px; flip: y;';
					xb+=' filter:flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+opac+',style=1,finishOpacity=0,startx=0,starty=0,finishx='+q+',finishy=80);">';
					xb+='</v:shape>';
				} else {
					fb='';
					xb='';
				}//end if (bord>0||iborder>0)
				flex='<v:shape';
				flex+=' strokeweight="0" stroked="f"';
				flex+=' filled="t" fillcolor="#808080"';
				flex+=' coordorigin="0,0" coordsize="'+iw+','+(hh+higt+dist)+'"';
				flex+=' path="m '+ww+','+(hh+dist)+' l '+ww+','+(higt+hh+dist)+','+(iw-ww)+','+parseInt((higt+dist)*z)+','+(iw-ww)+','+parseInt(dist*z)+' x e"';
				flex+=' style="position:absolute; margin:-1px 0 0 -1px;';
				flex+=' padding:0; top:'+(ih-hh+dist)+'px; left:0px; width:'+iw+'px;height:'+(hh+higt+dist)+'px; flip: y;';
				flex+=' filter:flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+opac+',style=1,finishOpacity=0,startx=0,starty=0,finishx='+q+',finishy=90);">';
				flex+='<v:fill';
				flex+=' origin="0,0" position="0,-'+((divs/2)-0.5)+'" size="1,'+(divs)+'"';
				flex+=' src="'+image.src+'" type="frame" />';
				flex+='</v:shape>';
			} else if (tilt=='l') {
				fill='<v:rect';
				fill+=' strokeweight="0" filled="t" stroked="f" fillcolor="#808080"';
				fill+=' style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:'+iw+'px;height:'+(ih+higt+dist)+'px;">';
				fill+='<v:fill';
				fill+=' color="#808080" opacity="0.0" />';
				fill+='</v:rect>';
				fill+='<v:shape';
				fill+=' strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff"';
				fill+=' coordorigin="0,0" coordsize="'+iw+','+ih+'" path="m '+ww+','+hh+' l '+ww+','+(ih-hh)+','+(iw-ww)+','+ih+','+(iw-ww)+',0 x e"';
				fill+=' style="position:absolute; margin:-1px 0 0 -1px; padding:0; top:0px; left:0px; width:'+iw+'px;height:'+ih+'px;">';
				fill+='<v:fill src="'+image.src+'" type="frame" />';
				fill+='</v:shape>';
				for(j=0;j<iter;j++) {
					if (j==(iter-1)) {
						q=(rest>0?1:0);
					}//end if (j==(iter-1))
					fill+='<v:shape';
					fill+=' strokeweight="0" filled="t" stroked="f" fillcolor="#808080"';
					fill+=' coordorigin="0,0" coordsize="'+iw+','+ih+'"';
					fill+=' path="m '+(ww+(j*wide))+','+(iter-j)+' l '+(q+ww+((j+1)*wide))+','+(iter-1-j)+','+(q+ww+((j+1)*wide))+','+(ih-1-iter+j)+','+(ww+(j*wide))+','+(ih-iter+j)+' x e"';
					fill+=' style="position:absolute; margin: -1px 0 0 -1px; padding:0px; top:0px; left:0px; width:'+iw+'px; height:'+ih+'px;">';
					fill+='<v:fill';
					fill+=' origin="0,0" position="'+(half-j)+',0"';
					fill+=' size="'+((iw-ww-ww)/wide)+',1"';
					fill+=' type="frame" src="'+image.src+'" />';
					fill+='</v:shape>';
				}//next j<iter
				if (rest>0) {
					fill+='<v:shape';
					fill+=' strokeweight="0" filled="t" stroked="f" fillcolor="#808080"';
					fill+=' coordorigin="0,0" coordsize="'+iw+','+ih+'"';
					fill+=' path="m '+(ww+(j*wide))+','+(iter-j)+' l '+(ww+((j+1)*wide))+','+(iter-1-j)+','+(ww+((j+1)*wide))+','+(ih-1-iter+j)+','+(ww+(j*wide))+','+(ih-iter+j)+' x e"';
					fill+=' style="position:absolute; margin: -1px 0 0 -1px; padding:0px; top:0px; left:0px; width:'+iw+'px; height:'+ih+'px;">';
					fill+='<v:fill';
					fill+=' origin="0,0" position="'+(half-j)+',0"';
					fill+=' size="'+((iw-ww-ww)/wide)+',1"';
					fill+=' type="frame" src="'+image.src+'" />';
					fill+='</v:shape>';
				}//end if (rest>0)
				q=100-(((iter*z)/(ih/100))/2); 
				if (bord>0||iborder>0) {
					fb='<v:shape';
					fb+=' strokeweight="'+iborder+'" strokecolor="'+colr+'" filled="f" stroked="'+(bord>0||iborder>0?'t':'f')+'"';
					fb+=' coordorigin="0,0" coordsize="'+iw+','+ih+'"';
					fb+=' path="m '+(ww+bord)+','+(hh+bord)+' l '+(ww+bord)+','+(ih-hh-bord)+','+(iw-ww-bord)+','+(ih-bord)+','+(iw-ww-bord)+','+bord+' x e"';
					fb+=' style="position:absolute; margin:-1px 0 0 -1px; padding:0; top:0px; left:0px; width:'+iw+'px;height:'+ih+'px;">';
					fb+='</v:shape>';
					xb='<v:shape';
					xb+=' strokeweight="'+iborder+'" strokecolor="'+colr+'"';
					xb+=' stroked="'+(bord>0||iborder>0?'t':'f')+'" filled="f"';
					xb+=' coordorigin="0,0" coordsize="'+iw+','+(hh+higt+dist)+'"';
					xb+=' path="m '+(ww+bord)+','+(parseInt(dist*z)+bord)+' l '+(ww+bord)+','+(parseInt((higt+dist)*z)-bord)+','+(iw-ww-bord)+','+(higt+hh+dist-bord)+','+(iw-ww-bord)+','+(hh+dist+bord)+' x e"';
					xb+=' style="position:absolute; margin:-1px 0 0 -1px; padding:0;';
					xb+=' top:'+(ih-hh+dist)+'px; left:0px; width:'+iw+'px;height:'+(hh+higt+dist)+'px; flip: y;';
					xb+=' filter:flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+opac+',style=1,finishOpacity=0,startx=100,starty=0,finishx='+q+',finishy=80);">';
					xb+='</v:shape>';
				} else {
					fb='';
					xb='';
				}//end if (bord>0||iborder>0)
				flex='<v:shape';
				flex+=' strokeweight="0" filled="t" stroked="f" fillcolor="#808080"';
				flex+=' coordorigin="0,0" coordsize="'+iw+','+(hh+higt+dist)+'"';
				flex+=' path="m '+ww+','+parseInt(dist*z)+' l '+ww+','+parseInt((higt+dist)*z)+','+(iw-ww)+','+(higt+hh+dist)+','+(iw-ww)+','+(hh+dist)+' x e"';
				flex+=' style="position:absolute; margin:-1px 0 0 -1px; padding:0; top:'+(ih-hh+dist)+'px;';
				flex+=' left:0px; width:'+iw+'px;height:'+(hh+higt+dist)+'px; flip: y;';
				flex+=' filter:flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+opac+',style=1,finishOpacity=0,startx=100,starty=0,finishx='+q+',finishy=90);">';
				flex+='<v:fill';
				flex+=' origin="0,0" position="0,-'+((divs/2)-0.5)+'"';
				flex+=' size="1,'+(divs)+'" src="'+image.src+'" type="frame" />';
				flex+='</v:shape>';
			}//end if (tilt=='n')
			foot='</v:group>';
			vml.innerHTML=head+flex+xb+fill+fb+foot;
			vml.className=newClasses;
			vml.style.cssText=image.style.cssText;
			vml.style.height=ih+higt+dist+'px';
			vml.width=iw;
			vml.height=ih+higt+dist;
			vml.style.width=iw+'px';
			vml.src=image.src;
			vml.alt=image.alt;
			if (image.id!='') {
				vml.id=image.id;
			}//end if (image.id!='')
			if (image.title!='') {
				vml.title=image.title;
			}//end if (image.title!='')
			if (image.getAttribute('onclick')!='') {
				vml.setAttribute('onclick',image.getAttribute('onclick'));
			}//end if (image.getAttribute('onclick')!='')
			object.replaceChild(vml,image);
			if (tilt=='r') {
				tilt='n';
			} else if (tilt=='n') {
				tilt='l';
			} else if (tilt=='l') {
				tilt='r';
			}//end if (tilt=='r')
			vml.style.visibility='visible';
		}//end if (image.width>=32 && image.height>=32)
	}//next i<theimages.length
}//end function
/*==================================================================================================================*/
function addReflex() {
	var theimages=getImages(xSkewClassName);
	var image, object, canvas, context, classes, newClasses, resource, tmp;  
	var i, j, dist, xStyle, iter, rest, radi, higt, divs, opac, colr, bord, wide, ih, iw;  
	var pushRight, pushNone, pushLeft, iheight, refOpac, refOffset, iborder, icolor, iradius;
	var xImages=document.getElementsByTagName('img');
	var tilt='r';
	var isWK=navigator.appVersion.indexOf('WebKit')!=-1?1:0;
	var isOP=window.opera?1:0;
	var isW5=document.defaultCharset&&!window.execScript?1:0;
	for(i=0;i<theimages.length;i++) {	
		image=theimages[i];
		object=image.parentNode;
		tmp=0;
		pushRight=0;
		pushNone=0;
		pushLeft=0;
		iheight=33;
		refOpac=33;
		refOffset=0;
		iborder=0;
		icolor='#ff0000';
		iradius=0;
		canvas=document.createElement('canvas');
		if (canvas.getContext && image.width>=32 && image.height>=32) {
			classes=image.className.split(' ');
			iradius=getClassValue(classes,"iradius");
			iborder=getClassValue(classes,"iborder");
			iheight=getClassValue(classes,"iheight");
			refOpac=getClassValue(classes,"refOpac");
			refOffset=getClassValue(classes,"refOffset");
			icolor=getClassColor(classes,"icolor");
			pushLeft=getClassAttribute(classes,"pushLeft");
			pushRight=getClassAttribute(classes,"pushRight");
			pushNone=getClassAttribute(classes,"pushNone");
			if (pushRight==true) {
				tilt='r';
			}//end if (pushRight==true)
			if (pushNone==true) {
				tilt='n';
			}//end if (pushNone==true)
			if (pushLeft==true) {
				tilt='l';
			}//end if (pushLeft==true)
			newClasses=getClasses(classes,xSkewClassName);	
			ih=image.height;
			iw=image.width;
			dist=refOffset;
			radi=Math.min(iradius,Math.max(iw,ih)/10);
			colr=(icolor!=0?icolor:'#ff0000');
			opac=(100-(refOpac>0?refOpac:33))/100;
			divs=100/(iheight>=10?iheight:33);
			higt=Math.floor(image.height/divs);
			iborder=Math.round(Math.min(Math.min(iborder,higt/4),Math.max(iw,ih)/20));
			wide=12;
			bord=(iborder>0?iborder/2:0);
			canvas.className=newClasses;
			canvas.style.cssText=image.style.cssText;
			canvas.style.height=ih+higt+dist+'px';
			canvas.width=iw;
			canvas.style.width=iw+'px';
			canvas.height=ih+higt+dist;
			canvas.src=image.src;
			canvas.alt=image.alt;
			if (image.id!='') {
				canvas.id=image.id;
			}//end if (image.id!='')
			if (image.title!='') {
				canvas.title=image.title;
			}//end if (image.title!='')
			if (image.getAttribute('onclick')!='') {
				canvas.setAttribute('onclick',image.getAttribute('onclick'));
			}//end if (image.getAttribute('onclick')!='')
			iter=Math.floor(canvas.width/wide);
			rest=(canvas.width%wide);
			if (tilt=='l'||tilt=='r') {
				resource=document.createElement('canvas');
				if (resource.getContext) {
					resource.style.position='fixed';
					resource.style.left=-9999+'px';
					resource.style.top=0+'px';
					resource.height=canvas.height;
					resource.width=canvas.width;
					resource.style.height=canvas.height+'px';
					resource.style.width=canvas.width+'px';
					if (isWK&&!isW5) {
						object.appendChild(resource);
					}//end if (isWK&&!isW5)
				}//end if (resource.getContext)
			}//end if (tilt=='l'||tilt=='r')
			context=canvas.getContext("2d");
			object.replaceChild(canvas,image);
			context.clearRect(0,0,canvas.width,canvas.height);
			context.globalCompositeOperation="source-over";
			context.fillStyle='rgba(0,0,0,0)';
			context.fillRect(0,0,canvas.width,canvas.height);
			context.save();
			context.translate(0,canvas.height);
			context.scale(1,-1);
			context.drawImage(image,0,-(canvas.height-higt-higt-dist),canvas.width,canvas.height-higt-dist);
			context.restore();
			if (iborder>0) {
				context.strokeStyle=colr;
				context.lineWidth=iborder;
				context.beginPath();
				context.rect(bord,canvas.height-higt+bord,canvas.width-iborder,higt);
				context.closePath();
				context.stroke();
			}//end if (iborder>0)
			if (!isWK||tilt=='n') {
				context.globalCompositeOperation="destination-out";
				xStyle=context.createLinearGradient(0,canvas.height-higt,0,canvas.height);
				xStyle.addColorStop(1,"rgba(0,0,0,1.0)");
				xStyle.addColorStop(0,"rgba(0,0,0,"+opac+")");
				context.fillStyle=xStyle;
			}//end if (!isWK||tilt=='n')
			if (isWK) {
				context.beginPath();
				context.rect(0,canvas.height-higt,canvas.width,higt);
				context.closePath();
				context.fill();
			} else {
				context.fillRect(0,canvas.height-higt,canvas.width,higt);
			}//end if (isWK)
			context.globalCompositeOperation="source-over";
			context.drawImage(image,0,0,iw,ih);
			context.save();
			if (isWK&&dist>0&&tilt!='n') {
				context.fillStyle='#808080';
				context.fillRect(0,canvas.height-higt-dist,canvas.width,dist);
			}//end if (isWK&&dist>0&&tilt!='n')
			if (iborder>0) {
				if (tilt=='n') {
					context.beginPath();
					context.rect(bord,bord,canvas.width-iborder,canvas.height-higt-dist-iborder);
					context.closePath();
					context.stroke();
				}//end if (tilt=='n')
			}//end if (iborder>0)
			if (tilt=='l'||tilt=='r') {
				if (resource.getContext) {
					context=resource.getContext("2d");
					context.globalCompositeOperation="source-over";
					context.clearRect(0,0,resource.width,resource.height);					
					if (tilt=='r') {
						for(j=0;j<iter;j++) {
							context.drawImage(canvas,j*wide,0,wide,resource.height,j*wide,j*1,wide,resource.height-(j*2));
						}//next j<iter
						if (rest>0) {
							rest=canvas.width-(iter*wide);
							context.drawImage(canvas,j*wide,0,rest,resource.height,j*wide,j*1,rest,resource.height-(j*2));
						}//end if (rest>0)
					} else {
						for(j=0;j<iter;j++) {
							context.drawImage(canvas,j*wide,0,wide,resource.height,j*wide,(iter-j)*1,wide,resource.height-((iter-j)*2));
						}//next j<iter
						if (rest>0) {
							rest=canvas.width-(iter*wide);
							context.drawImage(canvas,j*wide,0,rest,resource.height,j*wide,0,rest,resource.height);
						}//end if (rest>0)
					}//end if (tilt=='r')
					context.save();
					if (canvas.getContext) {
						context=canvas.getContext("2d");
						context.clearRect(0,0,canvas.width,canvas.height);						
						if (tilt=='r') {
							clipRight(context,canvas.width/20,0,canvas.width*0.95,canvas.height,iter+(rest>0?1:0),dist,higt);
						} else {
							clipLeft(context,canvas.width/20,0,canvas.width*0.95,canvas.height,iter+(rest>0?1:1),dist,higt);
						}//end if (tilt=='r')
						context.clip();
						context.drawImage(resource,parseInt(canvas.width/20),0,parseInt(canvas.width*0.9),canvas.height);
						context.save();
						if (iborder>0) {
							context.lineWidth=iborder;
							if (tilt=='r') {
								strokeRight(context,canvas.width/20,0,canvas.width*0.95,canvas.height,iter+(rest>0?1:0),dist,higt,bord);
								context.stroke();
							} else {
								strokeLeft(context,canvas.width/20,0,canvas.width*0.95,canvas.height,iter+(rest>0?1:0),dist,higt,bord);
								context.stroke();
							}//end if (tilt=='r')
						}//end if (iborder>0)
						if (isWK) {
							context.globalCompositeOperation="destination-out";
							xStyle=context.createLinearGradient((tilt=='l'?canvas.width:0),canvas.height-higt,(tilt=='l'?canvas.width-parseInt(wide/divs):parseInt(wide/divs)),canvas.height);
							xStyle.addColorStop(1,"rgba(255,0,0,1.0)");
							xStyle.addColorStop(0,"rgba(255,0,0,"+opac+")");
							context.fillStyle=xStyle;
							clipReflex(context,canvas.width/20,0,canvas.width*0.95,canvas.height,iter+(rest>0?1:0),dist,higt,tilt);
							context.fill();
							globalCompositeOperation="source-in";
							clearReflex(context,canvas.width/20,0,canvas.width*0.95,canvas.height,iter+(rest>0?1:0),dist,higt,tilt);
							context.clip();
							context.clearRect(0,0,canvas.width,canvas.height);
							context.clearRect(0,0,canvas.width,canvas.height);
							context.clearRect(0,0,canvas.width,canvas.height);
							context.clearRect(0,0,canvas.width,canvas.height);
							if (isWK&&!isW5) {
								object.removeChild(resource);
							}//end if (isWK&&!isW5)
						}//end if (isWK)
					}//end if (canvas.getContext)
				}//end if (resource.getContext)
			}//end if (tilt=='l'||tilt=='r')
			if (tilt=='r') {
				tilt='n';
			} else if (tilt=='n') {
				tilt='l';
			} else if (tilt=='l') {
				tilt='r';
			}//end if (tilt=='r')
			context.save();
			canvas.style.visibility='visible';
		}//end if (canvas.getContext && image.width>=32 && image.height>=32)
	}//next i<theimages.length
}//end function
/*==================================================================================================================*/
window.onload=function () {
	xUAG=navigator.userAgent;
	if (xUAG.indexOf('MSIE')>0) {
		if(document.namespaces['v'] == null) {
			var xStyle = document.createStyleSheet();
			xStyle.addRule("v\\:*", "behavior: url(#default#VML);"); 
			document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); 
		}
		addIEReflex();
	} else {
		addReflex();
	}//end if (xUAG.indexOf("Microsoft Internet Explorer")>0)
}//end function
/*==================================================================================================================*/
var xmlhttp;
var xmlResponse;
var strPredictions;
var xSEARCHstr;
/*==================================================================================================================*/
function LoadFile(url) {
	xmlhttp=null;
	if (window.XMLHttpRequest) {// Firefox, Opera, IE7
		xmlhttp=new XMLHttpRequest();
	} else if (window.ActiveXObject) {// IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}//end if (window.XMLHttpRequest)
	if (xmlhttp!=null) {
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}//end if (xmlhttp!=null)
	return xmlResponse;
}//end function
/*==================================================================================================================*/
function Predict(FormField) {
	xSEARCHstr=FormField.value;
	if (xSEARCHstr!="") {
		LoadFile("http://www.stevesjazzsounds.co.uk/components/ajaxsearch.asp?xSEARCHstr="+xSEARCHstr);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {// 4 = "loaded"
				if (xmlhttp.status==200) {// 200 = "OK"
					xmlResponse=xmlhttp.responseText;
					if (xmlResponse!="no results") {
						document.getElementById("ajaxresults").innerHTML=xmlResponse;
						document.getElementById("ajaxresults").style.display="";
					} else {
						document.getElementById("ajaxresults").innerHTML="";
						document.getElementById("ajaxresults").style.display="none";
					} //end if (xmlResponse!="")
				}//end if (xmlhttp.status==200)
			}//end if (xmlhttp.readyState==4)
		}//end function
	} else {
		document.getElementById("ajaxresults").innerHTML="";
		document.getElementById("ajaxresults").style.display="none";
	}//end if (xSEARCHstr!="")
}//end function
//==============================================================================================
