function DeleteBreak(string) {
		while(""+string.charAt(0)==" ") string = string.substring(1, string.length);
		return string;
}

function isNumber(string)
{
    if (string.search(/^\d+$/) != -1)
        return true;
    else
        return false;
}

function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@\w+(((\.|-)\w+)*)?\.\w+$/) != -1)
        return true;
    else
        return false;
}

function openMyRequests(link_my_requests) {
	window.open(link_my_requests, 'my_requests', 'hotkeys,resizable,scrollbars=yes');
}

function openWindow(url, window_name, params) {
	window.open(url, window_name, params + ', top=100,left=100,resizable=yes,scrollbars=yes'); 
}

function otvor_zmluvu_hzs() {
	window.open('index.php?www=insurance_hzs_edit_zmluva', 'union_hzs_zmluva', 'top=10,left=10,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=700,height=500'); 
}
function otvor_zmluvu_ccp() {
	window.open('index.php?www=insurance_ccp_edit_zmluva', 'union_ccp_zmluva', 'top=10,left=10,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=700,height=500'); 
}


function adjustIFrameSize(iframeWindow) {
	if (iframeWindow.document.height) {
		var iframeElement = document.getElementById(iframeWindow.name);
		// iframeElement.style.height = iframeWindow.document.height ; //+ 'px';
		iframeElement.style.height = iframeWindow.document.height<450? 450 + 'px' : iframeWindow.document.height + 'px';
		// iframeElement.style.width = iframeWindow.document.width + 'px';
	}
	else if (document.all) {
		var iframeElement = document.all[iframeWindow.name];
		if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat')  {
			// iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
			iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight<450? 450 + 'px' : iframeWindow.document.documentElement.scrollHeight + 'px';
			// iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 'px';
	    }
    	else {
			iframeElement.style.height = iframeWindow.document.body.scrollHeight<450? 450 + 'px' : iframeWindow.document.body.scrollHeight + 'px';
			// iframeElement.style.width = iframeWindow.document.body.scrollWidth + 'px';
	    }
	}
}
