var wm = {};
//function for checking value is empty or not
function isEmpty(v){ // copied into here from /src/javascript/common.js by ngd to fix bug - 16/7/2009
    return (v == null) || (v.length == 0) || (v.replace(' ', '').length==0);
}
//function for checking value is an digit, not comma or dot
function isDigit(v)
{
    //regular expression defining a 5 digit number
    var redigit=/[^\d]/ ;
    return !redigit.test(v)
}

function createIFrameShim(){
    // create an iframe at the exact same position and
    // size as the sub div
    // Google "iframe shime" for more information
    var shimmer = document.createElement('iframe');
    shimmer.id='shimmer';
    shimmer.style.position='absolute';
    // normally you would get the dimensions and
    // positions of the sub div dynamically. For demo
    // purposes this is hardcoded
    shimmer.style.width=screen.width+'px';
    shimmer.style.height=screen.height + 'px';
    shimmer.style.top='0px';
    shimmer.style.left='0px';
    shimmer.style.zIndex='1000';
    shimmer.setAttribute('frameborder','1');
    shimmer.setAttribute('src',"http://localhost/skilodgesvn/src/waiting.html");

    document.body.appendChild(shimmer);
//var sd = document.getElementById('subdiv');
//sd.style.visibility='visible';
}
function modalPopup(content, id, onDisplayCall){
    wm.currentPopup = new StickyWin.Modal({
        'content': content,
        'id':id,
        position: 'center',
        destroyOnClose : true,
        modalOptions: {
            modalStyle:{
                'background-color':'#d6e1b9',
                'opacity': 0.6
            }
        },
        onDisplay: function (){
            if(onDisplayCall){
                onDisplayCall();
            }

        }
    });
}
function destroyPopup(){
    wm.currentPopup.destroy();
}


function formSerialize(identifier) {
var parameters = {};
//$$(identifier)[0].getElements('input, select').each( function(el) {
$$(identifier+' input',identifier+' select', identifier+' textarea' ).each( function(el) {
    parameters[el.name]= el.value;
    });
return parameters;
}


