function falseFunc(){return false;};

function GetStringLength (str) 
{
   	var retCode = 0;
   	var strLength = 0;

   	for (i = 0; i < str.length; i++)
   	{
     		var code = str.charCodeAt(i)
     		var ch = str.substr(i,1).toUpperCase()
     		code = parseInt(code)
     		if ((ch < "0" || ch > "9") && (ch < "A" || ch > "Z") && ((code > 255) || (code < 0))){
       		strLength = strLength + 2;
     		} else { 
       		strLength = strLength + 1;
     		}
   	}
   	return strLength;
 }
 
function CreateImage(div,src,left,top,width,height) 
{
	if(div)
	{
		var img = document.createElement("img");

		img.src = src;	
		img.style.position = "absolute";
		if(left)img.style.left = left;
		if(top)img.style.top = top;
		if(width)img.style.width = width; 
		if(height)img.style.height = height; 
		
		div.appendChild(img);
		
		return img;
	}
	return null;
};

function CreateImage_vml(div,src,left,top,width,height) 
{
	if(div)
	{
		var img = document.createElement("v:image");

		img.src = src;	
		img.style.position = "absolute";
		if(left)img.style.left = left;
		if(top)img.style.top = top;
		if(width)img.style.width = width; 
		if(height)img.style.height = height; 
		
		div.appendChild(img);
		
		return img;
	}
	return null;
};


function CreateDiv(dParent,left,top,width,height) 
{
	if(dParent)
	{
		var dDiv = null;
		dDiv = document.createElement("div");
		
		dParent.appendChild(dDiv);
		dDiv.style.overflow = "hidden";
		dDiv.style.position = "absolute";
		dDiv.oncontextmenu = falseFunc;
		
		if(typeof(left) != "undefined")dDiv.style.left = left;
		if(typeof(top) != "undefined")dDiv.style.top = top;
		
		if(typeof(width) != "undefined")dDiv.style.width = width; 
		else dDiv.style.width = dParent.style.width;
		
		if(typeof(height) != "undefined")dDiv.style.height = height; 
		else dDiv.style.height = dParent.style.height;
		
		return dDiv;
	}
	return null;
};
