﻿
function getQS(url, name) {

    var value = '';

    url = url.split('?')[1].toString();

    var qs = url.substring(url.search(name));

    var arrQS = qs.split('&');
    for (i = 0; i < arrQS.length; i++) {
        var arr = arrQS[i].toString().split('=');
        if (arr[0].toString() == name) {
            value = arr[1].toString();
            break;
        }
    }

    return value;
}

function SwapCSS(ss, id, css) {
	var e = null;

	if (ss) 
	{
	    
		e = document.getElementById(client_id + id);
	}
	else
	{
		e = document.getElementById(id);
	}

	e.className = css;
}

function SwapImgSrc(ss, id, source)
{

	var img = null;
	if(ss)
	{
		img = document.getElementById(client_id + id);
	}
	else
	{
		img = document.getElementById(id);
	}	

	img.src = source;

}

function ChangeAttributeValue (ss, id, attribute_name, attribute_value)
{
	var e = null;
	if(ss)
	{
		e = document.getElementById(client_id + id);
	}
	else
	{
		e = document.getElementById(id);
	}
	
	e.setAttribute('imgurl', attribute_value);
	
}
