//--- Initializing parameters ---
var ec_parameters = '';
var ec_ad_width = '';
var ec_ad_height = '';

//--- extracting parameters ---
if (typeof(encodeURIComponent) == 'function') {

	if(typeof(ec_authorization_code) != "undefined"){
		ec_parameters += '&authorization_code=' + ec_authorization_code;
	}

	if(typeof(ec_shopid) != "undefined"){
		ec_parameters += '&shopid=' + ec_shopid;
	}
	if(typeof(ec_order) != "undefined"){
		ec_parameters += '&order=' + ec_order;
	}

		if(typeof(ec_vertical) != "undefined"){
		ec_parameters += '&vertical=' + ec_vertical;
	}

	if(typeof(ec_article_category_code) != "undefined"){
		ec_parameters += '&article_category_code=' + ec_article_category_code;
	}

	//--- word ---
	if(typeof(ec_word) != "undefined"){
		ec_parameters += '&word=' + ec_word;
	}

	if(typeof(ec_target) != "undefined"){
		ec_parameters += '&target=' + ec_target;
	}

	if(typeof(ec_background_color) != "undefined"){
		color = ec_background_color.replace("#","");
		ec_parameters += '&background_color=' + color;
	}
	if(typeof(ec_arrow) != "undefined"){
		ec_parameters += '&arrow=' + ec_arrow;
	}
	if(typeof(ec_code) != "undefined"){
		ec_parameters += '&code=' + ec_code;
	}
	//--- template ---
	switch (ec_vertical){
	case '0':
		ec_ad_width = 468;
		ec_ad_height = 160;
		break;
	case '1':
		ec_ad_width = 148;
		ec_ad_height = 600;
		break;
	}//switch template end

	document.write('<if' + 'rame width="' + ec_ad_width + '" height="' + ec_ad_height + '" style="margin:auto;" frameBorder="0" src="http://moshi-parts.com/api/index' + ec_parameters + '" scrolling=\"no\"></ifr' + 'ame>');

}

